[PATCH] D69245: [InstCombine] Canonicalize uadd.with.overflow to uadd.sat

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 22 13:26:27 PDT 2019


nikic added inline comments.


================
Comment at: llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp:1744
+  if (!CondVal || !FalseVal)
+    return nullptr;
+
----------------
dmgreen wrote:
> nikic wrote:
> > We might want to add an `m_ExtractValue<0>(Matcher)` matcher...
> Righteo.
> 
> I've only made it single index, as opposed to try and get fancy with some recursive templates. That is likely the most common case. I've also added a m_BinOpIntrinsic to more easily grab the BinaryOpIntrinsic.
I think it would make more sense to make this a matcher for WithOverflowInst intrinsics -- that's what's needed here, and matching both saturating and with.overflow in one matcher doesn't seem super useful in general.


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

https://reviews.llvm.org/D69245





More information about the llvm-commits mailing list