Skip to content

Commit 11211de

Browse files
authored
Merge pull request #11303 from swiftix/optimizer-improvements2
Modify the optimization pipeline to better support custom array iterators
2 parents f0c7b64 + c042058 commit 11211de

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

lib/SILOptimizer/PassManager/PassPipeline.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,10 +269,11 @@ void addSSAPasses(SILPassPipelinePlan &P, OptimizationLevelKind OpLevel) {
269269
P.addCSE();
270270
P.addRedundantLoadElimination();
271271

272-
// Perform retain/release code motion and run the first ARC optimizer.
272+
P.addPerformanceConstantPropagation();
273273
P.addCSE();
274274
P.addDCE();
275275

276+
// Perform retain/release code motion and run the first ARC optimizer.
276277
P.addEarlyCodeMotion();
277278
P.addReleaseHoisting();
278279
P.addARCSequenceOpts();
@@ -333,6 +334,10 @@ static void addMidLevelPassPipeline(SILPassPipelinePlan &P) {
333334
// Specialize partially applied functions with dead arguments as a preparation
334335
// for CapturePropagation.
335336
P.addDeadArgSignatureOpt();
337+
338+
// Run loop unrolling after inlining and constant propagation, because loop
339+
// trip counts may have became constant.
340+
P.addLoopUnroll();
336341
}
337342

338343
static void addClosureSpecializePassPipeline(SILPassPipelinePlan &P) {
@@ -402,6 +407,7 @@ static void addLateLoopOptPassPipeline(SILPassPipelinePlan &P) {
402407

403408
// Remove dead code.
404409
P.addDCE();
410+
P.addSILCombine();
405411
P.addSimplifyCFG();
406412

407413
// Try to hoist all releases, including epilogue releases. This should be

0 commit comments

Comments
 (0)