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

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 7 10:08:19 PST 2020


nikic added inline comments.


================
Comment at: llvm/include/llvm/IR/PatternMatch.h:1710
+      Value *Op1;
+      auto NotExpr = m_OneUse(m_Xor(m_Value(Op1), m_SpecificInt(-1)));
+      if (NotExpr.match(ICmpLHS))
----------------
Does m_SpecificInt sign extend? I'd use `m_AllOnes()` here. Or for that matter `m_Not(m_Value(Op1))`, though that will require reordering.


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