forked from OSchip/llvm-project
Create ConstantExpr GEPs the correct way. This fixes
MultiSource/Benchmarks/Prolangs-C/football and a variety of other failures. llvm-svn: 72120
This commit is contained in:
parent
71b6a37bc4
commit
7a97e933cd
|
@ -246,7 +246,7 @@ Value *SCEVExpander::expandAddToGEP(const SCEVAddExpr *S,
|
|||
// Fold a GEP with constant operands.
|
||||
if (Constant *CLHS = dyn_cast<Constant>(V))
|
||||
if (Constant *CRHS = dyn_cast<Constant>(Idx))
|
||||
return ConstantExpr::get(Instruction::GetElementPtr, CLHS, CRHS);
|
||||
return ConstantExpr::getGetElementPtr(CLHS, &CRHS, 1);
|
||||
|
||||
// Do a quick scan to see if we have this GEP nearby. If so, reuse it.
|
||||
unsigned ScanLimit = 6;
|
||||
|
|
Loading…
Reference in New Issue