Instcombine was illegally transforming -X/C into X/-C when either X or C
authorBill Wendling <isanbard@gmail.com>
Sun, 30 Nov 2008 03:42:12 +0000 (03:42 +0000)
committerBill Wendling <isanbard@gmail.com>
Sun, 30 Nov 2008 03:42:12 +0000 (03:42 +0000)
commite1196d6d3efabfc58103acc9076ad946d3574a04
treecf179d0e8850608a3ca59d46b4729c512df0d6cf
parent4a69bade2385022ca776edc22150f3b750cdf23c
Instcombine was illegally transforming -X/C into X/-C when either X or C
overflowed on negation. This commit checks to make sure that neithe C nor X
overflows. This requires that the RHS of X (a subtract instruction) be a
constant integer.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60275 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/Scalar/InstructionCombining.cpp
test/Transforms/InstCombine/apint-sub.ll
test/Transforms/InstCombine/sdiv-1.ll [new file with mode: 0644]
test/Transforms/InstCombine/sub.ll