@@ -1244,6 +1244,48 @@ define i1 @extract_value_smul_fail(i8 %xx, i8 %yy) {
1244
1244
ret i1 %r
1245
1245
}
1246
1246
1247
+ define i8 @known_self_mul_bit_0_set (i8 noundef %x ) {
1248
+ ; CHECK-LABEL: @known_self_mul_bit_0_set(
1249
+ ; CHECK-NEXT: ret i8 0
1250
+ ;
1251
+ %bit_0_set = or i8 %x , 1
1252
+ %self_mul = mul i8 %bit_0_set , %bit_0_set
1253
+ %r = and i8 %self_mul , 4
1254
+ ret i8 %r
1255
+ }
1256
+
1257
+ define i8 @known_self_mul_bit_0_unset (i8 noundef %x ) {
1258
+ ; CHECK-LABEL: @known_self_mul_bit_0_unset(
1259
+ ; CHECK-NEXT: ret i8 0
1260
+ ;
1261
+ %bit_0_unset = and i8 %x , -2
1262
+ %self_mul = mul i8 %bit_0_unset , %bit_0_unset
1263
+ %r = and i8 %self_mul , 8
1264
+ ret i8 %r
1265
+ }
1266
+
1267
+ define i8 @known_self_mul_bit_1_set_bit_0_unset (i8 noundef %x ) {
1268
+ ; CHECK-LABEL: @known_self_mul_bit_1_set_bit_0_unset(
1269
+ ; CHECK-NEXT: ret i8 0
1270
+ ;
1271
+ %lower_2_unset = and i8 %x , -4
1272
+ %bit_1_set_bit_0_unset = or disjoint i8 %lower_2_unset , 2
1273
+ %self_mul = mul i8 %bit_1_set_bit_0_unset , %bit_1_set_bit_0_unset
1274
+ %r = and i8 %self_mul , 24
1275
+ ret i8 %r
1276
+ }
1277
+
1278
+ define i4 @known_self_mul_bit_1_set_bit_0_unset_i4 (i4 noundef %x ) {
1279
+ ; CHECK-LABEL: @known_self_mul_bit_1_set_bit_0_unset_i4(
1280
+ ; CHECK-NEXT: ret i4 0
1281
+ ;
1282
+ %lower_2_unset = and i4 %x , -4
1283
+ %bit_1_set_bit_0_unset = or disjoint i4 %lower_2_unset , 2
1284
+ %self_mul = mul i4 %bit_1_set_bit_0_unset , %bit_1_set_bit_0_unset
1285
+ %r = and i4 %self_mul , 24
1286
+ ret i4 %r
1287
+ }
1288
+
1247
1289
define i8 @known_reduce_or (<2 x i8 > %xx ) {
1248
1290
; CHECK-LABEL: @known_reduce_or(
1249
1291
; CHECK-NEXT: ret i8 1
0 commit comments