From: Dan Gohman Date: Tue, 19 May 2009 19:18:01 +0000 (+0000) Subject: Create ConstantExpr GEPs the correct way. This fixes X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=278b49af8a08f6ab6c486a3cfc7a9c1c1acd2b23;p=oota-llvm.git 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 --- diff --git a/lib/Analysis/ScalarEvolutionExpander.cpp b/lib/Analysis/ScalarEvolutionExpander.cpp index 36b6206a9bc..d110385fb3e 100644 --- a/lib/Analysis/ScalarEvolutionExpander.cpp +++ b/lib/Analysis/ScalarEvolutionExpander.cpp @@ -246,7 +246,7 @@ Value *SCEVExpander::expandAddToGEP(const SCEVAddExpr *S, // Fold a GEP with constant operands. if (Constant *CLHS = dyn_cast(V)) if (Constant *CRHS = dyn_cast(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;