SILPassManager: A new method to reduce the number of SIL pass runs.

It avoids that a pass runs a second time if didn't make any changes in the previous run and no other pass changed the function in between.
rdar://problem/20336764

In this change I also removed the CompleteFunctions analysis which is now obsolete.

Some measurements with swiftbench (-wmo, single threaded):
It reduces the number of pass runs by about 28%. Because only passes are skipped that don't do anything, the effect on compile time is not so dramatic.
The time spent in runSILOptimizationPasses is reduced by ~9% which gives a total compile time reduction of about 3%.




Swift SVN r26757
This commit is contained in:
Erik Eckstein
2015-03-31 14:19:51 +00:00
parent f520ef894a
commit 160b8e07db
4 changed files with 41 additions and 75 deletions

View File

@@ -27,20 +27,6 @@
using namespace swift;
// anchor for virtual D'tor
CompleteFunctions::~CompleteFunctions() {}
void CompleteFunctions::setComplete() {
CompleteFuncs.clear();
if (!IsModulePending)
for (auto &F : *M)
if (!PendingFuncs.count(&F))
CompleteFuncs.insert(&F);
PendingFuncs.clear();
IsModulePending = false;
}
SILAnalysis *swift::createCallGraphAnalysis(SILModule *M) {
return new CallGraphAnalysis(M);
}