1. Jan 09, 2020
    • Pavel Labath's avatar
      [lldb/DWARF] Fix mixed v4+v5 location lists · cd5da94d
      Pavel Labath authored
      Summary:
      Our code was expecting that a single (symbol) file contains only one
      kind of location lists. This is not correct (on non-apple platforms, at
      least) as a file can compile units with different dwarf versions.
      
      This patch moves the deteremination of location list flavour down to the
      compile unit level, fixing this problem. I have also tried to rougly
      align the code with the llvm DWARFUnit. Fully matching the API is not
      possible because of how lldb's DWARFExpression lives separately from the
      rest of the DWARF code, but this is at least a step in the right
      direction.
      
      Reviewers: JDevlieghere, aprantl, clayborg
      
      Subscribers: dblaikie, lldb-commits
      
      Tags: #lldb
      
      Differential Revision: https://reviews.llvm.org/D71751
      cd5da94d
    • Pavel Labath's avatar
      [lldb/DWARF] Add is_dwo member to DWARFUnit · 9bb01efa
      Pavel Labath authored
      Summary:
      A skeleton unit can easily be detected by checking the m_dwo_symbol_file
      member, but we cannot tell a split unit from a normal unit from the
      "inside", which is sometimes useful.
      
      This patch adds a m_is_dwo member to enable this, and align the code
      with llvm::DWARFUnit. Right now it's only used to avoid creating a split
      unit inside another split unit (which removes one override from
      SymbolFileDWARFDwo and brings us a step closer to deleting it), but my
      main motivation is fixing the handling of location lists in mixed v4&v5
      files. This comes in a separate patch.
      
      Reviewers: JDevlieghere, aprantl, clayborg
      
      Subscribers: dblaikie, lldb-commits
      
      Tags: #lldb
      
      Differential Revision: https://reviews.llvm.org/D71750
      9bb01efa
    • Simon Pilgrim's avatar
      Fix "pointer is null" static analyzer warnings. NFCI. · e315ce2b
      Simon Pilgrim authored
      Use castAs<> instead of getAs<> since the pointer is dereferenced immediately below and castAs will perform the null assertion for us.
      e315ce2b
    • Simon Pilgrim's avatar
      Fix "pointer is null" static analyzer warnings. NFCI. · e3e72a26
      Simon Pilgrim authored
      Assert that the pointers are non-null before dereferencing them.
      e3e72a26
    • Sam Parker's avatar
      [ARM][MVE] Don't unroll intrinsic loops. · 15c7fa4d
      Sam Parker authored
      We don't unroll vector loops for MVE targets, but we miss the case
      when loops only contain intrinsic calls. So just move the logic a
      bit to catch this case.
      
      Differential Revision: https://reviews.llvm.org/D72440
      15c7fa4d
    • Andi-Bogdan Postelnicu's avatar
      [clang-tidy] For checker `readability-misleading-indentation` update tests. · 795c38eb
      Andi-Bogdan Postelnicu authored
      Summary: In D72333 we've introduced support for `if constexpr` but the test for uninstantiated template was not ready to land on windows platform since this target uses `-fdelayed-template-parsing` by default. This patch addresses this by passing `-fno-delayed-template-parsing` to the test.
      
      Reviewers: JonasToth
      
      Subscribers: xazax.hun, cfe-commits
      
      Tags: #clang
      
      Differential Revision: https://reviews.llvm.org/D72438
      795c38eb
    • Simon Pilgrim's avatar
      Fix MSVC unhandled enum warning. NFCI. · 0d540798
      Simon Pilgrim authored
      0d540798
    • Raphael Isemann's avatar
      [lldb] Fix that TestNoSuchArch.py was passing for the wrong reason · 782ad91c
      Raphael Isemann authored
      The command here failed due to the type in 'create' but the expect
      did not actually check for the error message. This fixes the typo
      and adds a check for the actuall error message we should see.
      782ad91c
    • Florian Hahn's avatar
      [Matrix] Update shape propagation to iterate until done. · ccf24225
      Florian Hahn authored
      This patch updates the shape propagation to iterate until no new shape
      information is discovered.
      
      As initial seed for the forward propagation, we use the matrix intrinsic
      instructions. Both propagateShapeForward and propagateShapeBackward
      return new work lists, with the instructions to be used for the next
      iteration. When propagating forward, we record all instructions we added
      new shape information for. When propagating backward, we record all
      users of instructions we added new shape information for.
      
      Reviewers: anemet, Gerolf, reames, hfinkel, andrew.w.kaylor
      
      Reviewed By: anemet
      
      Differential Revision: https://reviews.llvm.org/D70901
      ccf24225
    • Kadir Cetinkaya's avatar
      [clangd] Refurbish HoverInfo::present · 287a874d
      Kadir Cetinkaya authored
      Summary: Improves basic hover presentation logic to include more info.
      
      Reviewers: sammccall
      
      Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, usaxena95, cfe-commits
      
      Tags: #clang
      
      Differential Revision: https://reviews.llvm.org/D71555
      287a874d
    • Florian Hahn's avatar
      [Matrix] Propagate and use shape information for loads. · 7adf6644
      Florian Hahn authored
      This patch extends to shape propagation to also include load
      instructions and implements shape aware lowering for vector loads.
      
      Reviewers: anemet, Gerolf, reames, hfinkel, andrew.w.kaylor
      
      Reviewed By: anemet
      
      Differential Revision: https://reviews.llvm.org/D70900
      7adf6644
    • Kazushi (Jam) Marukawa's avatar
      [VE] Target stub for NEC SX-Aurora · 00c6e984
      Kazushi (Jam) Marukawa authored
      Summary:
      This patch registers the 've' target: the NEC SX-Aurora TSUBASA Vector Engine.
      
      Reviewed By: arsenm
      
      Differential Revision: https://reviews.llvm.org/D69103
      00c6e984
    • Evgeniy Brevnov's avatar
    • Florian Hahn's avatar
      [Matrix] Implement back-propagation of shape information. · 459ad8e9
      Florian Hahn authored
      This patch extends the shape propagation for matrix operations to also
      propagate the shape of instructions to their operands.
      
      Reviewers: anemet, Gerolf, reames, hfinkel, andrew.w.kaylor
      
      Reviewed By: anemet
      
      Differential Revision: https://reviews.llvm.org/D70899
      459ad8e9
    • Sam Parker's avatar
      Revert "[ARM][LowOverheadLoops] Update liveness info" · 1cba2612
      Sam Parker authored
      This reverts commit e93e0d41.
      
      There's some ordering problems on some on the buildbots which needs
      investigating.
      1cba2612
    • Pavel Labath's avatar
      [DWARFDebugLoc] Tweak error message when resolving offset pairs with no base address · 0541a9d4
      Pavel Labath authored
      The previous message mentioned DW_LLE_offset_pair, but this is
      incorrect/confusing because we can get this message even with DWARF4
      (which does not use DW_LLE encodings). This happens because DWARF<=4
      location entries are "upgraded" to DWARF v5 during parsing.
      
      The new error message refrains from referencing specific constants.
      Fixes pr44482.
      0541a9d4
    • Sjoerd Meijer's avatar
      [LV] Still vectorise when tail-folding can't find a primary inducation variable · 8f188745
      Sjoerd Meijer authored
      This addresses a vectorisation regression for tail-folded loops that are
      counting down, e.g. loops as simple as this:
      
        void foo(char *A, char *B, char *C, uint32_t N) {
          while (N > 0) {
            *C++ = *A++ + *B++;
             N--;
          }
        }
      
      These are loops that can be vectorised, but when tail-folding is requested, it
      can't find a primary induction variable which we do need for predicating the
      loop. As a result, the loop isn't vectorised at all, which it is able to do
      when tail-folding is not attempted. So, this adds a check for the primary
      induction variable where we decide how to lower the scalar epilogue. I.e., when
      there isn't a primary induction variable, a scalar epilogue loop is allowed
      (i.e. don't request tail-folding) so that vectorisation could still be
      triggered.
      
      Having this check for the primary induction variable make sense anyway, and in
      addition, in a follow-up of this I will look into discovering earlier the
      primary induction variable for counting down loops, so that this can also be
      tail-folded.
      
      Differential revision: https://reviews.llvm.org/D72324
      8f188745
    • Alex Zinenko's avatar
      [mlir][GPU] introduce utilities for promotion to workgroup memory · 08778d8c
      Alex Zinenko authored
      Introduce a set of function that promote a memref argument of a `gpu.func` to
      workgroup memory using memory attribution. The promotion boils down to
      additional loops performing the copy from the original argument to the
      attributed memory in the beginning of the function, and back at the end of the
      function using all available threads. The loop bounds are specified so as to
      adapt to any size of the workgroup. These utilities are intended to compose
      with other existing utilities (loop coalescing and tiling) in cases where the
      distribution of work across threads is uneven, e.g. copying a 2D memref with
      only the threads along the "x" dimension. Similarly, specialization of the
      kernel to specific launch sizes should be implemented as a separate pass
      combining constant propagation and canonicalization.
      
      Introduce a simple attribute-driven pass to test the promotion transformation
      since we don't have a heuristic at the moment.
      
      Differential revision: https://reviews.llvm.org/D71904
      08778d8c
    • Sam Parker's avatar
      [ARM][LowOverheadLoops] Update liveness info · e93e0d41
      Sam Parker authored
      After expanding the pseudo instructions, update the liveness info.
      We do this in a post-order traversal of the loop, including its
      exit blocks and preheader(s).
      
      Differential Revision: https://reviews.llvm.org/D72131
      e93e0d41
    • Nicolas Vasilache's avatar
      [mlir][VectorOps] Implement insert_strided_slice conversion · 2d515e49
      Nicolas Vasilache authored
      Summary:
      This diff implements the progressive lowering of insert_strided_slice.
      Two cases appear:
      1. when the source and dest vectors have different ranks, extract the dest
      subvector at the proper offset and reduce to case 2.
      2. when they have the same rank N:
        a. if the source and dest type are the same, the insertion is trivial:
           just forward the source
        b. otherwise, iterate over all N-1 D subvectors and create an
           extract/insert_strided_slice/insert replacement, reducing the problem
           to vecotrs of the same N-1 rank.
      
      This combines properly with the other conversion patterns to lower all the way to LLVM.
      
      Reviewers: ftynse, rriddle, AlexEichenberger, andydavis1, tetuante, nicolasvasilache
      
      Reviewed By: andydavis1
      
      Subscribers: merge_guards_bot, mehdi_amini, jpienaar, burmako, shauheen, antiagainst, arpith-jacob, mgester, lucyrfox, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D72317
      2d515e49
    • Nicolas Vasilache's avatar
      [mlir][VectorOps] Implement strided_slice conversion · 65678d93
      Nicolas Vasilache authored
      Summary:
      This diff implements the progressive lowering of strided_slice to either:
        1. extractelement + insertelement for the 1-D case
        2. extract + optional strided_slice + insert for the n-D case.
      
      This combines properly with the other conversion patterns to lower all the way to LLVM.
      
      Appropriate tests are added.
      
      Reviewers: ftynse, rriddle, AlexEichenberger, andydavis1, tetuante
      
      Reviewed By: andydavis1
      
      Subscribers: merge_guards_bot, mehdi_amini, jpienaar, burmako, shauheen, antiagainst, arpith-jacob, mgester, lucyrfox, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D72310
      65678d93
    • Ehud Katz's avatar
      [APFloat] Fix checked error assert failures · 24b326cc
      Ehud Katz authored
      `APFLoat::convertFromString` returns `Expected` result, which must be
      "checked" if the LLVM_ENABLE_ABI_BREAKING_CHECKS preprocessor flag is
      set.
      To mark an `Expected` result as "checked" we must consume the `Error`
      within.
      In many cases, we are only interested in knowing if an error occured,
      without the need to examine the error info. This is achieved, easily,
      with the `errorToBool()` API.
      24b326cc
    • Zheng Chen's avatar
    • Jonas Devlieghere's avatar
      [lldb/SWIG] Refactor extensions to be non Python-specific (3/3) · 51bdd98b
      Jonas Devlieghere authored
      The current SWIG extensions for the string conversion operator is Python
      specific because it uses the PythonObjects. This means that the code
      cannot be reused for other SWIG supported languages such as Lua.
      
      This reimplements the extensions in a more generic way that can be
      reused. It uses a SWIG macro to reduce code duplication.
      
      Differential revision: https://reviews.llvm.org/D72377
      51bdd98b
    • QingShan Zhang's avatar
      [DAGCombine] Fold the (fma -x, y, -z) to -(fma x, y, z) · d48ac7d5
      QingShan Zhang authored
      This is a positive combination as long as the NEG is NOT free,
      as we are reducing the number of NEG from two to one.
      
      Differential Revision: https://reviews.llvm.org/D72312
      d48ac7d5
    • Daniel Sanders's avatar
      Revert "Revert "[MIR] Target specific MIR formating and parsing"" · de3d0ee0
      Daniel Sanders authored
      There was an unguarded dereference of MF in a function that permitted
      nullptr. Fixed
      
      This reverts commit 71d64f72.
      de3d0ee0
    • Nico Weber's avatar
      Revert "[MIR] Target specific MIR formating and parsing" · 71d64f72
      Nico Weber authored
      This reverts commit 3ef05d85.
      It broke check-llvm on many bots, see comments on D69836.
      71d64f72
    • Peng Guo's avatar
      [MIR] Target specific MIR formating and parsing · 3ef05d85
      Peng Guo authored
      Summary:
      Added MIRFormatter for target specific MIR formating and parsing with
      immediate and custom pseudo source values. Target machine can subclass
      MIRFormatter and implement custom logic for printing and parsing
      immediate and custom pseudo source values for better readability.
      
      * Target specific immediate mnemonic need to start with "." follows by
        identifier string. When MIR parser sees immediate it will call target
        specific parsing function.
      
      * Custom pseudo source value need to start with custom follows by
        double-quoted string. MIR parser will pass the quoted string to target
        specific PSV parsing function.
      
      * MIRFormatter have 2 helper functions to facilitate LLVM value printing
        and parsing for custom PSV if they refers LLVM values.
      
      Patch by Peng Guo
      
      Reviewers: dsanders, arsenm
      
      Reviewed By: dsanders
      
      Subscribers: wdng, jvesely, nhaehnle, hiraditya, jfb, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D69836
      3ef05d85
    • Daniel Sanders's avatar
      Revert "[MIR] Target specific MIR formating and parsing" · 5ab6fa7b
      Daniel Sanders authored
      Forgot to credit Peng in the commit message.
      
      This reverts commit be841f89.
      5ab6fa7b
    • Jason Molenda's avatar
      Save more descriptive error msg from FBS/BKS, relay it up to lldb. · d44a0743
      Jason Molenda authored
      When lldb requests an app launch through FrontBoard/BackBoard,
      we get back an NSError object if there was a problem with an
      integer error code and a descriptive text string.  debugserver
      would log the descriptive text string to the console, but it
      would only save the error code value, ask for the
      much-less-specific name of that error code, and send that very
      generic error word back to lldb.
      
      This patch saves the longer description of the failure when
      available, and sends that to lldb.  If unavailable, it falls
      back to sending up the generic description of the error code
      as it was doing before.
      
      This only impacts the iOS on-device debugserver.
      
      <rdar://problem/49953304>
      d44a0743
    • Peng Guo's avatar
      [MIR] Target specific MIR formating and parsing · be841f89
      Peng Guo authored
      Summary:
      Added MIRFormatter for target specific MIR formating and parsing with
      immediate and custom pseudo source values. Target machine can subclass
      MIRFormatter and implement custom logic for printing and parsing
      immediate and custom pseudo source values for better readability.
      
      * Target specific immediate mnemonic need to start with "." follows by
        identifier string. When MIR parser sees immediate it will call target
        specific parsing function.
      
      * Custom pseudo source value need to start with custom follows by
        double-quoted string. MIR parser will pass the quoted string to target
        specific PSV parsing function.
      
      * MIRFormatter have 2 helper functions to facilitate LLVM value printing
        and parsing for custom PSV if they refers LLVM values.
      
      Reviewers: dsanders, arsenm
      
      Reviewed By: dsanders
      
      Subscribers: wdng, jvesely, nhaehnle, hiraditya, jfb, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D69836
      be841f89
    • Alex Langford's avatar
      a63af915
    • Zheng Chen's avatar
      [PowerPC] when folding rlwinm+rlwinm. to andi., we should use first rlwinm · 26ba160d
      Zheng Chen authored
      input reg.
      
      %2:gprc = RLWINM %1:gprc, 27, 5, 10
      %3:gprc = RLWINM_rec %2:gprc, 8, 5, 10, implicit-def $cr0
      
      ==>
      
      %3:gprc = ANDI_rec %1, 0, implicit-def $cr0
      
      we should use %1 instead of %2 as ANDI_rec input.
      
      Reviewed By: steven.zhang
      
      Differential Revision: https://reviews.llvm.org/D71885
      26ba160d
    • Mircea Trofin's avatar
    • Johannes Doerfert's avatar
      [Attributor][FIX] Carefully change invokes to calls (after manifest) · a4088c75
      Johannes Doerfert authored
      Before we manually inserted unreachable early but that could lead to
      broken PHI nodes. Now we use the existing late modification
      functionality.
      a4088c75
    • Johannes Doerfert's avatar
      [Attributor][FIX] Avoid dangling value pointers during code modification · 1e46eb74
      Johannes Doerfert authored
      When we replace instructions with unreachable we delete instructions. We
      now avoid dangling pointers to those deleted instructions in the
      `ToBeChangedToUnreachableInsts` set. Other modification collections
      might need to be updated in the future as well.
      1e46eb74
    • Mircea Trofin's avatar
      [NFC][InlineCost] Factor cost modeling out of CallAnalyzer traversal. · 76aab66d
      Mircea Trofin authored
      Summary:
      The goal is to simplify experimentation on the cost model. Today,
      CallAnalyzer decides 2 things: legality, and benefit. The refactoring
      keeps legality assessment in CallAnalyzer, and factors benefit
      evaluation out, as an extension.
      
      Reviewers: davidxl, eraman
      
      Subscribers: kamleshbhalui, fedor.sergeev, hiraditya, baloghadamsoftware, haicheng, a.sidorin, Szelethus, donat.nagy, dkrupp, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D71733
      76aab66d
    • Justin Hibbits's avatar
      [PowerPC]: Add powerpcspe target triple subarch component · ff0311c4
      Justin Hibbits authored
      Summary:
      This allows the use of '-target powerpcspe-unknown-linux-gnu' or
      'powerpcspe-unknown-freebsd' to be used, instead of
      '-target powerpc-unknown-linux-gnu -mspe'.
      
      Reviewed By: dim
      Differential Revision: https://reviews.llvm.org/D72014
      ff0311c4
    • Jonas Paulsson's avatar
      Recommit "[MachineVerifier] Improve verification of live-in lists." · 659efa21
      Jonas Paulsson authored
      MachineVerifier::visitMachineFunctionAfter() is extended to check the
      live-through case for live-in lists. This is only done for registers without
      aliases and that are neither allocatable or reserved, such as the SystemZ::CC
      register.
      
      The MachineVerifier earlier only catched the case of a live-in use without an
      entry in the live-in list (as "using an undefined physical register").
      
      A comment in LivePhysRegs.h has been added stating a guarantee that
      addLiveOuts() can be trusted for a full register both before and after
      register allocation.
      
      Review: Quentin Colombet
      
      Differential Revision: https://reviews.llvm.org/D68267
      659efa21
    • Billy Robert O'Neal III's avatar