// the top level if \c ParentLoop is null.
Loop &addLoop(Loop *ParentLoop);
- // Reoptimize this loop. LPPassManager will re-insert this loop into the
- // queue. This allows LoopPass to change loop nest for the loop. This
- // utility may send LPPassManager into infinite loops so use caution.
- void redoLoop(Loop *L);
-
//===--------------------------------------------------------------------===//
/// SimpleAnalysis - Provides simple interface to update analysis info
/// maintained by various passes. Note, if required this interface can
private:
std::deque<Loop *> LQ;
bool skipThisLoop;
- bool redoThisLoop;
LoopInfo *LI;
Loop *CurrentLoop;
};
LPPassManager::LPPassManager()
: FunctionPass(ID), PMDataManager() {
skipThisLoop = false;
- redoThisLoop = false;
LI = nullptr;
CurrentLoop = nullptr;
}
return *L;
}
-// Reoptimize this loop. LPPassManager will re-insert this loop into the
-// queue. This allows LoopPass to change loop nest for the loop. This
-// utility may send LPPassManager into infinite loops so use caution.
-void LPPassManager::redoLoop(Loop *L) {
- assert (CurrentLoop == L && "Can redo only CurrentLoop");
- redoThisLoop = true;
-}
-
/// cloneBasicBlockSimpleAnalysis - Invoke cloneBasicBlockAnalysis hook for
/// all loop passes.
void LPPassManager::cloneBasicBlockSimpleAnalysis(BasicBlock *From,
CurrentLoop = LQ.back();
skipThisLoop = false;
- redoThisLoop = false;
// Run all passes on the current Loop.
for (unsigned Index = 0; Index < getNumContainedPasses(); ++Index) {
// Pop the loop from queue after running all passes.
LQ.pop_back();
-
- if (redoThisLoop)
- LQ.push_back(CurrentLoop);
}
// Finalization