[sil-pass-manger] Do not use an LLVM statistic as the counter when deciding that we have iterated too many times. They are compiled out with a release compiler.

Swift SVN r18576
This commit is contained in:
Michael Gottesman
2014-05-22 23:16:05 +00:00
parent 3f8f691ca6
commit 70274f31bc
2 changed files with 7 additions and 5 deletions

View File

@@ -62,6 +62,7 @@ runFunctionPasses(llvm::ArrayRef<SILFunctionTransform*> FuncTransforms) {
void SILPassManager::runOneIteration() {
DEBUG(llvm::dbgs() << "*** Optimizing the module *** \n");
NumOptzIterations++;
NumOptimizationIterations++;
CompleteFunctions *CompleteFuncs = getAnalysis<CompleteFunctions>();
SmallVector<SILFunctionTransform*, 16> PendingFuncTransforms;
@@ -96,7 +97,7 @@ void SILPassManager::runOneIteration() {
if (CompleteFuncs->hasChanged()) {
if (Options.PrintAll) {
llvm::dbgs() << "*** SIL module after " << SMT->getName()
<< " (" << NumOptzIterations << ") ***\n";
<< " (" << NumOptimizationIterations << ") ***\n";
Mod->dump();
}
if (Options.VerifyAll) {
@@ -123,7 +124,7 @@ void SILPassManager::runOneIteration() {
void SILPassManager::run() {
if (Options.PrintAll) {
llvm::dbgs() << "*** SIL module before transformation ("
<< NumOptzIterations << ") ***\n";
<< NumOptimizationIterations << ") ***\n";
Mod->dump();
}
// Keep optimizing the module until no pass requested another iteration
@@ -131,10 +132,8 @@ void SILPassManager::run() {
const unsigned IterationLimit = 20;
do {
anotherIteration = false;
runOneIteration();
} while (anotherIteration && NumOptzIterations < IterationLimit);
} while (anotherIteration && NumOptimizationIterations < IterationLimit);
}
/// D'tor.