[PATCH] D140798: [InstCombine] Fold zero check followed by decrement to usub.sat

Jamie Hill-Daniel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Dec 31 07:18:54 PST 2022


clubby789 marked 4 inline comments as done.
clubby789 added inline comments.


================
Comment at: llvm/test/Transforms/InstCombine/saturating-add-sub.ll:533
+  ret i8 %i2
+}
+
----------------
nikic wrote:
> Especially if this is implemented as a separate fold, we'd want some negative test cases here, e.g. incorrect constants (vary zero/one), incorrect operands (not %a both time), incorrect icmp predicate.
> 
> As you are using `m_Zero()` matchers, which allow undef/poison in vectors, we'd want to test that as well.
Sorry, I'm not quite sure how to test the vector case you mentioned.


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

https://reviews.llvm.org/D140798



More information about the llvm-commits mailing list