Skip to content

Commit 0daa136

Browse files
committed
[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.
1 parent dbca886 commit 0daa136

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

Diff for: llvm/lib/Transforms/IPO/PassManagerBuilder.cpp

+6
Original file line numberDiff line numberDiff line change
@@ -453,6 +453,9 @@ void PassManagerBuilder::addFunctionSimplificationPasses(
453453
MPM.add(createMemCpyOptPass()); // Remove memcpy / form memset
454454
MPM.add(createSCCPPass()); // Constant prop with SCCP
455455

456+
if (EnableConstraintElimination)
457+
MPM.add(createConstraintEliminationPass());
458+
456459
// Delete dead bit computations (instcombine runs after to fold away the dead
457460
// computations, and then ADCE will run later to exploit any new DCE
458461
// opportunities that creates).
@@ -1028,6 +1031,9 @@ void PassManagerBuilder::addLTOOptimizationPasses(legacy::PassManagerBase &PM) {
10281031
if (EnableLoopInterchange)
10291032
PM.add(createLoopInterchangePass());
10301033

1034+
if (EnableConstraintElimination)
1035+
PM.add(createConstraintEliminationPass());
1036+
10311037
// Unroll small loops
10321038
PM.add(createSimpleLoopUnrollPass(OptLevel, DisableUnrollLoops,
10331039
ForgetAllSCEVInLoopUnroll));

0 commit comments

Comments
 (0)