Skip to content
  1. Aug 21, 2018
    • Florian Hahn's avatar
      [CodeExtractor] Use 'normal destination' BB as insert point to store invoke results. · 7cdf52e4
      Florian Hahn authored
      Currently CodeExtractor tries to use the next node after an invoke to
      place the store for the result of the invoke, if it is an out parameter
      of the region. This fails, as the invoke terminates the current BB.
      In that case, we can place the store in the 'normal destination' BB, as
      the result will only be available in that case.
      
      
      Reviewers: davidxl, davide, efriedma
      
      Reviewed By: davidxl
      
      Differential Revision: https://reviews.llvm.org/D51037
      
      llvm-svn: 340331
      7cdf52e4
    • Craig Topper's avatar
      [BypassSlowDivision] Teach bypass slow division not to interfere with div by... · b172b888
      Craig Topper authored
      [BypassSlowDivision] Teach bypass slow division not to interfere with div by constant where constants have been constant hoisted, but not moved from their basic block
      
      DAGCombiner doesn't pay attention to whether constants are opaque before doing the div by constant optimization. So BypassSlowDivision shouldn't introduce control flow that would make DAGCombiner unable to see an opaque constant. This can occur when a div and rem of the same constant are used in the same basic block. it will be hoisted, but not leave the block.
      
      Longer term we probably need to look into the X86 immediate cost model used by constant hoisting and maybe not mark div/rem immediates for hoisting at all.
      
      This fixes the case from PR38649.
      
      Differential Revision: https://reviews.llvm.org/D51000
      
      llvm-svn: 340303
      b172b888
  2. Aug 20, 2018
  3. Aug 17, 2018
  4. Aug 16, 2018
  5. Aug 15, 2018
  6. Aug 13, 2018
  7. Aug 11, 2018
  8. Aug 10, 2018
    • David Bolvansky's avatar
      [InstCombine] Transform str(n)cmp to memcmp · 909889b2
      David Bolvansky authored
      Summary:
      Motivation examples:
      int strcmp_memcmp() {
          char buf[12];
          return strcmp(buf, "key") == 0;
      }
      
      int strcmp_memcmp2() {
          char buf[12];
          return strcmp(buf, "key") != 0;
      }
      
      int strncmp_memcmp() {
          char buf[12];
          return strncmp(buf, "key", 3) == 0;
      }
      
      can be turned to memcmp.
      
      See test file for more cases.
      
      Reviewers: efriedma
      
      Reviewed By: efriedma
      
      Subscribers: spatel, llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D50233
      
      llvm-svn: 339410
      909889b2
  9. Aug 07, 2018
  10. Aug 06, 2018
    • Evandro Menezes's avatar
      [SLC] Fix shrinking of pow() · 6e137cb9
      Evandro Menezes authored
      Properly shrink `pow()` to `powf()` as a binary function and, when no other
      simplification applies, do not discard it.
      
      Differential revision: https://reviews.llvm.org/D50113
      
      llvm-svn: 339046
      6e137cb9
    • Hsiangkai Wang's avatar
      [DebugInfo] Refactor DbgInfoIntrinsic class hierarchy. · ef72e481
      Hsiangkai Wang authored
      In the past, DbgInfoIntrinsic has a strong assumption that these
      intrinsics all have variables and expressions attached to them.
      However, it is too strong to derive the class for other debug entities.
      Now, it has problems for debug labels.
      
      In order to make DbgInfoIntrinsic as a base class for 'debug info', I
      create a class for 'variable debug info', DbgVariableIntrinsic.
      
      DbgDeclareInst, DbgAddrIntrinsic, and DbgValueInst will be derived from it.
      
      Differential Revision: https://reviews.llvm.org/D50220
      
      llvm-svn: 338984
      ef72e481
  11. Aug 05, 2018
    • David Bolvansky's avatar
      Enrich inline messages · c0aa4b75
      David Bolvansky authored
      Summary:
      This patch improves Inliner to provide causes/reasons for negative inline decisions.
      1. It adds one new message field to InlineCost to report causes for Always and Never instances. All Never and Always instantiations must provide a simple message.
      2. Several functions that used to return the inlining results as boolean are changed to return InlineResult which carries the cause for negative decision.
      3. Changed remark priniting and debug output messages to provide the additional messages and related inline cost.
      4. Adjusted tests for changed printing.
      
      Patch by: yrouban (Yevgeny Rouban)
      
      
      Reviewers: craig.topper, sammccall, sgraenitz, NutshellySima, shchenz, chandlerc, apilipenko, javed.absar, tejohnson, dblaikie, sanjoy, eraman, xbolva00
      
      Reviewed By: tejohnson, xbolva00
      
      Subscribers: xbolva00, llvm-commits, arsenm, mehdi_amini, eraman, haicheng, steven_wu, dexonsmith
      
      Differential Revision: https://reviews.llvm.org/D49412
      
      llvm-svn: 338969
      c0aa4b75
  12. Aug 04, 2018
    • Chijun Sima's avatar
      [TailCallElim] Preserve DT and PDT · 8b5de48d
      Chijun Sima authored
      Summary:
      Previously, in the NewPM pipeline, TailCallElim recalculates the DomTree when it modifies any instruction in the Function.
      For example,
      ```
      CallInst *CI = dyn_cast<CallInst>(&I);
      ...
      CI->setTailCall();
      Modified = true;
      ...
      if (!Modified || ...)
        return PreservedAnalyses::all();
      ```
      After applying this patch, the DomTree only recalculates if needed (plus an extra insertEdge() + an extra deleteEdge() call).
      
      When optimizing SQLite with `-passes="default<O3>"` pipeline of the newPM, the number of DomTree recalculation decreases by 6.2%, the number of nodes visited by DFS decreases by 2.9%. The time used by DomTree will decrease approximately 1%~2.5% after applying the patch.
       
      Statistics:
      ```
      Before the patch:
       23010 dom-tree-stats               - Number of DomTree recalculations
      489264 dom-tree-stats               - Number of nodes visited by DFS -- DomTree
      After the patch:
       21581 dom-tree-stats               - Number of DomTree recalculations
      475088 dom-tree-stats               - Number of nodes visited by DFS -- DomTree
      ```
      
      Reviewers: kuhar, dmgreen, brzycki, grosser, davide
      
      Reviewed By: kuhar, brzycki
      
      Subscribers: llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D49982
      
      llvm-svn: 338954
      8b5de48d
  13. Aug 03, 2018
    • Evandro Menezes's avatar
      [SLC] Refactor shrinking of functions (NFC) · 5aa217ac
      Evandro Menezes authored
      Merge the helper functions for shrinking unary and binary functions into a
      single one, while keeping all their functionality.  Otherwise, NFC.
      
      llvm-svn: 338905
      5aa217ac
    • Chijun Sima's avatar
      [Dominators] Make RemoveUnreachableBlocks return false if the BasicBlock is... · 53048437
      Chijun Sima authored
      [Dominators] Make RemoveUnreachableBlocks return false if the BasicBlock is already awaiting deletion
      
      Summary:
      Previously, `removeUnreachableBlocks` still returns true (which indicates the CFG is changed) even when all the unreachable blocks found is awaiting deletion in the DDT class.
      This makes code pattern like
      ```
      // Code modified from lib/Transforms/Scalar/SimplifyCFGPass.cpp 
      bool EverChanged = removeUnreachableBlocks(F, nullptr, DDT);
      ...
      do {
          EverChanged = someMightHappenModifications();
          EverChanged |= removeUnreachableBlocks(F, nullptr, DDT);
        } while (EverChanged);
      ```
      become a dead loop.
      Fix this by detecting whether a BasicBlock is already awaiting deletion.
      
      Reviewers: kuhar, brzycki, dmgreen, grosser, davide
      
      Reviewed By: kuhar, brzycki
      
      Subscribers: llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D49738
      
      llvm-svn: 338882
      53048437
    • Chijun Sima's avatar
      [Dominators] Convert existing passes and utils to use the DomTreeUpdater class · 21a8b605
      Chijun Sima authored
      Summary:
      This patch is the second in a series of patches related to the [[ http://lists.llvm.org/pipermail/llvm-dev/2018-June/123883.html | RFC - A new dominator tree updater for LLVM ]].
      
      It converts passes (e.g. adce/jump-threading) and various functions which currently accept DDT in local.cpp and BasicBlockUtils.cpp to use the new DomTreeUpdater class.
      These converted functions in utils can accept DomTreeUpdater with either UpdateStrategy and can deal with both DT and PDT held by the DomTreeUpdater.
      
      Reviewers: brzycki, kuhar, dmgreen, grosser, davide
      
      Reviewed By: brzycki
      
      Subscribers: llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D48967
      
      llvm-svn: 338814
      21a8b605
  14. Aug 02, 2018
  15. Aug 01, 2018
    • David Bolvansky's avatar
      Revert "Enrich inline messages", tests fail · fbbb83c7
      David Bolvansky authored
      llvm-svn: 338496
      fbbb83c7
    • David Bolvansky's avatar
      Enrich inline messages · 7f36cd9d
      David Bolvansky authored
      Summary:
      This patch improves Inliner to provide causes/reasons for negative inline decisions.
      1. It adds one new message field to InlineCost to report causes for Always and Never instances. All Never and Always instantiations must provide a simple message.
      2. Several functions that used to return the inlining results as boolean are changed to return InlineResult which carries the cause for negative decision.
      3. Changed remark priniting and debug output messages to provide the additional messages and related inline cost.
      4. Adjusted tests for changed printing.
      
      Patch by: yrouban (Yevgeny Rouban)
      
      
      Reviewers: craig.topper, sammccall, sgraenitz, NutshellySima, shchenz, chandlerc, apilipenko, javed.absar, tejohnson, dblaikie, sanjoy, eraman, xbolva00
      
      Reviewed By: tejohnson, xbolva00
      
      Subscribers: xbolva00, llvm-commits, arsenm, mehdi_amini, eraman, haicheng, steven_wu, dexonsmith
      
      Differential Revision: https://reviews.llvm.org/D49412
      
      llvm-svn: 338494
      7f36cd9d
    • Evandro Menezes's avatar
      [SLC] Refactor the simplication of pow() (NFC) · 61e4e407
      Evandro Menezes authored
      Reword comments and minor code reformatting.
      
      llvm-svn: 338446
      61e4e407
  16. Jul 31, 2018
    • Anastasis Grammenos's avatar
      [DebugInfo][LCSSA] Preserve debug location in lcssa phis · ac3f8028
      Anastasis Grammenos authored
      Summary:
      When inserting lcssa Phi Nodes in the exit block
      mak sure to preserve the original instructions DL.
      
      Reviewers: vsk
      
      Subscribers: JDevlieghere, llvm-commits
      
      Differential Revision: https://reviews.llvm.org/D50009
      
      llvm-svn: 338391
      ac3f8028
    • David Bolvansky's avatar
      Revert Enrich inline messages · ab79414f
      David Bolvansky authored
      llvm-svn: 338389
      ab79414f
    • David Bolvansky's avatar
      Enrich inline messages · b562dbab
      David Bolvansky authored
      Summary:
      This patch improves Inliner to provide causes/reasons for negative inline decisions.
      1. It adds one new message field to InlineCost to report causes for Always and Never instances. All Never and Always instantiations must provide a simple message.
      2. Several functions that used to return the inlining results as boolean are changed to return InlineResult which carries the cause for negative decision.
      3. Changed remark priniting and debug output messages to provide the additional messages and related inline cost.
      4. Adjusted tests for changed printing.
      
      Patch by: yrouban (Yevgeny Rouban)
      
      
      Reviewers: craig.topper, sammccall, sgraenitz, NutshellySima, shchenz, chandlerc, apilipenko, javed.absar, tejohnson, dblaikie, sanjoy, eraman, xbolva00
      
      Reviewed By: tejohnson, xbolva00
      
      Subscribers: xbolva00, llvm-commits, arsenm, mehdi_amini, eraman, haicheng, steven_wu, dexonsmith
      
      Differential Revision: https://reviews.llvm.org/D49412
      
      llvm-svn: 338387
      b562dbab
  17. Jul 30, 2018
Loading