@@ -1159,3 +1159,53 @@ define i4 @common_binop_demand_via_extelt_op0_mismatch_elt1(<2 x i4> %x, <2 x i4
1159
1159
call void @use (<2 x i4 > %b_xshuf_y )
1160
1160
ret i4 %b_xy0
1161
1161
}
1162
+
1163
+ define <2 x i8 > @common_binop_demand_via_splat_mask_poison (<2 x i8 > %x , <2 x i8 > %y ) {
1164
+ ; CHECK-LABEL: @common_binop_demand_via_splat_mask_poison(
1165
+ ; CHECK-NEXT: [[YSPLAT:%.*]] = shufflevector <2 x i8> [[Y:%.*]], <2 x i8> poison, <2 x i32> <i32 0, i32 poison>
1166
+ ; CHECK-NEXT: [[VV:%.*]] = add <2 x i8> [[YSPLAT]], [[X:%.*]]
1167
+ ; CHECK-NEXT: [[MSPLAT:%.*]] = shufflevector <2 x i8> [[VV]], <2 x i8> poison, <2 x i32> zeroinitializer
1168
+ ; CHECK-NEXT: [[RES:%.*]] = add <2 x i8> [[VV]], [[MSPLAT]]
1169
+ ; CHECK-NEXT: ret <2 x i8> [[RES]]
1170
+ ;
1171
+ %ysplat = shufflevector <2 x i8 > %y , <2 x i8 > poison, <2 x i32 > <i32 0 , i32 poison> ; <y0, poison>
1172
+ %vv = add <2 x i8 > %x , %ysplat ; <x0+y0, poison>
1173
+ %m = add <2 x i8 > %x , %y ; <x0+y0, x1+y1>
1174
+ %msplat = shufflevector <2 x i8 > %m , <2 x i8 > poison, <2 x i32 > <i32 0 , i32 0 > ; LeftDemanded = 1 ; <x0+y0, x0+y0>
1175
+ %res = add <2 x i8 > %vv , %msplat ; <x0+y0+x0+y0, poison>
1176
+ ret <2 x i8 > %res
1177
+ }
1178
+
1179
+ define <2 x i8 > @common_binop_demand_via_splat_mask_poison_2 (<2 x i8 > %x , <2 x i8 > %y ) {
1180
+ ; CHECK-LABEL: @common_binop_demand_via_splat_mask_poison_2(
1181
+ ; CHECK-NEXT: [[YSPLAT:%.*]] = shufflevector <2 x i8> [[Y:%.*]], <2 x i8> poison, <2 x i32> <i32 poison, i32 0>
1182
+ ; CHECK-NEXT: [[VV:%.*]] = add <2 x i8> [[YSPLAT]], [[X:%.*]]
1183
+ ; CHECK-NEXT: [[M:%.*]] = add <2 x i8> [[X]], [[Y]]
1184
+ ; CHECK-NEXT: [[MSPLAT:%.*]] = shufflevector <2 x i8> [[M]], <2 x i8> [[Y]], <2 x i32> <i32 0, i32 2>
1185
+ ; CHECK-NEXT: [[RES:%.*]] = add <2 x i8> [[VV]], [[MSPLAT]]
1186
+ ; CHECK-NEXT: ret <2 x i8> [[RES]]
1187
+ ;
1188
+ %ysplat = shufflevector <2 x i8 > %y , <2 x i8 > poison, <2 x i32 > <i32 poison, i32 0 >
1189
+ %vv = add <2 x i8 > %x , %ysplat
1190
+ %m = add <2 x i8 > %x , %y
1191
+ %msplat = shufflevector <2 x i8 > %m , <2 x i8 > %y , <2 x i32 > <i32 0 , i32 2 > ; LeftDemanded = 1, RightDemanded = 1
1192
+ %res = add <2 x i8 > %vv , %msplat
1193
+ ret <2 x i8 > %res
1194
+ }
1195
+
1196
+ define <2 x i8 > @common_binop_demand_via_splat_mask_poison_3 (<2 x i8 > %x , <2 x i8 > %y ) {
1197
+ ; CHECK-LABEL: @common_binop_demand_via_splat_mask_poison_3(
1198
+ ; CHECK-NEXT: [[YSPLAT:%.*]] = shufflevector <2 x i8> [[Y:%.*]], <2 x i8> poison, <2 x i32> <i32 poison, i32 0>
1199
+ ; CHECK-NEXT: [[VV:%.*]] = add <2 x i8> [[YSPLAT]], [[X:%.*]]
1200
+ ; CHECK-NEXT: [[M:%.*]] = add <2 x i8> [[X]], [[Y]]
1201
+ ; CHECK-NEXT: [[MSPLAT:%.*]] = shufflevector <2 x i8> [[M]], <2 x i8> poison, <2 x i32> zeroinitializer
1202
+ ; CHECK-NEXT: [[RES:%.*]] = add <2 x i8> [[VV]], [[MSPLAT]]
1203
+ ; CHECK-NEXT: ret <2 x i8> [[RES]]
1204
+ ;
1205
+ %ysplat = shufflevector <2 x i8 > %y , <2 x i8 > poison, <2 x i32 > <i32 poison, i32 0 >
1206
+ %vv = add <2 x i8 > %x , %ysplat
1207
+ %m = add <2 x i8 > %x , %y
1208
+ %msplat = shufflevector <2 x i8 > %m , <2 x i8 > poison, <2 x i32 > <i32 0 , i32 0 > ; LeftDemanded = 1
1209
+ %res = add <2 x i8 > %vv , %msplat
1210
+ ret <2 x i8 > %res
1211
+ }
0 commit comments