[PATCH] D140853: [ConstraintElim] Move after first instcombine run.

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 2 12:01:54 PST 2023


fhahn created this revision.
fhahn added reviewers: nikic, zjaffal, spatel, fcloutier.
Herald added a subscriber: hiraditya.
Herald added a project: All.
fhahn requested review of this revision.
Herald added a project: LLVM.

Running ConstraintEliminiation after the first InstCombine run results
in slightly more simplifications on average.

There are is a tiny number of regressions, mostly due to CVP eliminating
a condition that ConstraintElimination would use, but in most cases
there's a slight improvement or no change.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D140853

Files:
  llvm/lib/Passes/PassBuilderPipelines.cpp


Index: llvm/lib/Passes/PassBuilderPipelines.cpp
===================================================================
--- llvm/lib/Passes/PassBuilderPipelines.cpp
+++ llvm/lib/Passes/PassBuilderPipelines.cpp
@@ -492,9 +492,6 @@
         SimplifyCFGPass(SimplifyCFGOptions().convertSwitchRangeToICmp(true)));
   }
 
-  if (EnableConstraintElimination)
-    FPM.addPass(ConstraintEliminationPass());
-
   // Speculative execution if the target has divergent branches; otherwise nop.
   FPM.addPass(SpeculativeExecutionPass(/* OnlyIfDivergentTarget =*/true));
 
@@ -508,6 +505,9 @@
   if (Level == OptimizationLevel::O3)
     FPM.addPass(AggressiveInstCombinePass());
 
+  if (EnableConstraintElimination)
+    FPM.addPass(ConstraintEliminationPass());
+
   if (!Level.isOptimizingForSize())
     FPM.addPass(LibCallsShrinkWrapPass());
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D140853.485880.patch
Type: text/x-patch
Size: 833 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230102/8ef5a6cd/attachment.bin>


More information about the llvm-commits mailing list