Skip to content

Commit 2f11c61

Browse files
committed
Tidy and document the last part of the pass manager builder. NFC.
1 parent 16de5d1 commit 2f11c61

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

lib/SILPasses/PassManager/Passes.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,6 @@ void swift::runSILOptimizationPasses(SILModule &Module) {
262262
PM.runOneIteration();
263263
PM.resetAndRemoveTransformations();
264264

265-
266265
// Run two iterations of the mid-level SSA passes.
267266
PM.setStageName("MidLevel");
268267
AddSSAPasses(PM, OptimizationLevelKind::MidLevel);
@@ -337,22 +336,23 @@ void swift::runSILOptimizationPasses(SILModule &Module) {
337336

338337
PM.runOneIteration();
339338
PM.resetAndRemoveTransformations();
340-
PM.addCodeSinking();
341339

342340
PM.setStageName("LateLoopOpt");
343-
PM.addLICM();
344341

345-
// Perform the final lowering transformations.
342+
// Delete dead code and drop the bodies of shared functions.
346343
PM.addExternalFunctionDefinitionsElimination();
347344
PM.addDeadFunctionElimination();
348345

349-
// Optimize overflow checks:
346+
// Perform the final lowering transformations.
347+
PM.addCodeSinking();
348+
PM.addLICM();
349+
350+
// Optimize overflow checks.
350351
PM.addRedundantOverflowCheckRemoval();
351352
PM.addMergeCondFails();
352353

353354
// Remove dead code.
354355
PM.addDCE();
355-
// Clean-up after DCE.
356356
PM.addSimplifyCFG();
357357
PM.runOneIteration();
358358

0 commit comments

Comments
 (0)