mirror of
https://github.com/RPCSX/llvm.git
synced 2025-02-10 22:43:46 +00:00
Add LPPassManager interface that LoopPass can use to skip
rest of the passes in the queue for a loop. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34508 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
7d35c0e2b9
commit
5afdc7d785
@ -81,8 +81,13 @@ public:
|
|||||||
return PMT_LoopPassManager;
|
return PMT_LoopPassManager;
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
public:
|
||||||
|
// Delete loop from the loop queue. This is used by Loop pass to inform
|
||||||
|
// Loop Pass Manager that it should skip rest of the passes for this loop.
|
||||||
|
void deleteLoopFromQueue(Loop *L);
|
||||||
|
private:
|
||||||
LoopQueue *LQ;
|
LoopQueue *LQ;
|
||||||
|
bool skipThisLoop;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -57,6 +57,13 @@ LPPassManager::~LPPassManager() {
|
|||||||
delete LQ;
|
delete LQ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Delete loop from the loop queue. This is used by Loop pass to inform
|
||||||
|
/// Loop Pass Manager that it should skip rest of the passes for this loop.
|
||||||
|
void LPPassManager::deleteLoopFromQueue(Loop *L) {
|
||||||
|
// Do not pop loop from LQ here. It will be done by runOnFunction while loop.
|
||||||
|
skipThisLoop = true;
|
||||||
|
}
|
||||||
|
|
||||||
// Recurse through all subloops and all loops into LQ.
|
// Recurse through all subloops and all loops into LQ.
|
||||||
static void addLoopIntoQueue(Loop *L, LoopQueue *LQ) {
|
static void addLoopIntoQueue(Loop *L, LoopQueue *LQ) {
|
||||||
for (Loop::iterator I = L->begin(), E = L->end(); I != E; ++I)
|
for (Loop::iterator I = L->begin(), E = L->end(); I != E; ++I)
|
||||||
@ -81,6 +88,8 @@ bool LPPassManager::runOnFunction(Function &F) {
|
|||||||
while (!LQ->empty()) {
|
while (!LQ->empty()) {
|
||||||
|
|
||||||
Loop *L = LQ->top();
|
Loop *L = LQ->top();
|
||||||
|
skipThisLoop = false;
|
||||||
|
|
||||||
// Run all passes on current SCC
|
// Run all passes on current SCC
|
||||||
for (unsigned Index = 0; Index < getNumContainedPasses(); ++Index) {
|
for (unsigned Index = 0; Index < getNumContainedPasses(); ++Index) {
|
||||||
|
|
||||||
@ -107,6 +116,10 @@ bool LPPassManager::runOnFunction(Function &F) {
|
|||||||
removeNotPreservedAnalysis(P);
|
removeNotPreservedAnalysis(P);
|
||||||
recordAvailableAnalysis(P);
|
recordAvailableAnalysis(P);
|
||||||
removeDeadPasses(P, Msg2);
|
removeDeadPasses(P, Msg2);
|
||||||
|
|
||||||
|
if (skipThisLoop)
|
||||||
|
// Do not run other passes on this loop.
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Pop the loop from queue after running all passes.
|
// Pop the loop from queue after running all passes.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user