[PATCH] D152091: [InstCombine] precommit test for D152068(NFC)

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Jun 4 07:28:01 PDT 2023


nikic added inline comments.


================
Comment at: llvm/test/Transforms/InstCombine/addsub-constant-folding.ll:175
+}
+
 define i32 @add_const_const_sub_extrause(i32 %arg) {
----------------
khei4 wrote:
> nikic wrote:
> > It would be good to have a test with non-splat vector constants (one with and one without overflow), as this fold supports them.
> Thank you for a good catch! I could find currently, i.e. `C = <i8 1, i8 3>`, `C2 = <i8 -127, i8 -125>`,  `bool WillNotSOV = willNotOverflowSignedSub(C, C2, I);` would be false because [[ https://github.com/llvm/llvm-project/blob/main/llvm/lib/Analysis/ValueTracking.cpp#L6201-L6206 | computeOverflowForSignedSub ]] can't check correctly, but each vector's maximum and minimum element range??
In that case, just leave a TODO in the test.


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

https://reviews.llvm.org/D152091



More information about the llvm-commits mailing list