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
SimplifyCFGPass(SimplifyCFGOptions().convertSwitchRangeToICmp(true)));
}
- if (EnableConstraintElimination)
- FPM.addPass(ConstraintEliminationPass());
-
// Speculative execution if the target has divergent branches; otherwise nop.
FPM.addPass(SpeculativeExecutionPass(/* OnlyIfDivergentTarget =*/true));
if (Level == OptimizationLevel::O3)
FPM.addPass(AggressiveInstCombinePass());
+ if (EnableConstraintElimination)
+ FPM.addPass(ConstraintEliminationPass());
+
if (!Level.isOptimizingForSize())
FPM.addPass(LibCallsShrinkWrapPass());