Skip to content

Commit 3ed1617

Browse files
committed
Merge pull request #2231 from rudkx/reorder-passes
2 parents 8d2d5e2 + 0bc63c8 commit 3ed1617

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

lib/SILOptimizer/PassManager/Passes.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -219,24 +219,24 @@ void AddSSAPasses(SILPassManager &PM, OptimizationLevelKind OpLevel) {
219219
// Promote stack allocations to values and eliminate redundant
220220
// loads.
221221
PM.addMem2Reg();
222-
PM.addRedundantLoadElimination();
222+
PM.addPerformanceConstantPropagation();
223223
// Do a round of CFG simplification, followed by peepholes, then
224224
// more CFG simplification.
225-
AddSimplifyCFGSILCombine(PM);
226225

227-
PM.addPerformanceConstantPropagation();
228-
PM.addCSE();
229-
PM.addSILCombine();
230-
PM.addJumpThreadSimplifyCFG();
231-
// Jump threading can expose opportunity for silcombine (enum -> is_enum_tag->
226+
// Jump threading can expose opportunity for SILCombine (enum -> is_enum_tag->
232227
// cond_br).
228+
PM.addJumpThreadSimplifyCFG();
233229
PM.addSILCombine();
234-
// Which can expose opportunity for simplifcfg.
230+
// SILCombine can expose further opportunities for SimplifyCFG.
235231
PM.addSimplifyCFG();
236232

233+
PM.addCSE();
234+
PM.addRedundantLoadElimination();
235+
237236
// Perform retain/release code motion and run the first ARC optimizer.
238237
PM.addCSE();
239238
PM.addDCE();
239+
240240
PM.addEarlyCodeMotion();
241241
PM.addARCSequenceOpts();
242242

0 commit comments

Comments
 (0)