Skip to content
  1. May 21, 2020
    • Juneyoung Lee's avatar
      Add CanonicalizeFreezeInLoops pass · d9a4a244
      Juneyoung Lee authored
      Summary:
      If an induction variable is frozen and used, SCEV yields imprecise result
      because it doesn't say anything about frozen variables.
      
      Due to this reason, performance degradation happened after
      https://reviews.llvm.org/D76483 is merged, causing
      SCEV yield imprecise result and preventing LSR to optimize a loop.
      
      The suggested solution here is to add a pass which canonicalizes frozen variables
      inside a loop. To be specific, it pushes freezes out of the loop by freezing
      the initial value and step values instead & dropping nsw/nuw flags from instructions used by freeze.
      This solution was also mentioned at https://reviews.llvm.org/D70623 .
      
      Reviewers: spatel, efriedma, lebedev.ri, fhahn, jdoerfert
      
      Reviewed By: fhahn
      
      Subscribers: nikic, mgorny, hiraditya, javed.absar, llvm-commits, sanwou01, nlopes
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D77523
      d9a4a244
  2. May 20, 2020
    • Florian Hahn's avatar
      [SCEV] Move ScalarEvolutionExpander.cpp to Transforms/Utils (NFC). · bcbd26bf
      Florian Hahn authored
      SCEVExpander modifies the underlying function so it is more suitable in
      Transforms/Utils, rather than Analysis. This allows using other
      transform utils in SCEVExpander.
      
      This patch was originally committed as b8a3c34e, but broke the
      modules build, as LoopAccessAnalysis was using the Expander.
      
      The code-gen part of LAA was moved to lib/Transforms recently, so this
      patch can be landed again.
      
      Reviewers: sanjoy.google, efriedma, reames
      
      Reviewed By: sanjoy.google
      
      Differential Revision: https://reviews.llvm.org/D71537
      bcbd26bf
  3. May 19, 2020
    • Benjamin Kramer's avatar
      Give helpers internal linkage. NFC. · 350dadaa
      Benjamin Kramer authored
      350dadaa
    • Nikita Popov's avatar
      [LVI] Don't require DominatorTree in LVI (NFC) · 5fae613a
      Nikita Popov authored
      After D76797 the dominator tree is no longer used in LVI, so we
      can remove it as a pass dependency, and also get rid of the
      dominator tree enabling/disabling logic in JumpThreading.
      
      Apart from cleaning up the code, this also clarifies LVI
      cache consistency, in that the LVI cache can no longer
      depend on whether the DT was or wasn't enabled due to
      pending DT updates at any given time.
      
      Differential Revision: https://reviews.llvm.org/D76985
      5fae613a
    • Jay Foad's avatar
      [InstCombine] Remove hasNoInfs check for pow(C,y) -> exp2(log2(C)*y) · 9bc989a4
      Jay Foad authored
      We already check hasNoNaNs and that x is finite and strictly positive.
      That only leaves the following special cases (taken from the Linux man
      page for pow):
      
      If x is +1, the result is 1.0 (even if y is a NaN).
      If the absolute value of x is less than 1, and y is negative infinity, the result is positive infinity.
      If the absolute value of x is greater than 1, and y is negative infinity, the result is +0.
      If the absolute value of x is less than 1, and y is positive infinity, the result is +0.
      If the absolute value of x is greater than 1, and y is positive infinity, the result is positive infinity.
      
      The first case is handled elsewhere, and this transformation preserves
      all the others, so there is no need to limit it to hasNoInfs.
      
      Differential Revision: https://reviews.llvm.org/D79409
      9bc989a4
    • Sameer Sahasrabuddhe's avatar
      [LoopSimplify] don't separate nested loops with convergent calls · 6c848843
      Sameer Sahasrabuddhe authored
      Summary:
      When a loop has multiple backedges, loop simplification attempts to
      separate them out into nested loops. This results in incorrect control
      flow in the presence of some functions like a GPU barrier. This change
      skips the transformation when such "convergent" function calls are
      present in the loop body.
      
      Reviewed By: nhaehnle
      
      Differential Revision: https://reviews.llvm.org/D80078
      6c848843
  4. May 18, 2020
    • Vedant Kumar's avatar
      [Local] Do not ignore zexts in salvageDebugInfo, PR45923 · 623b2542
      Vedant Kumar authored
      Summary:
      When salvaging a dead zext instruction, append a convert operation to
      the DIExpressions of the debug uses of the instruction, to prevent the
      salvaged value from being sign-extended.
      
      I confirmed that lldb prints out the correct unsigned result for "f" in
      the example from PR45923 with this changed applied.
      
      rdar://63246143
      
      Reviewers: aprantl, jmorse, chrisjackson, davide
      
      Subscribers: hiraditya, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D80034
      623b2542
  5. May 17, 2020
  6. May 16, 2020
  7. May 15, 2020
  8. May 13, 2020
  9. May 11, 2020
  10. May 10, 2020
  11. May 08, 2020
  12. May 07, 2020
    • Yevgeny Rouban's avatar
      SplitIndirectBrCriticalEdges: Fix Branch Probability update · b921543c
      Yevgeny Rouban authored
      Splitting critical edges for indirect branches
      the SplitIndirectBrCriticalEdges() function may break branch
      probabilities if target basic block happens to have unset
      a probability for any of its successors. That is because in
      such cases the getEdgeProbability(Target) function returns
      probability 1/NumOfSuccessors and it is called after Target
      was split (thus Target has a single successor). As the result
      the correspondent successor of the split block gets
      probability 100% but 1/NumOfSuccessors is expected (or better
      be left unset).
      
      Reviewers: yamauchi
      Differential Revision: https://reviews.llvm.org/D78806
      b921543c
  13. May 06, 2020
  14. May 05, 2020
  15. May 04, 2020
  16. May 03, 2020
    • Hongtao Yu's avatar
      [ICP] Handling must tail calls in indirect call promotion · 911e06f5
      Hongtao Yu authored
      Per the IR convention, a musttail call must precede a ret with an optional bitcast. This was violated by the indirect call promotion optimization which could result an IR like:
      
          ; <label>:2192:
            br i1 %2198, label %2199, label %2201, !dbg !226012, !prof !229483
      
          ; <label>:2199:                                   ; preds = %2192
            musttail call fastcc void @foo(i8* %2195), !dbg !226012
            br label %2202, !dbg !226012
      
          ; <label>:2201:                                   ; preds = %2192
            musttail call fastcc void %2197(i8* %2195), !dbg !226012
            br label %2202, !dbg !226012
      
          ; <label>:2202:                                   ; preds = %605, %2201, %2199
            ret void, !dbg !229485
      
      This is being fixed in this change where the return statement goes together with the promoted indirect call. The code generated is like:
      
          ; <label>:2192:
            br i1 %2198, label %2199, label %2201, !dbg !226012, !prof !229483
      
          ; <label>:2199:                                   ; preds = %2192
            musttail call fastcc void @foo(i8* %2195), !dbg !226012
            ret void, !dbg !229485
      
          ; <label>:2201:                                   ; preds = %2192
            musttail call fastcc void %2197(i8* %2195), !dbg !226012
            ret void, !dbg !229485
      
      Differential Revision: https://reviews.llvm.org/D79258
      911e06f5
  17. May 02, 2020
  18. Apr 30, 2020
    • Florian Hahn's avatar
      [LoopVersioning] Update setAliasChecks to take ArrayRef argument (NFC). · 19ab53f1
      Florian Hahn authored
      This cleanup was suggested as part of D78458.
      19ab53f1
    • Nikita Popov's avatar
      [InlineFunction] Disable emission of alignment assumptions by default · b74c6d2c
      Nikita Popov authored
      In D74183 clang started emitting alignment for sret parameters
      unconditionally. This caused a 1.5% compile-time regression on
      tramp3d-v4. The reason is that we now generate many instance of IR like
      
          %ptrint = ptrtoint %class.GuardLayers* %guards_m to i64
          %maskedptr = and i64 %ptrint, 3
          %maskcond = icmp eq i64 %maskedptr, 0
          tail call void @llvm.assume(i1 %maskcond)
      
      to preserve the alignment information during inlining. Based on IR
      analysis, these assumptions also regress optimization. The attached
      phase ordering test case illustrates two issues: One are instruction
      count based optimization heuristics, which are affected by the four
      additional instructions of the assumption. The other is blocking of
      SROA due to ptrtoint casts (PR45763).
      
      We already encountered the same problem in Rust, where we (unlike
      Clang) generally prefer to emit alignment information absolutely
      everywhere it is available. We were only able to do this after
      hardcoding -preserve-alignment-assumptions-during-inlining=false,
      because we were seeing significant optimization and compile-time
      regressions otherwise.
      
      This patch disables -preserve-alignment-assumptions-during-inlining
      by default, because we should not be punishing people for adding
      more alignment annotations.
      
      Once the assume bundle work shakes out and we can represent (and use)
      alignment assumptions using assume bundles, it should be possible to
      re-enable this with reduced overhead.
      
      Differential Revision: https://reviews.llvm.org/D76886
      b74c6d2c
    • Arthur Eubanks's avatar
      [NFC] Rename *ByValOrInalloca* to *PassPointeeByValue* · a90948fd
      Arthur Eubanks authored
      Summary: In preparation for preallocated.
      
      Subscribers: hiraditya, llvm-commits
      
      Tags: #llvm
      
      Differential Revision: https://reviews.llvm.org/D79152
      a90948fd
Loading