Fix PR583 and testcase Transforms/InstCombine/2005-06-15-DivSelectCrash.ll
authorChris Lattner <sabre@nondot.org>
Thu, 16 Jun 2005 04:55:52 +0000 (04:55 +0000)
committerChris Lattner <sabre@nondot.org>
Thu, 16 Jun 2005 04:55:52 +0000 (04:55 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22227 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Scalar/InstructionCombining.cpp

index ef39589008e5b83e473a8d922ce384664d1424b8..76f11a52b285a0230e860958d25a875694914228 100644 (file)
@@ -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;
         }