mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
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:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user