[PATCH] D29729: [InstCombine] don't lose nsw/nuw from add by converting to xor

Sanjoy Das via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Feb 12 21:12:08 PST 2017


sanjoy added a comment.

I think we can get the best of both worlds here -- both `X +nsw INT_MIN` and `X +nuw INT_MIN` can be transformed to `X | INT_MIN`.  http://rise4fun.com/Alive/ZpV

And then `(V | INT_MIN) s< 0` can be folded to false.


https://reviews.llvm.org/D29729





More information about the llvm-commits mailing list