diff options
author | Anton Korobeynikov <asl@math.spbu.ru> | 2007-08-20 21:17:26 +0000 |
---|---|---|
committer | Anton Korobeynikov <asl@math.spbu.ru> | 2007-08-20 21:17:26 +0000 |
commit | 96fea337d27357e9b62abbf3d2d5ce29f1c8e870 (patch) | |
tree | 0bce7b97ccd13e6b5804f7f2b83a749b90319b07 | |
parent | ebc5fea6956273b9df5df71abe9dd3242bc313aa (diff) | |
download | external_llvm-96fea337d27357e9b62abbf3d2d5ce29f1c8e870.zip external_llvm-96fea337d27357e9b62abbf3d2d5ce29f1c8e870.tar.gz external_llvm-96fea337d27357e9b62abbf3d2d5ce29f1c8e870.tar.bz2 |
- 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
-rw-r--r-- | include/llvm/Analysis/ScalarEvolutionExpander.h | 13 | ||||
-rw-r--r-- | lib/Analysis/LoopPass.cpp | 2 | ||||
-rw-r--r-- | lib/Analysis/ScalarEvolutionExpander.cpp | 12 |
3 files changed, 15 insertions, 12 deletions
diff --git a/include/llvm/Analysis/ScalarEvolutionExpander.h b/include/llvm/Analysis/ScalarEvolutionExpander.h index a5cc713..8866de5 100644 --- a/include/llvm/Analysis/ScalarEvolutionExpander.h +++ b/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/lib/Analysis/LoopPass.cpp b/lib/Analysis/LoopPass.cpp index 21c14c6..98e8ee5 100644 --- a/lib/Analysis/LoopPass.cpp +++ b/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/lib/Analysis/ScalarEvolutionExpander.cpp b/lib/Analysis/ScalarEvolutionExpander.cpp index 3e590d6..e65dac7 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; +} + |