aboutsummaryrefslogtreecommitdiff
path: root/lib/Analysis/ScalarEvolutionExpander.cpp
diff options
context:
space:
mode:
authorAnton Korobeynikov <asl@math.spbu.ru>2007-08-20 21:17:26 +0000
committerAnton Korobeynikov <asl@math.spbu.ru>2007-08-20 21:17:26 +0000
commit96fea337d27357e9b62abbf3d2d5ce29f1c8e870 (patch)
tree0bce7b97ccd13e6b5804f7f2b83a749b90319b07 /lib/Analysis/ScalarEvolutionExpander.cpp
parentebc5fea6956273b9df5df71abe9dd3242bc313aa (diff)
- Use correct header for SCEV inside LoopPass.cpp
- Move SCEVExpander::expand() out-of-line workarounding possible toolchain bug git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41197 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/ScalarEvolutionExpander.cpp')
-rw-r--r--lib/Analysis/ScalarEvolutionExpander.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/Analysis/ScalarEvolutionExpander.cpp b/lib/Analysis/ScalarEvolutionExpander.cpp
index 3e590d68f5..e65dac71fc 100644
--- a/lib/Analysis/ScalarEvolutionExpander.cpp
+++ b/lib/Analysis/ScalarEvolutionExpander.cpp
@@ -207,3 +207,15 @@ Value *SCEVExpander::visitAddRecExpr(SCEVAddRecExpr *S) {
return expand(V);
}
+
+Value *SCEVExpander::expand(SCEV *S) {
+ // Check to see if we already expanded this.
+ std::map<SCEVHandle, Value*>::iterator I = InsertedExpressions.find(S);
+ if (I != InsertedExpressions.end())
+ return I->second;
+
+ Value *V = visit(S);
+ InsertedExpressions[S] = V;
+ return V;
+}
+