Skip to content

Commit a569a0a

Browse files
committed
[InstSimplify] add vector tests for icmp with mul nuw; NFC
Also, the naming was off on a couple of tests.
1 parent 7ad60f6 commit a569a0a

File tree

1 file changed

+26
-4
lines changed

1 file changed

+26
-4
lines changed

llvm/test/Transforms/InstSimplify/icmp-constant.ll

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -823,8 +823,8 @@ define i1 @mul_nuw_urem_cmp_constant1(i8 %x) {
823823

824824
; Invert predicate and check vector type.
825825

826-
define <2 x i1> @mul_nuw_urem_cmp_constant2(<2 x i8> %x) {
827-
; CHECK-LABEL: @mul_nuw_urem_cmp_constant2(
826+
define <2 x i1> @mul_nuw_urem_cmp_constant_vec_splat(<2 x i8> %x) {
827+
; CHECK-LABEL: @mul_nuw_urem_cmp_constant_vec_splat(
828828
; CHECK-NEXT: [[M:%.*]] = mul nuw <2 x i8> [[X:%.*]], <i8 45, i8 45>
829829
; CHECK-NEXT: [[R:%.*]] = icmp ne <2 x i8> [[M]], <i8 15, i8 15>
830830
; CHECK-NEXT: ret <2 x i1> [[R]]
@@ -834,10 +834,32 @@ define <2 x i1> @mul_nuw_urem_cmp_constant2(<2 x i8> %x) {
834834
ret <2 x i1> %r
835835
}
836836

837+
define <2 x i1> @mul_nuw_urem_cmp_constant_vec_splat_undef1(<2 x i8> %x) {
838+
; CHECK-LABEL: @mul_nuw_urem_cmp_constant_vec_splat_undef1(
839+
; CHECK-NEXT: [[M:%.*]] = mul nuw <2 x i8> [[X:%.*]], <i8 45, i8 45>
840+
; CHECK-NEXT: [[R:%.*]] = icmp ne <2 x i8> [[M]], <i8 15, i8 undef>
841+
; CHECK-NEXT: ret <2 x i1> [[R]]
842+
;
843+
%m = mul nuw <2 x i8> %x, <i8 45, i8 45>
844+
%r = icmp ne <2 x i8> %m, <i8 15, i8 undef>
845+
ret <2 x i1> %r
846+
}
847+
848+
define <2 x i1> @mul_nuw_urem_cmp_constant_vec_splat_undef2(<2 x i8> %x) {
849+
; CHECK-LABEL: @mul_nuw_urem_cmp_constant_vec_splat_undef2(
850+
; CHECK-NEXT: [[M:%.*]] = mul nuw <2 x i8> [[X:%.*]], <i8 undef, i8 45>
851+
; CHECK-NEXT: [[R:%.*]] = icmp ne <2 x i8> [[M]], <i8 15, i8 15>
852+
; CHECK-NEXT: ret <2 x i1> [[R]]
853+
;
854+
%m = mul nuw <2 x i8> %x, <i8 undef, i8 45>
855+
%r = icmp ne <2 x i8> %m, <i8 15, i8 15>
856+
ret <2 x i1> %r
857+
}
858+
837859
; Check "negative" numbers (constants should be analyzed as unsigned).
838860

839-
define i1 @mul_nuw_smaller_cmp_constant_vec_splat(i8 %x) {
840-
; CHECK-LABEL: @mul_nuw_smaller_cmp_constant_vec_splat(
861+
define i1 @mul_nuw_urem_cmp_constant2(i8 %x) {
862+
; CHECK-LABEL: @mul_nuw_urem_cmp_constant2(
841863
; CHECK-NEXT: [[M:%.*]] = mul nuw i8 [[X:%.*]], -42
842864
; CHECK-NEXT: [[R:%.*]] = icmp eq i8 [[M]], -84
843865
; CHECK-NEXT: ret i1 [[R]]

0 commit comments

Comments
 (0)