From: Chris Lattner Date: Thu, 16 Jun 2005 04:55:52 +0000 (+0000) Subject: Fix PR583 and testcase Transforms/InstCombine/2005-06-15-DivSelectCrash.ll X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=f9c775c22e0ac3eb520d8b4dc89d3f16f274ebb6;p=oota-llvm.git Fix PR583 and testcase Transforms/InstCombine/2005-06-15-DivSelectCrash.ll git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22227 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Transforms/Scalar/InstructionCombining.cpp b/lib/Transforms/Scalar/InstructionCombining.cpp index ef39589008e..76f11a52b28 100644 --- a/lib/Transforms/Scalar/InstructionCombining.cpp +++ b/lib/Transforms/Scalar/InstructionCombining.cpp @@ -1067,7 +1067,7 @@ Instruction *InstCombiner::visitDiv(BinaryOperator &I) { I.setOperand(1, SFO); return &I; } else if (SFO->getValue() == 0) { - I.setOperand(2, STO); + I.setOperand(1, STO); return &I; }