mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-09-27 16:17:17 +00:00
Add loop info verification mechanism.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37822 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -114,6 +114,11 @@ public:
|
|||||||
// queue. This allows LoopPass to change loop nest for the loop. This
|
// queue. This allows LoopPass to change loop nest for the loop. This
|
||||||
// utility may send LPPassManager into infinite loops so use caution.
|
// utility may send LPPassManager into infinite loops so use caution.
|
||||||
void redoLoop(Loop *L);
|
void redoLoop(Loop *L);
|
||||||
|
|
||||||
|
private:
|
||||||
|
/// verifyLoopInfo - Verify loop nest.
|
||||||
|
void verifyLoopInfo();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::deque<Loop *> LQ;
|
std::deque<Loop *> LQ;
|
||||||
bool skipThisLoop;
|
bool skipThisLoop;
|
||||||
|
@@ -157,6 +157,18 @@ void LPPassManager::getAnalysisUsage(AnalysisUsage &Info) const {
|
|||||||
Info.setPreservesAll();
|
Info.setPreservesAll();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// verifyLoopInfo - Verify loop nest.
|
||||||
|
void LPPassManager::verifyLoopInfo() {
|
||||||
|
assert (LI && "Loop Info is missing");
|
||||||
|
|
||||||
|
for (LoopInfo::iterator I = LI->begin(), E = LI->end(); I != E; ++I) {
|
||||||
|
Loop *L = *I;
|
||||||
|
assert (L->getHeader() && "Loop header is missing");
|
||||||
|
assert (L->getLoopPreheader() && "Loop preheader is missing");
|
||||||
|
assert (L->getLoopLatch() && "Loop latch is missing");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// run - Execute all of the passes scheduled for execution. Keep track of
|
/// run - Execute all of the passes scheduled for execution. Keep track of
|
||||||
/// whether any of the passes modifies the function, and if so, return true.
|
/// whether any of the passes modifies the function, and if so, return true.
|
||||||
bool LPPassManager::runOnFunction(Function &F) {
|
bool LPPassManager::runOnFunction(Function &F) {
|
||||||
@@ -202,6 +214,7 @@ bool LPPassManager::runOnFunction(Function &F) {
|
|||||||
LoopPass *LP = dynamic_cast<LoopPass *>(P);
|
LoopPass *LP = dynamic_cast<LoopPass *>(P);
|
||||||
assert (LP && "Invalid LPPassManager member");
|
assert (LP && "Invalid LPPassManager member");
|
||||||
LP->runOnLoop(CurrentLoop, *this);
|
LP->runOnLoop(CurrentLoop, *this);
|
||||||
|
verifyLoopInfo();
|
||||||
StopPassTimer(P);
|
StopPassTimer(P);
|
||||||
|
|
||||||
if (Changed)
|
if (Changed)
|
||||||
@@ -302,4 +315,3 @@ void LoopPass::assignPassManager(PMStack &PMS,
|
|||||||
|
|
||||||
LPPM->add(this);
|
LPPM->add(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user