From: Chris Lattner Date: Sat, 24 Feb 2007 01:19:50 +0000 (+0000) Subject: Fix Transforms/ConstProp/2007-02-23-sdiv.ll and PR1215 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=6b178a3801955490886e5729cbc85fe8e68fdc77;p=oota-llvm.git Fix Transforms/ConstProp/2007-02-23-sdiv.ll and PR1215 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34548 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/VMCore/ConstantFold.cpp b/lib/VMCore/ConstantFold.cpp index 7cb4b7bfbe5..f0969fce1f1 100644 --- a/lib/VMCore/ConstantFold.cpp +++ b/lib/VMCore/ConstantFold.cpp @@ -574,7 +574,8 @@ Constant *llvm::ConstantFoldBinaryInstruction(unsigned Opcode, if (CI2->isAllOnesValue() && (((CI1->getType()->getPrimitiveSizeInBits() == 64) && (CI1->getSExtValue() == INT64_MIN)) || - (CI1->getSExtValue() == -CI1->getSExtValue()))) + (CI1->getSExtValue() == -CI1->getSExtValue() && + CI1->getSExtValue()))) return 0; // MIN_INT / -1 -> overflow return ConstantInt::get(C1->getType(), CI1->getSExtValue() / CI2->getSExtValue());