Skip to content
  1. Mar 05, 2020
    • Florian Hahn's avatar
      [VPlan] Use consecutive numbers to print VPValues instead of addresses. · 40e7bfc4
      Florian Hahn authored
      Currently when printing VPValues we use the object address, which makes
      it hard to distinguish VPValues as they usually are large numbers with
      varying distance between them.
      
      This patch adds a simple slot tracker, similar to the ModuleSlotTracker
      used for IR values. In order to dump a VPValue or anything containing a
      VPValue, a slot tracker for the enclosing VPlan needs to be created. The
      existing VPlanPrinter can take care of that for the existing code. We
      assign consecutive numbers to each VPValue we encounter in a reverse
      post order traversal of the VPlan.
      
      Reviewers: rengolin, hsaito, fhahn, Ayal, dorit, gilr
      
      Reviewed By: gilr
      
      Differential Revision: https://reviews.llvm.org/D73078
      40e7bfc4
    • Daniel Kiss's avatar
      [AArch64] Harmonize print format of hint instructions. · 11ab687c
      Daniel Kiss authored
      Summary:
      Hint instructions printed as "hint\t#hintnum" except
      in case of ARM v8.3a instruction only "hint #hintnum" is printed.
      This patch changes all format to the fist one.
      
      Reviewers: pbarrio, LukeCheeseman, vsk
      
      Reviewed By: vsk
      
      Subscribers: kristof.beyls, hiraditya, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D75625
      11ab687c
    • Simon Pilgrim's avatar
      Fix use-after-move warning. NFCI. · 576f4864
      Simon Pilgrim authored
      576f4864
    • Simon Pilgrim's avatar
    • Simon Pilgrim's avatar
    • Krasimir Georgiev's avatar
      Revert "[BFI] Use CallbackVH to notify BFI about deletion of basic blocks" · 29693fc1
      Krasimir Georgiev authored
      This reverts commit 8975aa6e.
      
      Causes a compilation warning:
      llvm-project/llvm/include/llvm/Analysis/BlockFrequencyInfoImpl.h:1037:43: warning: 'llvm::BlockFrequencyInfoImpl<llvm::BasicBlock>::BFICallbackVH' has virtual functions but non-virtual destructor [-Wnon-virtual-dtor]
      class BlockFrequencyInfoImpl<BasicBlock>::BFICallbackVH : public CallbackVH {
                                                ^
      1 warning generated.
      29693fc1
    • Igor Kudrin's avatar
      Fix typos in comment marks. · 6e9c10f6
      Igor Kudrin authored
      6e9c10f6
    • Sanjay Patel's avatar
    • Daniil Suchkov's avatar
      [BFI] Use CallbackVH to notify BFI about deletion of basic blocks · 8975aa6e
      Daniil Suchkov authored
      With AssertingVHs instead of bare pointers in
      BlockFrequencyInfoImpl::Nodes (but without CallbackVHs) ~1/36 of all
      tests ran by make check fail. It means that there are users of BFI that
      delete basic blocks while keeping BFI. Some of those transformations add
      new basic blocks, so if a new basic block happens to be allocated at
      address where an already deleted block was and we don't explicitly set
      block frequency for that new block, BFI will report some non-default
      frequency for the block even though frequency for the block was never
      set. Inliner is an example of a transformation that adds and removes BBs
      while querying and updating BFI.
      With this patch, thanks to updates via CallbackVH, BFI won't keep stale
      pointers in its Nodes map.
      
      This is a resubmission of 408349a2 with
      fixed MSVC compilation errors.
      
      Reviewers: davidxl, yamauchi, asbirlea, fhahn, fedor.sergeev
      
      Reviewed-By: asbirlea, davidxl
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D75341
      8975aa6e
    • Daniil Suchkov's avatar
      Revert "[BFI] Use CallbackVH to notify BFI about deletion of basic blocks" · 53dceb50
      Daniil Suchkov authored
      Reverting the patch because it causes compilation failure on MSVC.
      This reverts commit 408349a2.
      53dceb50
    • Daniil Suchkov's avatar
      [BFI] Use CallbackVH to notify BFI about deletion of basic blocks · 408349a2
      Daniil Suchkov authored
      With AssertingVHs instead of bare pointers in
      BlockFrequencyInfoImpl::Nodes (but without CallbackVHs) ~1/36 of all
      tests ran by make check fail. It means that there are users of BFI that
      delete basic blocks while keeping BFI. Some of those transformations add
      new basic blocks, so if a new basic block happens to be allocated at
      address where an already deleted block was and we don't explicitly set
      block frequency for that new block, BFI will report some non-default
      frequency for the block even though frequency for the block was never
      set. Inliner is an example of a transformation that adds and removes BBs
      while querying and updating BFI.
      With this patch, thanks to updates via CallbackVH, BFI won't keep stale
      pointers in its Nodes map.
      
      Reviewers: davidxl, yamauchi, asbirlea, fhahn, fedor.sergeev
      
      Reviewed-By: asbirlea, davidxl
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D75341
      408349a2
    • Sam Parker's avatar
      [ARM][MVE] Enable *SHRN* for tail predication · 77e30758
      Sam Parker authored
      These instructions don't swap lanes so make them valid.
      
      Differential Revision: https://reviews.llvm.org/D75667
      77e30758
    • LLVM GN Syncbot's avatar
      [gn build] Port cada5b88 · 6f122256
      LLVM GN Syncbot authored
      6f122256
    • Igor Kudrin's avatar
      [DebugInfo] Do not truncate 64-bit values when dumping CIEs and FDEs. · cada5b88
      Igor Kudrin authored
      This fixes printing long values that might reside in CIE and FDE,
      including offsets, lengths, and addresses.
      
      Differential Revision: https://reviews.llvm.org/D73887
      cada5b88
    • Igor Kudrin's avatar
      [DebugInfo] Refine the condition to detect CIEs. · 1a837569
      Igor Kudrin authored
      The condition was not accurate enough and could interpret some FDEs in
      .eh_frame or 64-bit DWARF .debug_frame sections as CIEs. Even though
      such FDEs are unlikely in a normal situation, the wrong interpretation
      could hide an issue in a buggy generator.
      
      Differential Revision: https://reviews.llvm.org/D73886
      1a837569
    • Georgii Rymar's avatar
      [Object/ELF] - Fix a position calculation expression in ELFFile<ELFT>::getEntry(). · e258ad51
      Georgii Rymar authored
      It fixes now what 1c991f90 tried to fix.
      (A test case failture on 32-bit Arch Linux)
      
      On 32-bit hosts it still fails (because it truncates the `Pos` value to 32 bits).
      It seems happens because of `sizeof` that returns `size_t`, which has a
      different size on 32/64 bits hosts.
      
      I've tested on a 32-bit host and verified that relocation-errors.test test and
      other LLVM tools tests pass now.
      e258ad51
    • Daniil Suchkov's avatar
    • Daniil Suchkov's avatar
      Revert "[ValueTracking] Let isGuaranteedNotToBeUndefOrPoison look into branch... · 3db48f93
      Daniil Suchkov authored
      Revert "[ValueTracking] Let isGuaranteedNotToBeUndefOrPoison look into branch conditions of dominating blocks' terminators"
      
      That commit causes SIGSEGV on some simple tests.
      This reverts commit 952ad470.
      3db48f93
    • serge-sans-paille's avatar
      Avoid dangling reference on SectionList · cb06571a
      serge-sans-paille authored
      Bug spotted by https://cookieplmonster.github.io/2020/02/01/emulator-bug-llvm-bug/
      
      Basically, holding references to object inside a resized vector is a bad idea.
      
      Differential Revision: https://reviews.llvm.org/D75110
      cb06571a
    • Jun Ma's avatar
      b10deb94
    • David Blaikie's avatar
      X86AsmBackend.cpp: #ifndef NDEBUG some only-used-in-asserts variables to fix... · 7a6878a7
      David Blaikie authored
      X86AsmBackend.cpp: #ifndef NDEBUG some only-used-in-asserts variables to fix the -Werror non-asserts build
      7a6878a7
    • Lang Hames's avatar
      [ORC] Remove hard dependency on libobjc when using MachOPlatform with LLJIT. · 4b15decb
      Lang Hames authored
      The LLJIT::MachOPlatformSupport class used to unconditionally attempt to
      register __objc_selrefs and __objc_classlist sections. If libobjc had not
      been loaded this resulted in an assertion, even if no objc sections were
      actually present. This patch replaces this unconditional registration with
      a check that no objce sections are present if libobjc has not been loaded.
      This will allow clients to use MachOPlatform with LLJIT without requiring
      libobjc for non-objc code.
      4b15decb
    • Sameer Sahasrabuddhe's avatar
      StructurizeCFG: simplify phi nodes when possible · 42febbab
      Sameer Sahasrabuddhe authored
      After structurization, some phi nodes can have a single incoming edge
      and can be simplified away. This change runs a simplify query on all
      phis that are either modified or added by the structurizer. This also
      moves some phis closer to their use as a side benefit.
      
      Reviewed By: arsenm
      
      Differential Revision: https://reviews.llvm.org/D75500
      42febbab
    • Craig Topper's avatar
      [X86] Simplify the code at the end of lowerShuffleAsBroadcast. · 4c7c87f2
      Craig Topper authored
      The original code could create a bitcast from f64 to i64 and back
      on 32-bit targets. This was only working because getBitcast was
      able to fold the casts away to avoid leaving the illegal i64 type.
      
      Now we handle the scalar case directly by broadcasting using the
      scalar type as the element type. Then bitcasting to the final VT.
      This works since we ensure the scalar type is the same size as
      the final VT element type. No more casts to i64.
      
      For the vector case, we cast to VT or subvector of VT. And then
      do the broadcast.
      
      I think this all matches what we generated before, just in a more
      readable way.
      4c7c87f2
    • Philip Reames's avatar
      Consistently capitalize a variable [NFC] · c94a4133
      Philip Reames authored
      One instance in a copy paste was pointed out in a review, fix all instances at once.
      c94a4133
    • Michael Trent's avatar
      Fix dyld opcode *_ADD_ADDR_IMM_SCALED error detection. · df058699
      Michael Trent authored
      Summary:
      Move the check for malformed REBASE_OPCODE_ADD_ADDR_IMM_SCALED and
      BIND_OPCODE_DO_BIND_ADD_ADDR_IMM_SCALED opcodes after the immediate
      has been applied to the SegmentOffset. This fixes specious errors
      where SegmentOffset is pointing between two sections when trying to
      correct the SegmentOffset value.
      
      Update the regression tests to verify the proper error message.
      
      Reviewers: pete, ab, lhames, steven_wu, jhenderson
      
      Reviewed By: pete
      
      Subscribers: hiraditya, dexonsmith, rupprecht, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D75629
      df058699
    • Igor Kudrin's avatar
      [DebugInfo] Avoid crashing on an invalid section identifier. · cc61283b
      Igor Kudrin authored
      A DWARFSectionKind is read from input. It is not validated on parsing,
      so an unexpected value may result in reaching llvm_unreachable() in
      DWARFUnitIndex::getColumnHeader() when dumping the index section.
      
      Differential Revision: https://reviews.llvm.org/D75609
      cc61283b
    • QingShan Zhang's avatar
      [DAGCombine] Check the uses of negated floating constant and remove the hack · 3906ae38
      QingShan Zhang authored
      PowerPC hits an assertion due to somewhat the same reason as https://reviews.llvm.org/D70975.
      Though there are already some hack, it still failed with some case, when the operand 0 is NOT
      a const fp, it is another fma that with const fp. And that const fp is negated which result in multi-uses.
      
      A better fix is to check the uses of the negated const fp. If there are already use of its negated
      value, we will have benefit as no extra Node is added.
      
      Differential revision: https://reviews.llvm.org/D75501
      3906ae38
    • Jim Lin's avatar
      [AVR][NFC] Use Register instead of unsigned · ea6eb813
      Jim Lin authored
      Summary: Use Register type for variables instead of unsigned type.
      
      Reviewers: dylanmckay
      
      Reviewed By: dylanmckay
      
      Subscribers: hiraditya, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D75595
      ea6eb813
    • Greg Clayton's avatar
    • Greg Clayton's avatar
      Fix GSYM tests to run the yaml files and fix test failures on some machines. · 4050b01b
      Greg Clayton authored
      YAML files were not being run during lit testing as there was no lit.local.cfg file. Once this was fixed, some buildbots would fail due to a StringRef that pointed to a std::string inside of a temporary llvm::Triple object. These issues are fixed here by making a local triple object that stays around long enough so the StringRef points to valid data. Fixed memory sanitizer bot bugs as well.
      
      Differential Revision: https://reviews.llvm.org/D75390
      4050b01b
    • hsmahesha's avatar
      AMDGPU/GlobalISel: Support llvm.trap and llvm.debugtrap intrinsics · 3fda1fde
      hsmahesha authored
      Summary: Lower trap and debugtrap intrinsics to AMDGPU machine instruction(s).
      
      Reviewers: arsenm, nhaehnle, kerbowa, cdevadas, t-tye, kzhuravl
      
      Reviewed By: arsenm
      
      Subscribers: kzhuravl, jvesely, wdng, yaxunl, rovka, dstuttard, tpr, hiraditya, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D74688
      3fda1fde
    • Shengchen Kan's avatar
      [X86] Add a private member function determinePaddingPrefix for X86AsmBackend · b3722dea
      Shengchen Kan authored
      Summary: X86 can reduce the bytes of NOP by padding instructions with prefixes to get a better peformance in some cases. So a private member function `determinePaddingPrefix` is added to determine which prefix is the most suitable.
      
      Reviewers: annita.zhang, reames, MaskRay, craig.topper, LuoYuanke, jyknight
      
      Reviewed By: reames
      
      Subscribers: llvm-commits, dexonsmith, hiraditya
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D75357
      b3722dea
    • Philip Reames's avatar
      [X86] Relax existing instructions to reduce the number of nops needed for alignment purposes · f708c823
      Philip Reames authored
      If we have an explicit align directive, we currently default to emitting nops to fill the space. As discussed in the context of the prefix padding work for branch alignment (D72225), we're allowed to play other tricks such as extending the size of previous instructions instead.
      
      This patch will convert near jumps to far jumps if doing so decreases the number of bytes of nops needed for a following align. It does so as a post-pass after relaxation is complete. It intentionally works without moving any labels or doing anything which might require another round of relaxation.
      
      The point of this patch is mainly to mock out the approach. The optimization implemented is real, and possibly useful, but the main point is to demonstrate an approach for implementing such "pad previous instruction" approaches. The key notion in this patch is to treat padding previous instructions as an optional optimization, not as a core part of relaxation. The benefit to this is that we avoid the potential concern about increasing the distance between two labels and thus causing further potentially non-local code grown due to relaxation. The downside is that we may miss some opportunities to avoid nops.
      
      For the moment, this patch only implements a small set of existing relaxations.. Assuming the approach is satisfactory, I plan to extend this to a broader set of instructions where there are obvious "relaxations" which are roughly performance equivalent.
      
      Note that this patch *doesn't* change which instructions are relaxable. We may wish to explore that separately to increase optimization opportunity, but I figured that deserved it's own separate discussion.
      
      There are possible downsides to this optimization (and all "pad previous instruction" variants). The major two are potentially increasing instruction fetch and perturbing uop caching. (i.e. the usual alignment risks) Specifically:
       * If we pad an instruction such that it crosses a fetch window (16 bytes on modern X86-64), we may cause the decoder to have to trigger a fetch it wouldn't have otherwise. This can effect both decode speed, and icache pressure.
       * Intel's uop caching have particular restrictions on instruction combinations which can fit in a particular way. By moving around instructions, we can both cause misses an change misses into hits. Many of the most painful cases are around branch density, so I don't expect this to be too bad on the whole.
      
      On the whole, I expect to see small swings (i.e. the typical alignment change problem), but nothing major or systematic in either direction.
      
      Differential Revision: https://reviews.llvm.org/D75203
      f708c823
    • Matt Arsenault's avatar
      Add constexpr to DenormalMode constructors · b2dcde08
      Matt Arsenault authored
      This will allow their use in member initializers in a future commit.
      b2dcde08
    • Matt Arsenault's avatar
      X86: Generate mir checks in sqrt test · 7459781b
      Matt Arsenault authored
      7459781b
    • Stefan Gränitz's avatar
      [ORC] Decompose LazyCallThroughManager::callThroughToSymbol() · 76c59a63
      Stefan Gränitz authored
      Summary: Decompose callThroughToSymbol() into findReexport(), resolveSymbol(), notifyResolved() and reportCallThroughError(). This allows derived classes to reuse the functionality while adding their own code in between.
      
      Reviewers: lhames
      
      Reviewed By: lhames
      
      Subscribers: hiraditya, steven_wu, dexonsmith, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D75084
      76c59a63
    • Craig Topper's avatar
      [X86] Convert vXi1 vectors to xmm/ymm/zmm types via... · eadea786
      Craig Topper authored
      [X86] Convert vXi1 vectors to xmm/ymm/zmm types via getRegisterTypeForCallingConv rather than using CCPromoteToType in the td file
      
      Previously we tried to promote these to xmm/ymm/zmm by promoting
      in the X86CallingConv.td file. But this breaks when we run out
      of xmm/ymm/zmm registers and need to fall back to memory. We end
      up trying to create a non-sensical scalar to vector. This lead
      to an assertion. The new tests in avx512-calling-conv.ll all
      trigger this assertion.
      
      Since we really want to treat these types like we do on avx2,
      it seems better to promote them before the calling convention
      code gets involved. Except when the calling convention is one
      that passes the vXi1 type in a k register.
      
      The changes in avx512-regcall-Mask.ll are because we indicated
      that xmm/ymm/zmm types should be passed indirectly for the
      Win64 ABI before we go to the common lines that promoted the
      vXi1 types. This caused the promoted types to be picked up by
      the default calling convention code. Now we promote them earlier
      so they get passed indirectly as though they were xmm/ymm/zmm.
      
      Differential Revision: https://reviews.llvm.org/D75154
      eadea786
  2. Mar 04, 2020
Loading