1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-21 03:53:04 +02:00

Fix Transforms/ConstProp/2007-02-23-sdiv.ll and PR1215

llvm-svn: 34548
This commit is contained in:
Chris Lattner 2007-02-24 01:19:50 +00:00
parent 63ddace902
commit 5480ffb904

View File

@ -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());