[PATCH] D67502: [InstSimplify] simplifyUnsignedRangeCheck(): '(a+b) </>= c &&/|| (a+b) ==/!= 0' if we known 'c' is 'a' or 'b' and is non-zero (PR43259)

Roman Lebedev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 12 08:24:54 PDT 2019


lebedev.ri updated this revision to Diff 219927.
lebedev.ri retitled this revision from "[InstSimplify] simplifyUnsignedRangeCheck(): '(a+b) </>= a/b &&/|| a/b ==/!= 0' if we known a or b is non-zero (PR43259)" to "[InstSimplify] simplifyUnsignedRangeCheck(): '(a+b) </>= c &&/|| (a+b) ==/!= 0' if we known 'c' is 'a' or 'b' and is non-zero (PR43259)".
lebedev.ri added a comment.

Fix fold: we need to know that the value we compared with in `UnsignedICmp` is non-zero, not either of the values in `add`.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D67502/new/

https://reviews.llvm.org/D67502

Files:
  llvm/lib/Analysis/InstructionSimplify.cpp
  llvm/test/Transforms/InstSimplify/result-of-add-of-negative-is-non-zero-and-no-underflow.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D67502.219927.patch
Type: text/x-patch
Size: 4818 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190912/595d855e/attachment-0001.bin>


More information about the llvm-commits mailing list