[PATCH] D92726: Teach isKnownNonEqual how to recurse through invertable multiplies

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Dec 6 01:58:49 PST 2020


nikic added inline comments.


================
Comment at: llvm/test/Analysis/ValueTracking/known-non-equal.ll:161
+  ret i1 %cmp
+}
+
----------------
nikic wrote:
> I don't think this is right if `%C` can be zero. In that case `%A.op == %B.op` regardless of what the relation between `%A` and `%B` is.
It is fine with the added non-zero requirement though: https://alive2.llvm.org/ce/z/_SBhuP

Looks like it also holds if both muls as nsw rather than nuw: https://alive2.llvm.org/ce/z/Z6D5qK


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D92726



More information about the llvm-commits mailing list