Skip to content

Commit 860cc27

Browse files
authored
Merge pull request #60870 from meg-gupta/omelower
Move OwnershipLowering to just before SimplifyCFG
2 parents 15e17b2 + bd295d7 commit 860cc27

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

lib/SILOptimizer/PassManager/PassPipeline.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -396,6 +396,15 @@ void addFunctionPasses(SILPassPipelinePlan &P,
396396
P.addSROA();
397397
}
398398

399+
// Promote stack allocations to values.
400+
P.addMem2Reg();
401+
402+
// Run the existential specializer Pass.
403+
P.addExistentialSpecializer();
404+
405+
// Cleanup, which is important if the inliner has restarted the pass pipeline.
406+
P.addPerformanceConstantPropagation();
407+
399408
if (!P.getOptions().EnableOSSAModules && !SILDisableLateOMEByDefault) {
400409
if (P.getOptions().StopOptimizationBeforeLoweringOwnership)
401410
return;
@@ -406,15 +415,6 @@ void addFunctionPasses(SILPassPipelinePlan &P,
406415
P.addNonTransparentFunctionOwnershipModelEliminator();
407416
}
408417

409-
// Promote stack allocations to values.
410-
P.addMem2Reg();
411-
412-
// Run the existential specializer Pass.
413-
P.addExistentialSpecializer();
414-
415-
// Cleanup, which is important if the inliner has restarted the pass pipeline.
416-
P.addPerformanceConstantPropagation();
417-
418418
addSimplifyCFGSILCombinePasses(P);
419419

420420
P.addArrayElementPropagation();

0 commit comments

Comments
 (0)