Skip to content
  1. Sep 10, 2019
  2. Sep 09, 2019
    • Philip Reames's avatar
      [Tests] Fix a typo in a test · b8cddb76
      Philip Reames authored
      llvm-svn: 371456
      b8cddb76
    • Philip Reames's avatar
      [Tests] Precommit test case for D67372 · 847fbf70
      Philip Reames authored
      llvm-svn: 371455
      847fbf70
    • Philip Reames's avatar
      [LoopVectorize] Leverage speculation safety to avoid masked.loads · 7403569b
      Philip Reames authored
      If we're vectorizing a load in a predicated block, check to see if the load can be speculated rather than predicated.  This allows us to generate a normal vector load instead of a masked.load.
      
      To do so, we must prove that all bytes accessed on any iteration of the original loop are dereferenceable, and that all loads (across all iterations) are properly aligned.  This is equivelent to proving that hoisting the load into the loop header in the original scalar loop is safe.
      
      Note: There are a couple of code motion todos in the code.  My intention is to wait about a day - to be sure this sticks - and then perform the NFC motion without furthe review.
      
      Differential Revision: https://reviews.llvm.org/D66688
      
      llvm-svn: 371452
      7403569b
    • Philip Reames's avatar
      [Tests] Add anyextend tests for unordered atomics · 48453bb8
      Philip Reames authored
      Motivated by work on changing our representation of unordered atomics in SelectionDAG, but as an aside, all our lowerings for O3 are terrible.  Even the ones which ignore the atomicity.  
      
      llvm-svn: 371449
      48453bb8
    • Douglas Yung's avatar
    • Philip Reames's avatar
      Introduce infrastructure for an incremental port of SelectionDAG atomic load/store handling · 20aafa31
      Philip Reames authored
      This is the first patch in a large sequence. The eventual goal is to have unordered atomic loads and stores - and possibly ordered atomics as well - handled through the normal ISEL codepaths for loads and stores. Today, there handled w/instances of AtomicSDNodes. The result of which is that all transforms need to be duplicated to work for unordered atomics. The benefit of the current design is that it's harder to introduce a silent miscompile by adding an transform which forgets about atomicity.  See the thread on llvm-dev titled "FYI: proposed changes to atomic load/store in SelectionDAG" for further context.
      
      Note that this patch is NFC unless the experimental flag is set.
      
      The basic strategy I plan on taking is:
      
          introduce infrastructure and a flag for testing (this patch)
          Audit uses of isVolatile, and apply isAtomic conservatively*
          piecemeal conservative* update generic code and x86 backedge code in individual reviews w/tests for cases which didn't check volatile, but can be found with inspection
          flip the flag at the end (with minimal diffs)
          Work through todo list identified in (2) and (3) exposing performance ops
      
      (*) The "conservative" bit here is aimed at minimizing the number of diffs involved in (4). Ideally, there'd be none. In practice, getting it down to something reviewable by a human is the actual goal. Note that there are (currently) no paths which produce LoadSDNode or StoreSDNode with atomic MMOs, so we don't need to worry about preserving any behaviour there.
      
      We've taken a very similar strategy twice before with success - once at IR level, and once at the MI level (post ISEL). 
      
      Differential Revision: https://reviews.llvm.org/D66309
      
      llvm-svn: 371441
      20aafa31
    • Matt Arsenault's avatar
      AMDGPU/GlobalISel: Legalize G_BUILD_VECTOR v2s16 · a0933e6d
      Matt Arsenault authored
      Handle it the same way as G_BUILD_VECTOR_TRUNC. Arguably only
      G_BUILD_VECTOR_TRUNC should be legal for this, but G_BUILD_VECTOR will
      probably be more convenient in most cases.
      
      llvm-svn: 371440
      a0933e6d
    • Matt Arsenault's avatar
      AMDGPU: Make VReg_1 size be 1 · 8bc05d7d
      Matt Arsenault authored
      This was getting chosen as the preferred 32-bit register class based
      on how TableGen selects subregister classes.
      
      llvm-svn: 371438
      8bc05d7d
    • Matt Arsenault's avatar
      AMDGPU/GlobalISel: Select llvm.amdgcn.class · 77e3e9ca
      Matt Arsenault authored
      Also fixes missing SubtargetPredicate on f16 class instructions.
      
      llvm-svn: 371436
      77e3e9ca
    • Matt Arsenault's avatar
      AMDGPU/GlobalISel: Select fmed3 · d6c1f5bb
      Matt Arsenault authored
      llvm-svn: 371435
      d6c1f5bb
    • Eli Friedman's avatar
      [IfConversion] Correctly handle cases where analyzeBranch fails. · 79f0d3a6
      Eli Friedman authored
      If analyzeBranch fails, on some targets, the out parameters point to
      some blocks in the function. But we can't use that information, so make
      sure to clear it out.  (In some places in IfConversion, we assume that
      any block with a TrueBB is analyzable.)
      
      The change to the testcase makes it trigger a bug on builds without this
      fix: IfConvertDiamond tries to perform a followup "merge" operation,
      which isn't legal, and we somehow end up with a branch to a deleted MBB.
      I'm not sure how this doesn't crash the compiler.
      
      Differential Revision: https://reviews.llvm.org/D67306
      
      llvm-svn: 371434
      79f0d3a6
    • Sanjay Patel's avatar
      [x86] add test for false dependency with minsize (PR43239); NFC · c195bde3
      Sanjay Patel authored
      llvm-svn: 371433
      c195bde3
    • Matt Arsenault's avatar
      AMDGPU: Use PatFrags to allow selecting custom nodes or intrinsics · 6ebf6058
      Matt Arsenault authored
      This enables GlobalISel to handle various intrinsics. The custom node
      pattern will be ignored, and the intrinsic will work. This will also
      allow SelectionDAG to directly select the intrinsics, but as they are
      all custom lowered to the nodes, this ends up leaving dead code in the
      table.
      
      Eventually either GlobalISel should add the equivalent of custom nodes
      equivalent, or intrinsics should be directly used. These each have
      different tradeoffs.
      
      There are a few more to handle, but these are easy to handle
      ones. Some others fail for other reasons.
      
      llvm-svn: 371432
      6ebf6058
    • Craig Topper's avatar
      [X86] Allow _MM_FROUND_CUR_DIRECTION and _MM_FROUND_NO_EXC to be used together... · ce2cb0f0
      Craig Topper authored
      [X86] Allow _MM_FROUND_CUR_DIRECTION and _MM_FROUND_NO_EXC to be used together on instructions that only support SAE and not embedded rounding.
      
      Current for SAE instructions we only allow _MM_FROUND_CUR_DIRECTION(bit 2) or _MM_FROUND_NO_EXC(bit 3) to be used as the immediate passed to the inrinsics. But these instructions don't perform rounding so _MM_FROUND_CUR_DIRECTION is just sort of a default placeholder when you don't want to suppress exceptions. Using _MM_FROUND_NO_EXC by itself is really bit equivalent to (_MM_FROUND_NO_EXC | _MM_FROUND_TO_NEAREST_INT) since _MM_FROUND_TO_NEAREST_INT is 0. Since we aren't rounding on these instructions we should also accept (_MM_FROUND_CUR_DIRECTION | _MM_FROUND_NO_EXC) as equivalent to (_MM_FROUND_NO_EXC). icc allows this, but gcc does not.
      
      Differential Revision: https://reviews.llvm.org/D67289
      
      llvm-svn: 371430
      ce2cb0f0
    • Simon Atanasyan's avatar
      [mips] Fix decoding of microMIPS JALX instruction · 56e4ea2b
      Simon Atanasyan authored
      microMIPS jump and link exchange instruction stores a target in a
      26-bits field. Despite other microMIPS JAL instructions these bits
      are target address shifted right 2 bits [1]. The patch fixes the
      JALX instruction decoding and uses 2-bit shift.
      
      [1] MIPS Architecture for Programmers Volume II-B: The microMIPS32 Instruction Set
      
      Differential Revision: https://reviews.llvm.org/D67320
      
      llvm-svn: 371428
      56e4ea2b
    • Matt Arsenault's avatar
      AMDGPU: Move MnemonicAlias out of instruction def hierarchy · d2a9516a
      Matt Arsenault authored
      Unfortunately MnemonicAlias defines a "Predicates" field just like an
      instruction or pattern, with a somewhat different interpretation.
      
      This ends up overriding the intended Predicates set by
      PredicateControl on the pseudoinstruction defintions with an empty
      list. This allowed incorrectly selecting instructions that should have
      been rejected due to the SubtargetPredicate from patterns on the
      instruction definition.
      
      This does remove the divergent predicate from the 64-bit shift
      patterns, which were already not used for the 32-bit shift, so I'm not
      sure what the point was. This also removes a second, redundant copy of
      the 64-bit divergent patterns.
      
      llvm-svn: 371427
      d2a9516a
    • Sanjay Patel's avatar
      [SLP] add test for over-vectorization (PR33958); NFC · c0728eac
      Sanjay Patel authored
      llvm-svn: 371426
      c0728eac
    • Jessica Paquette's avatar
      [GlobalISel][AArch64] Handle tail calls with non-void return types · bfb00e3d
      Jessica Paquette authored
      Just return once you emit the call, which is exactly what SelectionDAG does in
      this situation.
      
      Update call-translator-tail-call.ll.
      
      Also update dllimport.ll to show that we tail call here in GISel again. Add
      -verify-machineinstrs to the GISel line too, to defend against verifier
      failures.
      
      Differential revision: https://reviews.llvm.org/D67282
      
      llvm-svn: 371425
      bfb00e3d
    • Matt Arsenault's avatar
      AMDGPU/GlobalISel: Implement LDS G_GLOBAL_VALUE · 64ecca90
      Matt Arsenault authored
      Handle the simple case that lowers to a constant.
      
      llvm-svn: 371424
      64ecca90
Loading