[PATCH] D74228: [PatternMatch] Match XOR variant of unsigned-add overflow check.

Roman Lebedev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Feb 18 07:30:26 PST 2020


lebedev.ri added inline comments.


================
Comment at: llvm/include/llvm/IR/PatternMatch.h:2055
+      Value *Op1;
+      if (m_OneUse(m_c_Xor(m_Value(Op1), m_AllOnes())).match(ICmpLHS))
+        return L.match(Op1) && R.match(ICmpRHS) && S.match(ICmpLHS);
----------------
We know constant is always on rhs of binop.
I was talking about `b u> (a ^ -1)` case there.

Also, not strictly related to this patch, but does this simply ignore inverted cases, like `(a ^ -1) u>= b`?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D74228





More information about the llvm-commits mailing list