]> granicus.if.org Git - llvm/commit
Merging r214385:
authorDavid Majnemer <david.majnemer@gmail.com>
Mon, 8 Dec 2014 09:11:36 +0000 (09:11 +0000)
committerDavid Majnemer <david.majnemer@gmail.com>
Mon, 8 Dec 2014 09:11:36 +0000 (09:11 +0000)
commitaf44f024445cbab39d44166a9bd574c4b584d191
tree1873678f9cee11b2b0aace2fd88aa74ac24f4ec8
parentf38406688d8013baeb86d5f2ee895217b3a9f28c
Merging r214385:
------------------------------------------------------------------------
r214385 | majnemer | 2014-07-30 21:49:29 -0700 (Wed, 30 Jul 2014) | 9 lines

InstCombine: Correctly propagate NSW/NUW for x-(-A) -> x+A

We can only propagate the nsw bits if both subtraction instructions are
marked with the appropriate bit.

N.B.  We only propagate the nsw bit in InstCombine because the nuw case
is already handled in InstSimplify.

This fixes PR20189.
------------------------------------------------------------------------

git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_35@223644 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/InstCombine/InstCombineAddSub.cpp
test/Transforms/InstCombine/sub.ll