aboutsummaryrefslogtreecommitdiffstats
path: root/include/llvm/Analysis/ScalarEvolutionExpander.h
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2010-11-18 00:34:22 +0000
committerDan Gohman <gohman@apple.com>2010-11-18 00:34:22 +0000
commit9c9fcfc719158a46cb2e41b66d7dc1a63cd48d74 (patch)
tree0cb0e06e1130bcdd21c88cffb2b516e27bb31a56 /include/llvm/Analysis/ScalarEvolutionExpander.h
parent18333616cd824bee3abecd607d3aa432b5cf507d (diff)
downloadexternal_llvm-9c9fcfc719158a46cb2e41b66d7dc1a63cd48d74.zip
external_llvm-9c9fcfc719158a46cb2e41b66d7dc1a63cd48d74.tar.gz
external_llvm-9c9fcfc719158a46cb2e41b66d7dc1a63cd48d74.tar.bz2
Introduce memoization for ScalarEvolution dominates and properlyDominates
queries, and SCEVExpander getRelevantLoop queries. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119595 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Analysis/ScalarEvolutionExpander.h')
-rw-r--r--include/llvm/Analysis/ScalarEvolutionExpander.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/llvm/Analysis/ScalarEvolutionExpander.h b/include/llvm/Analysis/ScalarEvolutionExpander.h
index 4b02f82..39d378e 100644
--- a/include/llvm/Analysis/ScalarEvolutionExpander.h
+++ b/include/llvm/Analysis/ScalarEvolutionExpander.h
@@ -35,6 +35,9 @@ namespace llvm {
std::set<AssertingVH<Value> > InsertedValues;
std::set<AssertingVH<Value> > InsertedPostIncValues;
+ /// RelevantLoops - A memoization of the "relevant" loop for a given SCEV.
+ DenseMap<const SCEV *, const Loop *> RelevantLoops;
+
/// PostIncLoops - Addrecs referring to any of the given loops are expanded
/// in post-inc mode. For example, expanding {1,+,1}<L> in post-inc mode
/// returns the add instruction that adds one to the phi for {0,+,1}<L>,
@@ -168,6 +171,9 @@ namespace llvm {
return InsertedValues.count(I) || InsertedPostIncValues.count(I);
}
+ /// getRelevantLoop - Determine the most "relevant" loop for the given SCEV.
+ const Loop *getRelevantLoop(const SCEV *);
+
Value *visitConstant(const SCEVConstant *S) {
return S->getValue();
}