From 278b49af8a08f6ab6c486a3cfc7a9c1c1acd2b23 Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Tue, 19 May 2009 19:18:01 +0000 Subject: [PATCH] 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 --- lib/Analysis/ScalarEvolutionExpander.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; -- 2.34.1