summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorDan Gohman <gohman@apple.com>2009-05-08 20:58:38 +0000
committerDan Gohman <gohman@apple.com>2009-05-08 20:58:38 +0000
commitc05bb947c430a45cb92f084b8c1f0b14cdc38df5 (patch)
treeaa28ba569fbe0c497918df0235bc4cd33694ccde /llvm/lib
parent4861346c441b48c11ba1d094c20caad11ed74da6 (diff)
downloadbcm5719-llvm-c05bb947c430a45cb92f084b8c1f0b14cdc38df5.tar.gz
bcm5719-llvm-c05bb947c430a45cb92f084b8c1f0b14cdc38df5.zip
Fix another bug in r71252. This code supports GetElementPtr
constant exprs as well as instructions. llvm-svn: 71262
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Analysis/ScalarEvolution.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Analysis/ScalarEvolution.cpp b/llvm/lib/Analysis/ScalarEvolution.cpp
index 4ddde5db5ed..90c4f5758fe 100644
--- a/llvm/lib/Analysis/ScalarEvolution.cpp
+++ b/llvm/lib/Analysis/ScalarEvolution.cpp
@@ -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));
OpenPOWER on IntegriCloud