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

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 13 06:44:16 PST 2017


spatel updated this revision to Diff 88197.
spatel added a comment.

Patch updated:
As suggested by Sanjoy, use 'or' rather than 'xor' when we have {nuw,nsw}. This allows the cmp tests to succeed.
There's a regression in the first add test because we don't recognize the larger pattern, but I've marked that with FIXME since this is still an overall improvement IMO.


https://reviews.llvm.org/D29729

Files:
  lib/Transforms/InstCombine/InstCombineAddSub.cpp
  test/Transforms/InstCombine/add.ll
  test/Transforms/InstCombine/icmp-add.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D29729.88197.patch
Type: text/x-patch
Size: 3479 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170213/17d7566e/attachment.bin>


More information about the llvm-commits mailing list