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

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Sep 12 10:02:06 PDT 2019


spatel added inline comments.


================
Comment at: llvm/lib/Analysis/InstructionSimplify.cpp:1393-1395
+    // Given  Y = (A - B)
+    //   Y >= A/B && Y != 0  --> false  iff A/B != 0
+    //   Y <  A/B || Y == 0  --> true   iff A/B != 0
----------------
lebedev.ri wrote:
> lebedev.ri wrote:
> > spatel wrote:
> > > Comments don't match code.
> > That's D67498
> Actually, i don't see it?
> Comments being added by this patch, or D67498?
Disregard - my comment applied to the earlier rev of the patch. Your update happened while I was looking at this.


================
Comment at: llvm/test/Transforms/InstSimplify/result-of-add-of-negative-is-non-zero-and-no-underflow.ll:91-92
+
+; We need to know that the value we compare with here (%base) is non-zero,
+; so knowledge about %offset won't do.
+define i1 @t5_bad(i8 %base, i8 %offset) {
----------------
I thought you proved this test already?
https://rise4fun.com/Alive/WslQ


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D67502





More information about the llvm-commits mailing list