Skip to content

Run more function passes in a single run of the pass manager. #1627

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 11, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 5 additions & 7 deletions lib/SILOptimizer/PassManager/Passes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -239,8 +239,6 @@ void AddSSAPasses(SILPassManager &PM, OptimizationLevelKind OpLevel) {
PM.addEarlyCodeMotion();
PM.addARCSequenceOpts();

PM.addSILLinker();

PM.addSimplifyCFG();
// Only hoist releases very late.
if (OpLevel == OptimizationLevelKind::LowLevel)
Expand All @@ -264,7 +262,7 @@ void swift::runSILOptimizationPasses(SILModule &Module) {
return;
}

SILPassManager PM(&Module, "PreSpecialize");
SILPassManager PM(&Module, "EarlyModulePasses");

// Get rid of apparently dead functions as soon as possible so that
// we do not spend time optimizing them.
Expand All @@ -275,15 +273,15 @@ void swift::runSILOptimizationPasses(SILModule &Module) {
PM.resetAndRemoveTransformations();

// Run an iteration of the high-level SSA passes.
PM.setStageName("HighLevel");
PM.setStageName("HighLevel+EarlyLoopOpt");
AddSSAPasses(PM, OptimizationLevelKind::HighLevel);
AddHighLevelLoopOptPasses(PM);
PM.runOneIteration();
PM.resetAndRemoveTransformations();

PM.setStageName("EarlyLoopOpt");
AddHighLevelLoopOptPasses(PM);

PM.setStageName("MidModulePasses+StackPromote");
PM.addDeadFunctionElimination();
PM.addSILLinker();
PM.addDeadObjectElimination();
PM.addGlobalPropertyOpt();

Expand Down