diff options
author | Dan Gohman <gohman@apple.com> | 2010-01-19 22:21:27 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2010-01-19 22:21:27 +0000 |
commit | 1cd9275c8d612bd1c92fc7ba436b60aaead1efbf (patch) | |
tree | 92f72cd88c47f5f105d71f10ed1e1b9cfd2471d1 | |
parent | 09ce674ce81cfa0de096f19833ae7bc7549d851a (diff) |
Give ScalarEvolution access to the DominatorTree. It'll need this
to make more intellegent AddRec folding decisions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93930 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | include/llvm/Analysis/ScalarEvolution.h | 4 | ||||
-rw-r--r-- | lib/Analysis/ScalarEvolution.cpp | 2 |
2 files changed, 6 insertions, 0 deletions
diff --git a/include/llvm/Analysis/ScalarEvolution.h b/include/llvm/Analysis/ScalarEvolution.h index 6f57c741fe..9072a8f050 100644 --- a/include/llvm/Analysis/ScalarEvolution.h +++ b/include/llvm/Analysis/ScalarEvolution.h @@ -181,6 +181,10 @@ namespace llvm { /// TargetData *TD; + /// DT - The dominator tree. + /// + DominatorTree *DT; + /// CouldNotCompute - This SCEV is used to represent unknown trip /// counts and things. SCEVCouldNotCompute CouldNotCompute; diff --git a/lib/Analysis/ScalarEvolution.cpp b/lib/Analysis/ScalarEvolution.cpp index 4d85ce43d2..a06321cecf 100644 --- a/lib/Analysis/ScalarEvolution.cpp +++ b/lib/Analysis/ScalarEvolution.cpp @@ -5167,6 +5167,7 @@ ScalarEvolution::ScalarEvolution() bool ScalarEvolution::runOnFunction(Function &F) { this->F = &F; LI = &getAnalysis<LoopInfo>(); + DT = &getAnalysis<DominatorTree>(); TD = getAnalysisIfAvailable<TargetData>(); return false; } @@ -5183,6 +5184,7 @@ void ScalarEvolution::releaseMemory() { void ScalarEvolution::getAnalysisUsage(AnalysisUsage &AU) const { AU.setPreservesAll(); AU.addRequiredTransitive<LoopInfo>(); + AU.addRequiredTransitive<DominatorTree>(); } bool ScalarEvolution::hasLoopInvariantBackedgeTakenCount(const Loop *L) { |