aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Analysis
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Analysis')
-rw-r--r--lib/Analysis/LoopPass.cpp3
-rw-r--r--lib/Analysis/ScalarEvolution.cpp16
2 files changed, 16 insertions, 3 deletions
diff --git a/lib/Analysis/LoopPass.cpp b/lib/Analysis/LoopPass.cpp
index da9ac27..c45c2ef 100644
--- a/lib/Analysis/LoopPass.cpp
+++ b/lib/Analysis/LoopPass.cpp
@@ -14,7 +14,6 @@
//===----------------------------------------------------------------------===//
#include "llvm/Analysis/LoopPass.h"
-#include "llvm/Analysis/ScalarEvolution.h"
using namespace llvm;
//===----------------------------------------------------------------------===//
@@ -173,8 +172,6 @@ void LPPassManager::getAnalysisUsage(AnalysisUsage &Info) const {
// LPPassManager needs LoopInfo. In the long term LoopInfo class will
// become part of LPPassManager.
Info.addRequired<LoopInfo>();
- // Used by IndVar doInitialization.
- Info.addRequired<ScalarEvolution>();
Info.setPreservesAll();
}
diff --git a/lib/Analysis/ScalarEvolution.cpp b/lib/Analysis/ScalarEvolution.cpp
index 4e0dba7..54f27653 100644
--- a/lib/Analysis/ScalarEvolution.cpp
+++ b/lib/Analysis/ScalarEvolution.cpp
@@ -1453,6 +1453,11 @@ namespace {
/// an analyzable loop-invariant iteration count.
bool hasLoopInvariantIterationCount(const Loop *L);
+ /// forgetLoopIterationCount - This method should be called by the
+ /// client when it has changed a loop in a way that may effect
+ /// ScalarEvolution's ability to compute a trip count.
+ void forgetLoopIterationCount(const Loop *L);
+
/// getIterationCount - If the specified loop has a predictable iteration
/// count, return it. Note that it is not valid to call this method on a
/// loop without a loop-invariant iteration count.
@@ -1931,6 +1936,13 @@ SCEVHandle ScalarEvolutionsImpl::getIterationCount(const Loop *L) {
return I->second;
}
+/// forgetLoopIterationCount - This method should be called by the
+/// client when it has changed a loop in a way that may effect
+/// ScalarEvolution's ability to compute a trip count.
+void ScalarEvolutionsImpl::forgetLoopIterationCount(const Loop *L) {
+ IterationCounts.erase(L);
+}
+
/// ComputeIterationCount - Compute the number of times the specified loop
/// will iterate.
SCEVHandle ScalarEvolutionsImpl::ComputeIterationCount(const Loop *L) {
@@ -3091,6 +3103,10 @@ bool ScalarEvolution::hasLoopInvariantIterationCount(const Loop *L) const {
return !isa<SCEVCouldNotCompute>(getIterationCount(L));
}
+void ScalarEvolution::forgetLoopIterationCount(const Loop *L) {
+ return ((ScalarEvolutionsImpl*)Impl)->forgetLoopIterationCount(L);
+}
+
SCEVHandle ScalarEvolution::getSCEVAtScope(Value *V, const Loop *L) const {
return ((ScalarEvolutionsImpl*)Impl)->getSCEVAtScope(getSCEV(V), L);
}