forked from OSchip/llvm-project
Fix another bug in r71252. This code supports GetElementPtr
constant exprs as well as instructions. llvm-svn: 71262
This commit is contained in:
parent
4861346c44
commit
c05bb947c4
|
@ -286,7 +286,7 @@ namespace llvm {
|
||||||
|
|
||||||
/// createNodeForGEP - Provide the special handling we need to analyze GEP
|
/// createNodeForGEP - Provide the special handling we need to analyze GEP
|
||||||
/// SCEVs.
|
/// SCEVs.
|
||||||
SCEVHandle createNodeForGEP(GetElementPtrInst *GEP);
|
SCEVHandle createNodeForGEP(User *GEP);
|
||||||
|
|
||||||
/// ReplaceSymbolicValueWithConcrete - This looks up the computed SCEV value
|
/// ReplaceSymbolicValueWithConcrete - This looks up the computed SCEV value
|
||||||
/// for the specified instruction and replaces any references to the
|
/// for the specified instruction and replaces any references to the
|
||||||
|
|
|
@ -1866,7 +1866,7 @@ SCEVHandle ScalarEvolution::createNodeForPHI(PHINode *PN) {
|
||||||
/// createNodeForGEP - Expand GEP instructions into add and multiply
|
/// createNodeForGEP - Expand GEP instructions into add and multiply
|
||||||
/// operations. This allows them to be analyzed by regular SCEV code.
|
/// 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();
|
const Type *IntPtrTy = TD->getIntPtrType();
|
||||||
Value *Base = GEP->getOperand(0);
|
Value *Base = GEP->getOperand(0);
|
||||||
|
@ -2113,7 +2113,7 @@ SCEVHandle ScalarEvolution::createSCEV(Value *V) {
|
||||||
|
|
||||||
case Instruction::GetElementPtr:
|
case Instruction::GetElementPtr:
|
||||||
if (!TD) break; // Without TD we can't analyze pointers.
|
if (!TD) break; // Without TD we can't analyze pointers.
|
||||||
return createNodeForGEP(cast<GetElementPtrInst>(U));
|
return createNodeForGEP(U);
|
||||||
|
|
||||||
case Instruction::PHI:
|
case Instruction::PHI:
|
||||||
return createNodeForPHI(cast<PHINode>(U));
|
return createNodeForPHI(cast<PHINode>(U));
|
||||||
|
|
Loading…
Reference in New Issue