[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)
commit7d0e99c6019ca1c4c6708309ef5dade0db03b425
treeab617ef7dee6f4e251678779e1cbe578abb7d2c0
parent64a2a6a473553f178b74c785722d4f8dfd6b9eb1
[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.

llvm-svn: 235558
llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp
llvm/test/Transforms/InstCombine/cast.ll