[InstCombine] Use a more targeted fix instead of r235544
authorDavid Majnemer <david.majnemer@gmail.com>
Wed, 22 Apr 2015 22:42:05 +0000 (22:42 +0000)
committerDavid Majnemer <david.majnemer@gmail.com>
Wed, 22 Apr 2015 22:42:05 +0000 (22:42 +0000)
commitf9c92b069a1a6f73ec41b7741b2ac6b7740c36a6
treec834e55e270e23c4885db63255850ddd8d462cb3
parentd9b72fea112333a8998f1185d454eae1496523bd
[InstCombine] Use a more targeted fix instead of r235544

Only clear out the NSW/NUW flags if we are optimizing 'add'/'sub' while
taking advantage that the sign bit is not set.  We do this optimization
to further shrink the mask but shrinking the mask isn't NSW/NUW
preserving in this case.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235558 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp
test/Transforms/InstCombine/cast.ll