[PATCH] D152091: [InstCombine] precommit test for D152068(NFC)
Nikita Popov via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sun Jun 4 03:13:50 PDT 2023
nikic added inline comments.
================
Comment at: llvm/test/Transforms/InstCombine/addsub-constant-folding.ll:135
+define i32 @add_nsw_const_const_sub_nsw(i32 %arg) {
+; CHECK-LABEL: @add_nsw_const_const_sub_nsw(
----------------
For tests with overflowing constants, I'd recommend using `i8` as it's easier to see what overflows and what doesn't at a glance.
================
Comment at: llvm/test/Transforms/InstCombine/addsub-constant-folding.ll:151
+ %t0 = add nsw i32 %arg, 1
+ %t1 = sub i32 -2147483647, %t0
+ ret i32 %t1
----------------
Can also add nuw here to check that the right attribute presence is checked.
================
Comment at: llvm/test/Transforms/InstCombine/addsub-constant-folding.ll:175
+}
+
define i32 @add_const_const_sub_extrause(i32 %arg) {
----------------
It would be good to have a test with non-splat vector constants (one with and one without overflow), as this fold supports them.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D152091/new/
https://reviews.llvm.org/D152091
More information about the llvm-commits
mailing list