You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
; CHECK-NEXT: [[X:%.*]] = or <2 x i8> [[XX:%.*]], <i8 5, i8 3>
1247
+
; CHECK-NEXT: [[V:%.*]] = call i8 @llvm.vector.reduce.xor.v2i8(<2 x i8> [[X]])
1248
+
; CHECK-NEXT: [[R:%.*]] = and i8 [[V]], 1
1249
+
; CHECK-NEXT: ret i8 [[R]]
1250
+
;
1251
+
%x = or <2 x i8> %xx, <i85, i83>
1252
+
%v = calli8@llvm.vector.reduce.xor(<2 x i8> %x)
1253
+
%r = andi8%v, 1
1254
+
reti8%r
1255
+
}
1256
+
1257
+
definei8@known_reduce_xor_even2(<2 x i8> %xx) {
1258
+
; CHECK-LABEL: @known_reduce_xor_even2(
1259
+
; CHECK-NEXT: [[X:%.*]] = and <2 x i8> [[XX:%.*]], <i8 15, i8 15>
1260
+
; CHECK-NEXT: [[V:%.*]] = call i8 @llvm.vector.reduce.xor.v2i8(<2 x i8> [[X]])
1261
+
; CHECK-NEXT: [[R:%.*]] = and i8 [[V]], 16
1262
+
; CHECK-NEXT: ret i8 [[R]]
1263
+
;
1264
+
%x = and <2 x i8> %xx, <i815, i815>
1265
+
%v = calli8@llvm.vector.reduce.xor(<2 x i8> %x)
1266
+
%r = andi8%v, 16
1267
+
reti8%r
1268
+
}
1269
+
1270
+
definei8@known_reduce_xor_even_fail(<2 x i8> %xx) {
1271
+
; CHECK-LABEL: @known_reduce_xor_even_fail(
1272
+
; CHECK-NEXT: [[X:%.*]] = or <2 x i8> [[XX:%.*]], <i8 5, i8 3>
1273
+
; CHECK-NEXT: [[V:%.*]] = call i8 @llvm.vector.reduce.xor.v2i8(<2 x i8> [[X]])
1274
+
; CHECK-NEXT: [[R:%.*]] = and i8 [[V]], 2
1275
+
; CHECK-NEXT: ret i8 [[R]]
1276
+
;
1277
+
%x = or <2 x i8> %xx, <i85, i83>
1278
+
%v = calli8@llvm.vector.reduce.xor(<2 x i8> %x)
1279
+
%r = andi8%v, 2
1280
+
reti8%r
1281
+
}
1282
+
1283
+
definei8@known_reduce_xor_odd(<3 x i8> %xx) {
1284
+
; CHECK-LABEL: @known_reduce_xor_odd(
1285
+
; CHECK-NEXT: [[X:%.*]] = or <3 x i8> [[XX:%.*]], <i8 5, i8 3, i8 9>
1286
+
; CHECK-NEXT: [[V:%.*]] = call i8 @llvm.vector.reduce.xor.v3i8(<3 x i8> [[X]])
1287
+
; CHECK-NEXT: [[R:%.*]] = and i8 [[V]], 1
1288
+
; CHECK-NEXT: ret i8 [[R]]
1289
+
;
1290
+
%x = or <3 x i8> %xx, <i85, i83, i89>
1291
+
%v = calli8@llvm.vector.reduce.xor.v3i8(<3 x i8> %x)
1292
+
%r = andi8%v, 1
1293
+
reti8%r
1294
+
}
1295
+
1296
+
definei8@known_reduce_xor_odd2(<3 x i8> %xx) {
1297
+
; CHECK-LABEL: @known_reduce_xor_odd2(
1298
+
; CHECK-NEXT: [[X:%.*]] = and <3 x i8> [[XX:%.*]], <i8 15, i8 15, i8 31>
1299
+
; CHECK-NEXT: [[V:%.*]] = call i8 @llvm.vector.reduce.xor.v3i8(<3 x i8> [[X]])
1300
+
; CHECK-NEXT: [[R:%.*]] = and i8 [[V]], 32
1301
+
; CHECK-NEXT: ret i8 [[R]]
1302
+
;
1303
+
%x = and <3 x i8> %xx, <i815, i815, i831>
1304
+
%v = calli8@llvm.vector.reduce.xor.v3i8(<3 x i8> %x)
1305
+
%r = andi8%v, 32
1306
+
reti8%r
1307
+
}
1308
+
1309
+
definei8@known_reduce_xor_odd2_fail(<3 x i8> %xx) {
1310
+
; CHECK-LABEL: @known_reduce_xor_odd2_fail(
1311
+
; CHECK-NEXT: [[X:%.*]] = and <3 x i8> [[XX:%.*]], <i8 15, i8 15, i8 31>
1312
+
; CHECK-NEXT: [[V:%.*]] = call i8 @llvm.vector.reduce.xor.v3i8(<3 x i8> [[X]])
1313
+
; CHECK-NEXT: [[R:%.*]] = and i8 [[V]], 16
1314
+
; CHECK-NEXT: ret i8 [[R]]
1315
+
;
1316
+
%x = and <3 x i8> %xx, <i815, i815, i831>
1317
+
%v = calli8@llvm.vector.reduce.xor.v3i8(<3 x i8> %x)
1318
+
%r = andi8%v, 16
1319
+
reti8%r
1320
+
}
1321
+
1322
+
definei8@known_reduce_xor_odd_fail(<3 x i8> %xx) {
1323
+
; CHECK-LABEL: @known_reduce_xor_odd_fail(
1324
+
; CHECK-NEXT: [[X:%.*]] = or <3 x i8> [[XX:%.*]], <i8 5, i8 3, i8 9>
1325
+
; CHECK-NEXT: [[V:%.*]] = call i8 @llvm.vector.reduce.xor.v3i8(<3 x i8> [[X]])
1326
+
; CHECK-NEXT: [[R:%.*]] = and i8 [[V]], 2
1327
+
; CHECK-NEXT: ret i8 [[R]]
1328
+
;
1329
+
%x = or <3 x i8> %xx, <i85, i83, i89>
1330
+
%v = calli8@llvm.vector.reduce.xor.v3i8(<3 x i8> %x)
1331
+
%r = andi8%v, 2
1332
+
reti8%r
1333
+
}
1334
+
1335
+
definei8@nonzero_reduce_xor_vscale_even(<vscale x 2 x i8> %xx) {
1336
+
; CHECK-LABEL: @nonzero_reduce_xor_vscale_even(
1337
+
; CHECK-NEXT: [[X:%.*]] = or <vscale x 2 x i8> [[XX:%.*]], shufflevector (<vscale x 2 x i8> insertelement (<vscale x 2 x i8> poison, i8 1, i64 0), <vscale x 2 x i8> poison, <vscale x 2 x i32> zeroinitializer)
1338
+
; CHECK-NEXT: [[V:%.*]] = call i8 @llvm.vector.reduce.xor.nxv2i8(<vscale x 2 x i8> [[X]])
1339
+
; CHECK-NEXT: [[R:%.*]] = and i8 [[V]], 1
1340
+
; CHECK-NEXT: ret i8 [[R]]
1341
+
;
1342
+
%one = insertelement <vscale x 2 x i8> poison, i81, i640
1343
+
%ones = shufflevector <vscale x 2 x i8> %one, <vscale x 2 x i8> poison, <vscale x 2 x i32> zeroinitializer
1344
+
%x = or <vscale x 2 x i8> %xx, %ones
1345
+
%v = calli8@llvm.vector.reduce.xor.nxv2i8(<vscale x 2 x i8> %x)
1346
+
%r = andi8%v, 1
1347
+
reti8%r
1348
+
}
1349
+
1350
+
definei8@nonzero_reduce_xor_vscale_odd_fail(<vscale x 3 x i8> %xx) {
; CHECK-NEXT: [[X:%.*]] = or <vscale x 3 x i8> [[XX:%.*]], shufflevector (<vscale x 3 x i8> insertelement (<vscale x 3 x i8> poison, i8 1, i64 0), <vscale x 3 x i8> poison, <vscale x 3 x i32> zeroinitializer)
1353
+
; CHECK-NEXT: [[V:%.*]] = call i8 @llvm.vector.reduce.xor.nxv3i8(<vscale x 3 x i8> [[X]])
1354
+
; CHECK-NEXT: [[R:%.*]] = and i8 [[V]], 1
1355
+
; CHECK-NEXT: ret i8 [[R]]
1356
+
;
1357
+
%one = insertelement <vscale x 3 x i8> poison, i81, i640
1358
+
%ones = shufflevector <vscale x 3 x i8> %one, <vscale x 3 x i8> poison, <vscale x 3 x i32> zeroinitializer
1359
+
%x = or <vscale x 3 x i8> %xx, %ones
1360
+
%v = calli8@llvm.vector.reduce.xor.nxv3i8(<vscale x 3 x i8> %x)
1361
+
%r = andi8%v, 1
1362
+
reti8%r
1363
+
}
1364
+
1365
+
definei8@nonzero_reduce_xor_vscale_even_fail(<vscale x 2 x i8> %xx) {
; CHECK-NEXT: [[X:%.*]] = or <vscale x 2 x i8> [[XX:%.*]], shufflevector (<vscale x 2 x i8> insertelement (<vscale x 2 x i8> poison, i8 1, i64 0), <vscale x 2 x i8> poison, <vscale x 2 x i32> zeroinitializer)
1368
+
; CHECK-NEXT: [[V:%.*]] = call i8 @llvm.vector.reduce.xor.nxv2i8(<vscale x 2 x i8> [[X]])
1369
+
; CHECK-NEXT: [[R:%.*]] = and i8 [[V]], 2
1370
+
; CHECK-NEXT: ret i8 [[R]]
1371
+
;
1372
+
%one = insertelement <vscale x 2 x i8> poison, i81, i640
1373
+
%ones = shufflevector <vscale x 2 x i8> %one, <vscale x 2 x i8> poison, <vscale x 2 x i32> zeroinitializer
1374
+
%x = or <vscale x 2 x i8> %xx, %ones
1375
+
%v = calli8@llvm.vector.reduce.xor.nxv2i8(<vscale x 2 x i8> %x)
1376
+
%r = andi8%v, 2
1377
+
reti8%r
1378
+
}
1379
+
1380
+
definei8@nonzero_reduce_xor_vscale_odd(<vscale x 3 x i8> %xx) {
1381
+
; CHECK-LABEL: @nonzero_reduce_xor_vscale_odd(
1382
+
; CHECK-NEXT: [[X:%.*]] = and <vscale x 3 x i8> [[XX:%.*]], shufflevector (<vscale x 3 x i8> insertelement (<vscale x 3 x i8> poison, i8 1, i64 0), <vscale x 3 x i8> poison, <vscale x 3 x i32> zeroinitializer)
1383
+
; CHECK-NEXT: [[V:%.*]] = call i8 @llvm.vector.reduce.xor.nxv3i8(<vscale x 3 x i8> [[X]])
1384
+
; CHECK-NEXT: [[R:%.*]] = and i8 [[V]], 2
1385
+
; CHECK-NEXT: ret i8 [[R]]
1386
+
;
1387
+
%one = insertelement <vscale x 3 x i8> poison, i81, i640
1388
+
%ones = shufflevector <vscale x 3 x i8> %one, <vscale x 3 x i8> poison, <vscale x 3 x i32> zeroinitializer
1389
+
%x = and <vscale x 3 x i8> %xx, %ones
1390
+
%v = calli8@llvm.vector.reduce.xor.nxv3i8(<vscale x 3 x i8> %x)
0 commit comments