Skip to content
  1. Feb 22, 2019
    • Matt Arsenault's avatar
      BreakCriticalEdges: Update PostDominatorTree · 65b4ab99
      Matt Arsenault authored
      llvm-svn: 354673
      65b4ab99
    • Roman Tereshin's avatar
      [LowerSwitch][AMDGPU] Do not handle impossible values · 99a6672b
      Roman Tereshin authored
      This patch adds LazyValueInfo to LowerSwitch to compute the range of the
      value being switched over and reduce the size of the tree LowerSwitch
      builds to lower a switch.
      
      Reviewed By: arsenm
      
      Differential Revision: https://reviews.llvm.org/D58096
      
      llvm-svn: 354670
      99a6672b
    • Chijun Sima's avatar
      [DTU] Refine the interface and logic of applyUpdates · 70e97163
      Chijun Sima authored
      Summary:
      This patch separates two semantics of `applyUpdates`:
      1. User provides an accurate CFG diff and the dominator tree is updated according to the difference of `the number of edge insertions` and `the number of edge deletions` to infer the status of an edge before and after the update.
      2. User provides a sequence of hints. Updates mentioned in this sequence might never happened and even duplicated.
      
      Logic changes:
      
      Previously, removing invalid updates is considered a side-effect of deduplication and is not guaranteed to be reliable. To handle the second semantic, `applyUpdates` does validity checking before deduplication, which can cause updates that have already been applied to be submitted again. Then, different calls to `applyUpdates` might cause unintended consequences, for example,
      ```
      DTU(Lazy) and Edge A->B exists.
      1. DTU.applyUpdates({{Delete, A, B}, {Insert, A, B}}) // User expects these 2 updates result in a no-op, but {Insert, A, B} is queued
      2. Remove A->B
      3. DTU.applyUpdates({{Delete, A, B}}) // DTU cancels this update with {Insert, A, B} mentioned above together (Unintended)
      ```
      But by restricting the precondition that updates of an edge need to be strictly ordered as how CFG changes were made, we can infer the initial status of this edge to resolve this issue.
      
      Interface changes:
      The second semantic of `applyUpdates`  is separated to `applyUpdatesPermissive`.
      These changes enable DTU(Lazy) to use the first semantic if needed, which is quite useful in `transforms/utils`.
      
      Reviewers: kuhar, brzycki, dmgreen, grosser
      
      Reviewed By: brzycki
      
      Subscribers: hiraditya, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D58170
      
      llvm-svn: 354669
      70e97163
    • Chijun Sima's avatar
      [DTU] Deprecate insertEdge*/deleteEdge* · f131d611
      Chijun Sima authored
      Summary: This patch converts all existing `insertEdge*/deleteEdge*` to `applyUpdates` and marks `insertEdge*/deleteEdge*` as deprecated.
      
      Reviewers: kuhar, brzycki
      
      Reviewed By: kuhar, brzycki
      
      Subscribers: hiraditya, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D58443
      
      llvm-svn: 354652
      f131d611
  2. Feb 21, 2019
  3. Feb 20, 2019
    • Philip Reames's avatar
      [GVN] Small tweaks to comments, style, and missed vector handling · 79d5e16f
      Philip Reames authored
      Noticed these while doing a final sweep of the code to make sure I hadn't missed anything in my last couple of patches.  The (minor) missed optimization was noticed because of the stylistic fix to avoid an overly specific cast.
      
      llvm-svn: 354412
      79d5e16f
    • Philip Reames's avatar
      [GVN] Fix last crasher w/non-integral pointers · a259dc32
      Philip Reames authored
      Same case as for memset and memcpy, but this time for clobbering stores and loads.  We still can't allow coercion to or from non-integrals, regardless of the transform.
      
      Now that I'm done the whole little sequence, it seems apparent that we'd entirely missed reasoning about clobbers in the original GVN support for non-integral pointers.
      
      My appologies, I thought we'd upstreamed all of this, but it turns out we were still carrying a downstream hack which hid all of these issues.  My chanks to Cherry Zhang for helping debug.
      
      llvm-svn: 354407
      a259dc32
    • Philip Reames's avatar
      [GVN] Fix a crash bug w/non-integral pointers and memtransfers · 952d234d
      Philip Reames authored
      Problem is very similiar to the one fixed for memsets in r354399, we try to coerce a value to non-integral type, and then crash while try to do so.  Since we shouldn't be doing such coercions to start with, easy fix.  From inspection, I see two other cases which look to be similiar and will follow up with most test cases and fixes if confirmed.
      
      llvm-svn: 354403
      952d234d
    • Philip Reames's avatar
      [GVN] Fix a non-integral pointer bug w/vector types · 322eb766
      Philip Reames authored
      GVN generally doesn't forward structs or array types, but it *will* forward vector types to non-vectors and vice versa.  As demonstrated in tests, we need to inhibit the same set of transforms for vector of non-integral pointers as for non-integral pointers themselves.
      
      llvm-svn: 354401
      322eb766
    • Philip Reames's avatar
      [GVN] Fix a crash bug around non-integral pointers · 92756a80
      Philip Reames authored
      If we encountered a location where we tried to forward the value of a memset to a load of a non-integral pointer, we crashed.  Such a forward is not legal in general, but we can forward null pointers.  Test for both cases are included.
      
      llvm-svn: 354399
      92756a80
  4. Feb 15, 2019
  5. Feb 14, 2019
    • Florian Hahn's avatar
      [LoopUnrollPeel] Add case where we should forget the peeled loop from SCEV. · 6ab83b7d
      Florian Hahn authored
      The test case requires the peeled loop to be forgotten after peeling,
      even though it does not have a parent. When called via the unroller,
      SE->forgetTopmostLoop is also called, so the test case would also pass
      without any SCEV invalidation, but peelLoop is exposed as utility
      function. Also, in the test case, simplifyLoop will make changes,
      removing the loop from SCEV, but it is better to not rely on this
      behavior.
      
      Reviewers: sanjoy, mkazantsev
      
      Reviewed By: mkazantsev
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D58192
      
      llvm-svn: 354031
      6ab83b7d
  6. Feb 13, 2019
    • Vedant Kumar's avatar
      [CodeExtractor] Only lift lifetime markers present in the extraction region · 4b0cc9a7
      Vedant Kumar authored
      When CodeExtractor finds liftime markers referencing inputs to the
      extraction region, it lifts these markers out of the region and inserts
      them around the call to the extracted function (see r350420, PR39671).
      
      However, it should *only* lift lifetime markers that are actually
      present in the extraction region. I.e., if a start marker is present in
      the extraction region but a corresponding end marker isn't (or vice
      versa), only the start marker (or end marker, resp.) should be lifted.
      
      Differential Revision: https://reviews.llvm.org/D57834
      
      llvm-svn: 353973
      4b0cc9a7
  7. Feb 12, 2019
    • Jeremy Morse's avatar
      [DebugInfo] Don't salvage load operations (PR40628). · b33a5c73
      Jeremy Morse authored
      Salvaging a redundant load instruction into a debug expression hides a
      memory read from optimisation passes. Passes that alter memory behaviour
      (such as LICM promoting memory to a register) aren't aware of these debug
      memory reads and leave them unaltered, making the debug variable location
      point somewhere unsafe.
      
      Teaching passes to know about these debug memory reads would be challenging
      and probably incomplete. Finding dbg.value instructions that need to be fixed
      would likely be computationally expensive too, as more analysis would be
      required. It's better to not generate debug-memory-reads instead, alas.
      
      Changed tests:
       * DeadStoreElim: test for salvaging of intermediate operations contributing
         to the dead store, instead of salvaging of the redundant load,
       * GVN: remove debuginfo behaviour checks completely, this behaviour is still
         covered by other tests,
       * InstCombine: don't test for salvaged loads, we're removing that behaviour.
      
      Differential Revision: https://reviews.llvm.org/D57962
      
      llvm-svn: 353824
      b33a5c73
    • Max Kazantsev's avatar
      [NFC] Rename DontDeleteUselessPHIs --> KeepOneInputPHIs · 20b91899
      Max Kazantsev authored
      llvm-svn: 353801
      20b91899
    • Max Kazantsev's avatar
      [NFC] Add parameter for keeping one-input Phis in DeleteDeadBlock(s) · 0686d1ae
      Max Kazantsev authored
      llvm-svn: 353799
      0686d1ae
  8. Feb 11, 2019
  9. Feb 10, 2019
  10. Feb 08, 2019
    • Craig Topper's avatar
      Implementation of asm-goto support in LLVM · 784929d0
      Craig Topper authored
      This patch accompanies the RFC posted here:
      http://lists.llvm.org/pipermail/llvm-dev/2018-October/127239.html
      
      This patch adds a new CallBr IR instruction to support asm-goto
      inline assembly like gcc as used by the linux kernel. This
      instruction is both a call instruction and a terminator
      instruction with multiple successors. Only inline assembly
      usage is supported today.
      
      This also adds a new INLINEASM_BR opcode to SelectionDAG and
      MachineIR to represent an INLINEASM block that is also
      considered a terminator instruction.
      
      There will likely be more bug fixes and optimizations to follow
      this, but we felt it had reached a point where we would like to
      switch to an incremental development model.
      
      Patch by Craig Topper, Alexander Ivchenko, Mikhail Dvoretckii
      
      Differential Revision: https://reviews.llvm.org/D53765
      
      llvm-svn: 353563
      784929d0
    • Vedant Kumar's avatar
      [CodeExtractor] Restore outputs after creating exit stubs · 0e5dd512
      Vedant Kumar authored
      When CodeExtractor saves the result of InvokeInst at the first insertion
      point of the 'normal destination' basic block, this block can be omitted
      in the outlined region, so store is placed outside of the function. The
      suggested solution is to process saving outputs after creating exit
      stubs for new function, and stores will be placed in that blocks before
      return in this case.
      
      Patch by Sergei Kachkov!
      
      Fixes llvm.org/PR40455.
      
      Differential Revision: https://reviews.llvm.org/D57919
      
      llvm-svn: 353562
      0e5dd512
    • Carlos Alberto Enciso's avatar
      [DWARF] LLVM ERROR: Broken function found, while removing Debug Intrinsics. · 08dc50f2
      Carlos Alberto Enciso authored
      Check that when SimplifyCFG is flattening a 'br', all their debug intrinsic instructions are removed, including any dbg.label referencing a label associated with the basic blocks being removed.
      
      Differential Revision: https://reviews.llvm.org/D57444
      
      llvm-svn: 353511
      08dc50f2
    • Sergey Dmitriev's avatar
      [CodeExtractor] Update function's assumption cache after extracting blocks from it · 807960e6
      Sergey Dmitriev authored
      Summary: Assumption cache's self-updating mechanism does not correctly handle the case when blocks are extracted from the function by the CodeExtractor. As a result function's assumption cache may have stale references to the llvm.assume calls that were moved to the outlined function. This patch fixes this problem by removing extracted llvm.assume calls from the function’s assumption cache.
      
      Reviewers: hfinkel, vsk, fhahn, davidxl, sanjoy
      
      Reviewed By: hfinkel, vsk
      
      Subscribers: llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D57215
      
      llvm-svn: 353500
      807960e6
  11. Feb 06, 2019
  12. Feb 05, 2019
    • Jeremy Morse's avatar
      [DebugInfo][NFCI] Split salvageDebugInfo into helper functions · 84ca706b
      Jeremy Morse authored
      Some use cases are appearing where salvaging is needed that does not
      correspond to an instruction being deleted -- for example an instruction
      being sunk, or a Value not being available in a block being isel'd.
      
      Enable more fine grained control over how salavging occurs by splitting
      the logic into helper functions, separating things that are specific to
      working on DbgVariableIntrinsics from those specific to interpreting IR
      and building DIExpressions.
      
      Differential Revision: https://reviews.llvm.org/D57696
      
      llvm-svn: 353156
      84ca706b
  13. Feb 04, 2019
  14. Feb 02, 2019
    • Florian Hahn's avatar
      [LCSSA] Handle case with single new PHI faster. · dd2ef0af
      Florian Hahn authored
      If there is only a single available value, all uses must be dominated by
      the single value and there is no need to search for a reaching
      definition.
      
      This drastically speeds up LCSSA in some cases. For the test case
      from PR37202, it speeds up LCSSA construction by 4 times.
      
      Time-passes without this patch for test case from PR37202:
      
          Total Execution Time: 29.9285 seconds (29.9276 wall clock)
      
          ---User Time---   --System Time--   --User+System--   ---Wall Time---  --- Name ---
          5.2786 ( 17.7%)   0.0021 (  1.2%)   5.2806 ( 17.6%)   5.2808 ( 17.6%)  Unswitch loops
          4.3739 ( 14.7%)   0.0303 ( 18.1%)   4.4042 ( 14.7%)   4.4042 ( 14.7%)  Loop-Closed SSA Form Pass
          4.2658 ( 14.3%)   0.0192 ( 11.5%)   4.2850 ( 14.3%)   4.2851 ( 14.3%)  Loop-Closed SSA Form Pass #2
          2.2307 (  7.5%)   0.0013 (  0.8%)   2.2320 (  7.5%)   2.2318 (  7.5%)  Loop Invariant Code Motion
          2.0888 (  7.0%)   0.0012 (  0.7%)   2.0900 (  7.0%)   2.0897 (  7.0%)  Unroll loops
          1.6761 (  5.6%)   0.0013 (  0.8%)   1.6774 (  5.6%)   1.6774 (  5.6%)  Value Propagation
          1.3686 (  4.6%)   0.0029 (  1.8%)   1.3716 (  4.6%)   1.3714 (  4.6%)  Induction Variable Simplification
          1.1457 (  3.8%)   0.0010 (  0.6%)   1.1468 (  3.8%)   1.1468 (  3.8%)  Loop-Closed SSA Form Pass #4
          1.1384 (  3.8%)   0.0005 (  0.3%)   1.1389 (  3.8%)   1.1389 (  3.8%)  Loop-Closed SSA Form Pass #6
          1.1360 (  3.8%)   0.0027 (  1.6%)   1.1387 (  3.8%)   1.1387 (  3.8%)  Loop-Closed SSA Form Pass #5
          1.1331 (  3.8%)   0.0010 (  0.6%)   1.1341 (  3.8%)   1.1340 (  3.8%)  Loop-Closed SSA Form Pass #3
      
      Time passes with this patch
      
        Total Execution Time: 19.2802 seconds (19.2813 wall clock)
      
         ---User Time---   --System Time--   --User+System--   ---Wall Time---  --- Name ---
         4.4234 ( 23.2%)   0.0038 (  2.0%)   4.4272 ( 23.0%)   4.4273 ( 23.0%)  Unswitch loops
         2.3828 ( 12.5%)   0.0020 (  1.1%)   2.3848 ( 12.4%)   2.3847 ( 12.4%)  Unroll loops
         1.8714 (  9.8%)   0.0020 (  1.1%)   1.8734 (  9.7%)   1.8735 (  9.7%)  Loop Invariant Code Motion
         1.7973 (  9.4%)   0.0022 (  1.2%)   1.7995 (  9.3%)   1.8003 (  9.3%)  Value Propagation
         1.4010 (  7.3%)   0.0033 (  1.8%)   1.4043 (  7.3%)   1.4044 (  7.3%)  Induction Variable Simplification
         0.9978 (  5.2%)   0.0244 ( 13.1%)   1.0222 (  5.3%)   1.0224 (  5.3%)  Loop-Closed SSA Form Pass #2
         0.9611 (  5.0%)   0.0257 ( 13.8%)   0.9868 (  5.1%)   0.9868 (  5.1%)  Loop-Closed SSA Form Pass
         0.5856 (  3.1%)   0.0015 (  0.8%)   0.5871 (  3.0%)   0.5869 (  3.0%)  Unroll loops #2
         0.4132 (  2.2%)   0.0012 (  0.7%)   0.4145 (  2.1%)   0.4143 (  2.1%)  Loop Invariant Code Motion #3
      
      Reviewers: efriedma, davide, mzolotukhin
      
      Reviewed By: efriedma
      
      Differential Revision: https://reviews.llvm.org/D57033
      
      llvm-svn: 352960
      dd2ef0af
    • Florian Hahn's avatar
      [LCSSA] Add expensive verification of LCSSA form for sub-loops. · 509b48a6
      Florian Hahn authored
      This assertion makes sure all sub-loops are in LCSSA form before
      bringing their parent in LCSSA form. This precondition was added to
      formLCSSA in D56848.
      
      Reviewers: davide, efriedma, mzolotukhin
      
      Reviewed By: davide
      
      Differential Revision: https://reviews.llvm.org/D56921
      
      llvm-svn: 352958
      509b48a6
  15. Feb 01, 2019
Loading