[PATCH] D50972: [InstCombine] Fold icmp ugt/ult (add nuw X, C2), C --> icmp ugt/ult X, (C - C2)

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 21 08:50:57 PDT 2018


spatel accepted this revision.
spatel added a comment.
This revision is now accepted and ready to land.

The code change LGTM.

Does the signed version of this fold have negative tests (eg, when there's no 'nsw' on the add)? Either way, if they don't already exist, please add negative tests for this transform where:

1. The add does not have 'nuw'.
2. usub_ov() actually does overflow.

...so we verify that this transform is sufficiently guarded.


Repository:
  rL LLVM

https://reviews.llvm.org/D50972





More information about the llvm-commits mailing list