Give ScalarEvolution access to the DominatorTree. It'll need this

to make more intellegent AddRec folding decisions.

llvm-svn: 93930
This commit is contained in:
Dan Gohman 2010-01-19 22:21:27 +00:00
parent eaef5e111d
commit f86d904b7d
2 changed files with 6 additions and 0 deletions

View File

@ -181,6 +181,10 @@ namespace llvm {
/// ///
TargetData *TD; TargetData *TD;
/// DT - The dominator tree.
///
DominatorTree *DT;
/// CouldNotCompute - This SCEV is used to represent unknown trip /// CouldNotCompute - This SCEV is used to represent unknown trip
/// counts and things. /// counts and things.
SCEVCouldNotCompute CouldNotCompute; SCEVCouldNotCompute CouldNotCompute;

View File

@ -5167,6 +5167,7 @@ ScalarEvolution::ScalarEvolution()
bool ScalarEvolution::runOnFunction(Function &F) { bool ScalarEvolution::runOnFunction(Function &F) {
this->F = &F; this->F = &F;
LI = &getAnalysis<LoopInfo>(); LI = &getAnalysis<LoopInfo>();
DT = &getAnalysis<DominatorTree>();
TD = getAnalysisIfAvailable<TargetData>(); TD = getAnalysisIfAvailable<TargetData>();
return false; return false;
} }
@ -5183,6 +5184,7 @@ void ScalarEvolution::releaseMemory() {
void ScalarEvolution::getAnalysisUsage(AnalysisUsage &AU) const { void ScalarEvolution::getAnalysisUsage(AnalysisUsage &AU) const {
AU.setPreservesAll(); AU.setPreservesAll();
AU.addRequiredTransitive<LoopInfo>(); AU.addRequiredTransitive<LoopInfo>();
AU.addRequiredTransitive<DominatorTree>();
} }
bool ScalarEvolution::hasLoopInvariantBackedgeTakenCount(const Loop *L) { bool ScalarEvolution::hasLoopInvariantBackedgeTakenCount(const Loop *L) {