diff options
author | Dan Gohman <gohman@apple.com> | 2009-07-17 20:47:02 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2009-07-17 20:47:02 +0000 |
commit | ca178908c8dc2303a1fb54a8a93bab0f0b964e11 (patch) | |
tree | 80aa85f4b479a948b080f13679535c4c29b7a145 /lib/Analysis/ScalarEvolution.cpp | |
parent | e2cf37b88c089a71727b3ecd466856f0cd638813 (diff) |
Add a new Operator class, for handling Instructions and ConstantExprs
in a convenient manner, factoring out some common code from
InstructionCombining and ValueTracking. Move the contents of
BinaryOperators.h into Operator.h and use Operator to generalize them
to support ConstantExprs as well as Instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76232 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/ScalarEvolution.cpp')
-rw-r--r-- | lib/Analysis/ScalarEvolution.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/Analysis/ScalarEvolution.cpp b/lib/Analysis/ScalarEvolution.cpp index 1b0b37ba01..6c23f401c5 100644 --- a/lib/Analysis/ScalarEvolution.cpp +++ b/lib/Analysis/ScalarEvolution.cpp @@ -66,6 +66,7 @@ #include "llvm/GlobalVariable.h" #include "llvm/Instructions.h" #include "llvm/LLVMContext.h" +#include "llvm/Operator.h" #include "llvm/Analysis/ConstantFolding.h" #include "llvm/Analysis/Dominators.h" #include "llvm/Analysis/LoopInfo.h" @@ -2430,7 +2431,7 @@ const SCEV *ScalarEvolution::createNodeForPHI(PHINode *PN) { /// createNodeForGEP - Expand GEP instructions into add and multiply /// operations. This allows them to be analyzed by regular SCEV code. /// -const SCEV *ScalarEvolution::createNodeForGEP(User *GEP) { +const SCEV *ScalarEvolution::createNodeForGEP(Operator *GEP) { const Type *IntPtrTy = TD->getIntPtrType(); Value *Base = GEP->getOperand(0); @@ -2779,7 +2780,7 @@ const SCEV *ScalarEvolution::createSCEV(Value *V) { else return getUnknown(V); - User *U = cast<User>(V); + Operator *U = cast<Operator>(V); switch (Opcode) { case Instruction::Add: return getAddExpr(getSCEV(U->getOperand(0)), |