mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-14 16:33:28 +00:00
Create ConstantExpr GEPs the correct way. This fixes
MultiSource/Benchmarks/Prolangs-C/football and a variety of other failures. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72120 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
86c212e894
commit
278b49af8a
@ -246,7 +246,7 @@ Value *SCEVExpander::expandAddToGEP(const SCEVAddExpr *S,
|
|||||||
// Fold a GEP with constant operands.
|
// Fold a GEP with constant operands.
|
||||||
if (Constant *CLHS = dyn_cast<Constant>(V))
|
if (Constant *CLHS = dyn_cast<Constant>(V))
|
||||||
if (Constant *CRHS = dyn_cast<Constant>(Idx))
|
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.
|
// Do a quick scan to see if we have this GEP nearby. If so, reuse it.
|
||||||
unsigned ScanLimit = 6;
|
unsigned ScanLimit = 6;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user