mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-14 16:33:28 +00:00
Preserve dom info.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53089 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
70c09c54b1
commit
98260a474c
@ -55,6 +55,12 @@ namespace {
|
|||||||
AU.addRequired<LoopInfo>();
|
AU.addRequired<LoopInfo>();
|
||||||
AU.addPreservedID(LCSSAID);
|
AU.addPreservedID(LCSSAID);
|
||||||
AU.addPreserved<LoopInfo>();
|
AU.addPreserved<LoopInfo>();
|
||||||
|
// FIXME: Loop unroll requires LCSSA. And LCSSA requires dom info.
|
||||||
|
// If loop unroll does not preserve dom info then LCSSA pass on next
|
||||||
|
// loop will receive invalid dom info.
|
||||||
|
// For now, recreate dom info, if loop is unrolled.
|
||||||
|
AU.addPreserved<DominatorTree>();
|
||||||
|
AU.addPreserved<DominanceFrontier>();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
@ -137,8 +143,17 @@ bool LoopUnroll::runOnLoop(Loop *L, LPPassManager &LPM) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Unroll the loop.
|
// Unroll the loop.
|
||||||
|
Function *F = L->getHeader()->getParent();
|
||||||
if (!UnrollLoop(L, Count, LI, &LPM))
|
if (!UnrollLoop(L, Count, LI, &LPM))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
// FIXME: Reconstruct dom info, because it is not preserved properly.
|
||||||
|
DominatorTree *DT = getAnalysisToUpdate<DominatorTree>();
|
||||||
|
if (DT) {
|
||||||
|
DT->runOnFunction(*F);
|
||||||
|
DominanceFrontier *DF = getAnalysisToUpdate<DominanceFrontier>();
|
||||||
|
if (DF)
|
||||||
|
DF->runOnFunction(*F);
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user