[InstCombine] Add splat vector test for asymmetric masked icmp fold

(NFC)
This commit is contained in:
Nikita Popov 2022-05-24 10:49:08 +02:00
parent 3245e2edd5
commit e1fcf998dc
1 changed files with 17 additions and 0 deletions

View File

@ -457,6 +457,23 @@ define i1 @masked_icmps_mask_notallzeros_bmask_mixed_1(i32 %x) {
ret i1 %t5
}
define <2 x i1> @masked_icmps_mask_notallzeros_bmask_mixed_1_vector(<2 x i32> %x) {
; CHECK-LABEL: @masked_icmps_mask_notallzeros_bmask_mixed_1_vector(
; CHECK-NEXT: [[T1:%.*]] = and <2 x i32> [[X:%.*]], <i32 12, i32 12>
; CHECK-NEXT: [[T2:%.*]] = icmp ne <2 x i32> [[T1]], zeroinitializer
; CHECK-NEXT: [[T3:%.*]] = and <2 x i32> [[X]], <i32 7, i32 7>
; CHECK-NEXT: [[T4:%.*]] = icmp eq <2 x i32> [[T3]], <i32 1, i32 1>
; CHECK-NEXT: [[T5:%.*]] = and <2 x i1> [[T2]], [[T4]]
; CHECK-NEXT: ret <2 x i1> [[T5]]
;
%t1 = and <2 x i32> %x, <i32 12, i32 12>
%t2 = icmp ne <2 x i32> %t1, zeroinitializer
%t3 = and <2 x i32> %x, <i32 7, i32 7>
%t4 = icmp eq <2 x i32> %t3, <i32 1, i32 1>
%t5 = and <2 x i1> %t2, %t4
ret <2 x i1> %t5
}
define i1 @masked_icmps_mask_notallzeros_bmask_mixed_1_logical(i32 %x) {
; CHECK-LABEL: @masked_icmps_mask_notallzeros_bmask_mixed_1_logical(
; CHECK-NEXT: [[TMP1:%.*]] = and i32 [[X:%.*]], 15