[llvm-branch-commits] [llvm] 32825e8 - [ConstraintElimination] Tweak placement in pipeline.

Florian Hahn via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Mon Dec 7 11:19:48 PST 2020


Author: Florian Hahn
Date: 2020-12-07T19:08:40Z
New Revision: 32825e8636d6832007f30ae46ffbae124020ad31

URL: https://github.com/llvm/llvm-project/commit/32825e8636d6832007f30ae46ffbae124020ad31
DIFF: https://github.com/llvm/llvm-project/commit/32825e8636d6832007f30ae46ffbae124020ad31.diff

LOG: [ConstraintElimination] Tweak placement in pipeline.

This patch adds the ConstraintElimination pass to the LTO pipeline and
also runs it after SCCP in the function simplification pipeline.

This increases the number of cases we can elimination. Pending further
tuning.

Added: 
    

Modified: 
    llvm/lib/Transforms/IPO/PassManagerBuilder.cpp

Removed: 
    


################################################################################
diff  --git a/llvm/lib/Transforms/IPO/PassManagerBuilder.cpp b/llvm/lib/Transforms/IPO/PassManagerBuilder.cpp
index e03015f8b0aa..e823a56073a4 100644
--- a/llvm/lib/Transforms/IPO/PassManagerBuilder.cpp
+++ b/llvm/lib/Transforms/IPO/PassManagerBuilder.cpp
@@ -470,6 +470,9 @@ void PassManagerBuilder::addFunctionSimplificationPasses(
   MPM.add(createMemCpyOptPass());             // Remove memcpy / form memset
   MPM.add(createSCCPPass());                  // Constant prop with SCCP
 
+  if (EnableConstraintElimination)
+    MPM.add(createConstraintEliminationPass());
+
   // Delete dead bit computations (instcombine runs after to fold away the dead
   // computations, and then ADCE will run later to exploit any new DCE
   // opportunities that creates).
@@ -1056,6 +1059,9 @@ void PassManagerBuilder::addLTOOptimizationPasses(legacy::PassManagerBase &PM) {
   if (EnableLoopInterchange)
     PM.add(createLoopInterchangePass());
 
+  if (EnableConstraintElimination)
+    PM.add(createConstraintEliminationPass());
+
   // Unroll small loops
   PM.add(createSimpleLoopUnrollPass(OptLevel, DisableUnrollLoops,
                                     ForgetAllSCEVInLoopUnroll));


        


More information about the llvm-branch-commits mailing list