Skip to content

Commit 32825e8

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 f8d5b49 commit 32825e8

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

llvm/lib/Transforms/IPO/PassManagerBuilder.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -470,6 +470,9 @@ void PassManagerBuilder::addFunctionSimplificationPasses(
470470
MPM.add(createMemCpyOptPass()); // Remove memcpy / form memset
471471
MPM.add(createSCCPPass()); // Constant prop with SCCP
472472

473+
if (EnableConstraintElimination)
474+
MPM.add(createConstraintEliminationPass());
475+
473476
// Delete dead bit computations (instcombine runs after to fold away the dead
474477
// computations, and then ADCE will run later to exploit any new DCE
475478
// opportunities that creates).
@@ -1056,6 +1059,9 @@ void PassManagerBuilder::addLTOOptimizationPasses(legacy::PassManagerBase &PM) {
10561059
if (EnableLoopInterchange)
10571060
PM.add(createLoopInterchangePass());
10581061

1062+
if (EnableConstraintElimination)
1063+
PM.add(createConstraintEliminationPass());
1064+
10591065
// Unroll small loops
10601066
PM.add(createSimpleLoopUnrollPass(OptLevel, DisableUnrollLoops,
10611067
ForgetAllSCEVInLoopUnroll));

0 commit comments

Comments
 (0)