diff --git a/llvm/include/llvm/Analysis/RegionPass.h b/llvm/include/llvm/Analysis/RegionPass.h --- a/llvm/include/llvm/Analysis/RegionPass.h +++ b/llvm/include/llvm/Analysis/RegionPass.h @@ -85,8 +85,6 @@ /// The pass manager to schedule RegionPasses. class RGPassManager : public FunctionPass, public PMDataManager { std::deque RQ; - bool skipThisRegion; - bool redoThisRegion; RegionInfo *RI; Region *CurrentRegion; diff --git a/llvm/lib/Analysis/RegionPass.cpp b/llvm/lib/Analysis/RegionPass.cpp --- a/llvm/lib/Analysis/RegionPass.cpp +++ b/llvm/lib/Analysis/RegionPass.cpp @@ -31,8 +31,6 @@ RGPassManager::RGPassManager() : FunctionPass(ID), PMDataManager() { - skipThisRegion = false; - redoThisRegion = false; RI = nullptr; CurrentRegion = nullptr; } @@ -76,8 +74,6 @@ while (!RQ.empty()) { CurrentRegion = RQ.back(); - skipThisRegion = false; - redoThisRegion = false; // Run all passes on the current Region. for (unsigned Index = 0; Index < getNumContainedPasses(); ++Index) { @@ -115,54 +111,36 @@ if (isPassDebuggingExecutionsOrMore()) { if (LocalChanged) dumpPassInfo(P, MODIFICATION_MSG, ON_REGION_MSG, - skipThisRegion ? "" : CurrentRegion->getNameStr()); dumpPreservedSet(P); } - if (!skipThisRegion) { - // Manually check that this region is still healthy. This is done - // instead of relying on RegionInfo::verifyRegion since RegionInfo - // is a function pass and it's really expensive to verify every - // Region in the function every time. That level of checking can be - // enabled with the -verify-region-info option. - { - TimeRegion PassTimer(getPassTimer(P)); - CurrentRegion->verifyRegion(); - } - - // Then call the regular verifyAnalysis functions. - verifyPreservedAnalysis(P); + // Manually check that this region is still healthy. This is done + // instead of relying on RegionInfo::verifyRegion since RegionInfo + // is a function pass and it's really expensive to verify every + // Region in the function every time. That level of checking can be + // enabled with the -verify-region-info option. + { + TimeRegion PassTimer(getPassTimer(P)); + CurrentRegion->verifyRegion(); } + // Then call the regular verifyAnalysis functions. + verifyPreservedAnalysis(P); + if (LocalChanged) removeNotPreservedAnalysis(P); recordAvailableAnalysis(P); removeDeadPasses(P, - (!isPassDebuggingExecutionsOrMore() || skipThisRegion) ? - "" : CurrentRegion->getNameStr(), + (!isPassDebuggingExecutionsOrMore()) + ? "" + : CurrentRegion->getNameStr(), ON_REGION_MSG); - - if (skipThisRegion) - // Do not run other passes on this region. - break; } - // If the region was deleted, release all the region passes. This frees up - // some memory, and avoids trouble with the pass manager trying to call - // verifyAnalysis on them. - if (skipThisRegion) - for (unsigned Index = 0; Index < getNumContainedPasses(); ++Index) { - Pass *P = getContainedPass(Index); - freePass(P, "", ON_REGION_MSG); - } - // Pop the region from queue after running all passes. RQ.pop_back(); - if (redoThisRegion) - RQ.push_back(CurrentRegion); - // Free all region nodes created in region passes. RI->clearNodeCache(); }