summaryrefslogtreecommitdiffstats
path: root/llvm
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
commit5849a625ff1e9234151eea4191594cc3c645843e (patch)
tree6fc336e9ed6fd061abac59df3a70dfd585139c6b /llvm
parent49c4f9a889852d6e231469cb781875a507d9bac9 (diff)
downloadbcm5719-llvm-5849a625ff1e9234151eea4191594cc3c645843e.tar.gz
bcm5719-llvm-5849a625ff1e9234151eea4191594cc3c645843e.zip
- Use correct header for SCEV inside LoopPass.cpp
- Move SCEVExpander::expand() out-of-line workarounding possible toolchain bug llvm-svn: 41197
Diffstat (limited to 'llvm')
-rw-r--r--llvm/include/llvm/Analysis/ScalarEvolutionExpander.h13
-rw-r--r--llvm/lib/Analysis/LoopPass.cpp2
-rw-r--r--llvm/lib/Analysis/ScalarEvolutionExpander.cpp12
3 files changed, 15 insertions, 12 deletions
diff --git a/llvm/include/llvm/Analysis/ScalarEvolutionExpander.h b/llvm/include/llvm/Analysis/ScalarEvolutionExpander.h
index a5cc7138cac..8866de54dfd 100644
--- a/llvm/include/llvm/Analysis/ScalarEvolutionExpander.h
+++ b/llvm/include/llvm/Analysis/ScalarEvolutionExpander.h
@@ -93,17 +93,8 @@ namespace llvm {
static Value *InsertBinop(Instruction::BinaryOps Opcode, Value *LHS,
Value *RHS, Instruction *&InsertPt);
protected:
- Value *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;
- }
-
+ Value *expand(SCEV *S);
+
Value *visitConstant(SCEVConstant *S) {
return S->getValue();
}
diff --git a/llvm/lib/Analysis/LoopPass.cpp b/llvm/lib/Analysis/LoopPass.cpp
index 21c14c6293e..98e8ee55d38 100644
--- a/llvm/lib/Analysis/LoopPass.cpp
+++ b/llvm/lib/Analysis/LoopPass.cpp
@@ -14,7 +14,7 @@
//===----------------------------------------------------------------------===//
#include "llvm/Analysis/LoopPass.h"
-#include "llvm/Analysis/ScalarEvolutionExpander.h"
+#include "llvm/Analysis/ScalarEvolution.h"
using namespace llvm;
//===----------------------------------------------------------------------===//
diff --git a/llvm/lib/Analysis/ScalarEvolutionExpander.cpp b/llvm/lib/Analysis/ScalarEvolutionExpander.cpp
index 3e590d68f55..e65dac71fcf 100644
--- a/llvm/lib/Analysis/ScalarEvolutionExpander.cpp
+++ b/llvm/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;
+}
+
OpenPOWER on IntegriCloud