Skip to content

Commit

Permalink
[ConstraintElim] Move after first instcombine run.
Browse files Browse the repository at this point in the history
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.

Reviewed By: nikic

Differential Revision: https://reviews.llvm.org/D140853
  • Loading branch information
fhahn committed Jan 3, 2023
1 parent 2545078 commit 9e6d2c8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions llvm/lib/Passes/PassBuilderPipelines.cpp
Expand Up @@ -492,9 +492,6 @@ PassBuilder::buildFunctionSimplificationPipeline(OptimizationLevel Level,
SimplifyCFGPass(SimplifyCFGOptions().convertSwitchRangeToICmp(true)));
}

if (EnableConstraintElimination)
FPM.addPass(ConstraintEliminationPass());

// Speculative execution if the target has divergent branches; otherwise nop.
FPM.addPass(SpeculativeExecutionPass(/* OnlyIfDivergentTarget =*/true));

Expand All @@ -508,6 +505,9 @@ PassBuilder::buildFunctionSimplificationPipeline(OptimizationLevel Level,
if (Level == OptimizationLevel::O3)
FPM.addPass(AggressiveInstCombinePass());

if (EnableConstraintElimination)
FPM.addPass(ConstraintEliminationPass());

if (!Level.isOptimizingForSize())
FPM.addPass(LibCallsShrinkWrapPass());

Expand Down

0 comments on commit 9e6d2c8

Please sign in to comment.