Skip to content

Commit 4d03eb4

Browse files
committed
SILOptimizer: Move the StringOptimization a bit earlier in the pipeline.
Needed to make sure that global initializers are not optimized in mid-level SIL while other functions are still in high-level SIL. Having the StringOptimization not in high-level SIL was just a mistake in my earlier PR.
1 parent 2a03543 commit 4d03eb4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/SILOptimizer/PassManager/PassPipeline.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -493,6 +493,8 @@ static void addHighLevelFunctionPipeline(SILPassPipelinePlan &P) {
493493
addFunctionPasses(P, OptimizationLevelKind::HighLevel);
494494

495495
addHighLevelLoopOptPasses(P);
496+
497+
P.addStringOptimization();
496498
}
497499

498500
// After "high-level" function passes have processed the entire call tree, run
@@ -529,8 +531,6 @@ static void addSerializePipeline(SILPassPipelinePlan &P) {
529531
static void addMidLevelFunctionPipeline(SILPassPipelinePlan &P) {
530532
P.startPipeline("MidLevel,Function", true /*isFunctionPassPipeline*/);
531533

532-
P.addStringOptimization();
533-
534534
addFunctionPasses(P, OptimizationLevelKind::MidLevel);
535535

536536
// Specialize partially applied functions with dead arguments as a preparation

0 commit comments

Comments
 (0)