From: Daniel Dunbar Date: Sun, 6 Sep 2009 02:31:36 +0000 (+0000) Subject: Fix a possible crash call setIsInBounds. X-Git-Url: http://plrg.eecs.uci.edu/git/?a=commitdiff_plain;h=f94880b47944ac4370e759c8ede63bf197a1da20;p=oota-llvm.git Fix a possible crash call setIsInBounds. - I think there are more instances of this, but I think they are fixed in Dan's incoming patch. This one was preventing me from doing a bugpoint reduction though. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81103 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Transforms/Scalar/InstructionCombining.cpp b/lib/Transforms/Scalar/InstructionCombining.cpp index ce2f4520c6a..bfe3a1c3d7f 100644 --- a/lib/Transforms/Scalar/InstructionCombining.cpp +++ b/lib/Transforms/Scalar/InstructionCombining.cpp @@ -12160,8 +12160,8 @@ Instruction *InstCombiner::visitExtractElementInst(ExtractElementInst &EI) { PointerType::get(EI.getType(), AS), I->getOperand(0)->getName()); Value *GEP = - Builder->CreateGEP(Ptr, EI.getOperand(1), I->getName()+".gep"); - cast(GEP)->setIsInBounds(true); + Builder->CreateInBoundsGEP(Ptr, EI.getOperand(1), + I->getName()+".gep"); LoadInst *Load = Builder->CreateLoad(GEP, "tmp");