Fix another bug in r71252. This code supports GetElementPtr
authorDan Gohman <gohman@apple.com>
Fri, 8 May 2009 20:58:38 +0000 (20:58 +0000)
committerDan Gohman <gohman@apple.com>
Fri, 8 May 2009 20:58:38 +0000 (20:58 +0000)
constant exprs as well as instructions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71262 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Analysis/ScalarEvolution.h
lib/Analysis/ScalarEvolution.cpp

index c9a80b74a2d182056e3a366bc1c635f9db0526f5..37b1dc0ddd81f0015a18bbb98bd5700a51367f34 100644 (file)
@@ -286,7 +286,7 @@ namespace llvm {
 
     /// createNodeForGEP - Provide the special handling we need to analyze GEP
     /// SCEVs.
-    SCEVHandle createNodeForGEP(GetElementPtrInst *GEP);
+    SCEVHandle createNodeForGEP(User *GEP);
 
     /// ReplaceSymbolicValueWithConcrete - This looks up the computed SCEV value
     /// for the specified instruction and replaces any references to the
index 4ddde5db5ed108af6623e7fa8388fef5b6387fc8..90c4f5758fe4e24ca44fb9d2bd3e6b9dd612daf7 100644 (file)
@@ -1866,7 +1866,7 @@ SCEVHandle ScalarEvolution::createNodeForPHI(PHINode *PN) {
 /// createNodeForGEP - Expand GEP instructions into add and multiply
 /// operations. This allows them to be analyzed by regular SCEV code.
 ///
-SCEVHandle ScalarEvolution::createNodeForGEP(GetElementPtrInst *GEP) {
+SCEVHandle ScalarEvolution::createNodeForGEP(User *GEP) {
 
   const Type *IntPtrTy = TD->getIntPtrType();
   Value *Base = GEP->getOperand(0);
@@ -2113,7 +2113,7 @@ SCEVHandle ScalarEvolution::createSCEV(Value *V) {
 
   case Instruction::GetElementPtr:
     if (!TD) break; // Without TD we can't analyze pointers.
-    return createNodeForGEP(cast<GetElementPtrInst>(U));
+    return createNodeForGEP(U);
 
   case Instruction::PHI:
     return createNodeForPHI(cast<PHINode>(U));