[PATCH] D69252: [InstCombine] Canonicalize sadd.with.overflow to sadd.sat

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 5 10:01:17 PST 2019


spatel accepted this revision.
spatel added a comment.
This revision is now accepted and ready to land.

LGTM (but give @lebedev.ri a chance to comment again too)



================
Comment at: llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp:1755-1756
+    Type *Ty = Limit->getType();
+    APInt MinVal = APInt::getSignedMinValue(Ty->getScalarSizeInBits());
+    APInt MaxVal = APInt::getSignedMaxValue(Ty->getScalarSizeInBits());
+
----------------
Sink these values to their uses in IsMinMax()?


================
Comment at: llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp:1765
+
+    auto IsZeroOrOne = [](APInt C) {
+      return C.isNullValue() || C.isOneValue();
----------------
Probably want to make this a const reference (avoid copy for crazy big numbers).


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

https://reviews.llvm.org/D69252





More information about the llvm-commits mailing list