Skip to content

Commit 8721bfd

Browse files
ShchchowAMDZhou, Shaochi(AMD)
authored andcommitted
Scalarizer : Fix vector shuffle issue when can't aligned to customized minBits. (llvm#163912)
When set a value to minBits, and doing scalarizer pass, if last remained boolean vector size can't be aligned to min bits, remained bits should be processed each by each, and not allowed to do a direct shuffle during packing. Problem: In 'concatenate' step, when processing a boolean vector, if last remained bits (fragment) can't be aligned to minBits, but required to be packed, those bits should be processed each by each. A direct call to vector shuffle is to assume those remained boolean bits can be packed to target pack size. For example, when processing a boolean vector with `size = 7`, but set `min bits = 4`, first fragment with `4` bits can be packed correctly, but there are still `3` bits remained which can't be used in a vector shuffle call. Solution: If remained bits can't be aligned to required target (min bits) pack size, process them each by each. (This will mostly only influence boolean vector as they have bit width not aligned to pow(2).) --------- Co-authored-by: Zhou, Shaochi(AMD) <[email protected]>
1 parent d9f5aaa commit 8721bfd

File tree

3 files changed

+58
-22
lines changed

3 files changed

+58
-22
lines changed

llvm/lib/Transforms/Scalar/Scalarizer.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -252,7 +252,14 @@ static Value *concatenate(IRBuilder<> &Builder, ArrayRef<Value *> Fragments,
252252
Res = Builder.CreateInsertElement(Res, Fragment, I * VS.NumPacked,
253253
Name + ".upto" + Twine(I));
254254
} else {
255-
Fragment = Builder.CreateShuffleVector(Fragment, Fragment, ExtendMask);
255+
if (NumPacked < VS.NumPacked) {
256+
// If last pack of remained bits not match current ExtendMask size.
257+
ExtendMask.truncate(NumPacked);
258+
ExtendMask.resize(NumElements, -1);
259+
}
260+
261+
Fragment = Builder.CreateShuffleVector(
262+
Fragment, PoisonValue::get(Fragment->getType()), ExtendMask);
256263
if (I == 0) {
257264
Res = Fragment;
258265
} else {

llvm/test/Transforms/Scalarizer/min-bits.ll

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ define void @load_add_store_v4i10(ptr %pa, ptr %pb) {
171171
; MIN32-NEXT: [[C_I0:%.*]] = add <3 x i10> [[A_I0]], [[B_I0]]
172172
; MIN32-NEXT: [[B_I1:%.*]] = extractelement <4 x i10> [[B]], i64 3
173173
; MIN32-NEXT: [[C_I1:%.*]] = add i10 [[A_I1]], [[B_I1]]
174-
; MIN32-NEXT: [[TMP1:%.*]] = shufflevector <3 x i10> [[C_I0]], <3 x i10> [[C_I0]], <4 x i32> <i32 0, i32 1, i32 2, i32 poison>
174+
; MIN32-NEXT: [[TMP1:%.*]] = shufflevector <3 x i10> [[C_I0]], <3 x i10> poison, <4 x i32> <i32 0, i32 1, i32 2, i32 poison>
175175
; MIN32-NEXT: [[C:%.*]] = insertelement <4 x i10> [[TMP1]], i10 [[C_I1]], i64 3
176176
; MIN32-NEXT: store <4 x i10> [[C]], ptr [[PA]], align 8
177177
; MIN32-NEXT: ret void
@@ -237,7 +237,7 @@ define <3 x half> @select_uniform_condition_v3f16(<3 x half> %a, <3 x half> %b,
237237
; MIN32-NEXT: [[A_I1:%.*]] = extractelement <3 x half> [[A]], i64 2
238238
; MIN32-NEXT: [[B_I1:%.*]] = extractelement <3 x half> [[B]], i64 2
239239
; MIN32-NEXT: [[R_I1:%.*]] = select i1 [[CC]], half [[A_I1]], half [[B_I1]]
240-
; MIN32-NEXT: [[TMP1:%.*]] = shufflevector <2 x half> [[R_I0]], <2 x half> [[R_I0]], <3 x i32> <i32 0, i32 1, i32 poison>
240+
; MIN32-NEXT: [[TMP1:%.*]] = shufflevector <2 x half> [[R_I0]], <2 x half> poison, <3 x i32> <i32 0, i32 1, i32 poison>
241241
; MIN32-NEXT: [[R:%.*]] = insertelement <3 x half> [[TMP1]], half [[R_I1]], i64 2
242242
; MIN32-NEXT: ret <3 x half> [[R]]
243243
;
@@ -276,8 +276,8 @@ define <4 x half> @select_uniform_condition_v4f16(<4 x half> %a, <4 x half> %b,
276276
; MIN32-NEXT: [[A_I1:%.*]] = shufflevector <4 x half> [[A]], <4 x half> poison, <2 x i32> <i32 2, i32 3>
277277
; MIN32-NEXT: [[B_I1:%.*]] = shufflevector <4 x half> [[B]], <4 x half> poison, <2 x i32> <i32 2, i32 3>
278278
; MIN32-NEXT: [[R_I1:%.*]] = select i1 [[CC]], <2 x half> [[A_I1]], <2 x half> [[B_I1]]
279-
; MIN32-NEXT: [[TMP1:%.*]] = shufflevector <2 x half> [[R_I0]], <2 x half> [[R_I0]], <4 x i32> <i32 0, i32 1, i32 poison, i32 poison>
280-
; MIN32-NEXT: [[TMP2:%.*]] = shufflevector <2 x half> [[R_I1]], <2 x half> [[R_I1]], <4 x i32> <i32 0, i32 1, i32 poison, i32 poison>
279+
; MIN32-NEXT: [[TMP1:%.*]] = shufflevector <2 x half> [[R_I0]], <2 x half> poison, <4 x i32> <i32 0, i32 1, i32 poison, i32 poison>
280+
; MIN32-NEXT: [[TMP2:%.*]] = shufflevector <2 x half> [[R_I1]], <2 x half> poison, <4 x i32> <i32 0, i32 1, i32 poison, i32 poison>
281281
; MIN32-NEXT: [[R:%.*]] = shufflevector <4 x half> [[TMP1]], <4 x half> [[TMP2]], <4 x i32> <i32 0, i32 1, i32 4, i32 5>
282282
; MIN32-NEXT: ret <4 x half> [[R]]
283283
;
@@ -338,7 +338,7 @@ define <3 x half> @unary_v3f16(<3 x half> %a) {
338338
; MIN32-NEXT: [[R_I0:%.*]] = fneg <2 x half> [[A_I0]]
339339
; MIN32-NEXT: [[A_I1:%.*]] = extractelement <3 x half> [[A]], i64 2
340340
; MIN32-NEXT: [[R_I1:%.*]] = fneg half [[A_I1]]
341-
; MIN32-NEXT: [[TMP1:%.*]] = shufflevector <2 x half> [[R_I0]], <2 x half> [[R_I0]], <3 x i32> <i32 0, i32 1, i32 poison>
341+
; MIN32-NEXT: [[TMP1:%.*]] = shufflevector <2 x half> [[R_I0]], <2 x half> poison, <3 x i32> <i32 0, i32 1, i32 poison>
342342
; MIN32-NEXT: [[R:%.*]] = insertelement <3 x half> [[TMP1]], half [[R_I1]], i64 2
343343
; MIN32-NEXT: ret <3 x half> [[R]]
344344
;
@@ -371,8 +371,8 @@ define <4 x half> @unary_v4f16(<4 x half> %a) {
371371
; MIN32-NEXT: [[R_I0:%.*]] = fneg <2 x half> [[A_I0]]
372372
; MIN32-NEXT: [[A_I1:%.*]] = shufflevector <4 x half> [[A]], <4 x half> poison, <2 x i32> <i32 2, i32 3>
373373
; MIN32-NEXT: [[R_I1:%.*]] = fneg <2 x half> [[A_I1]]
374-
; MIN32-NEXT: [[TMP1:%.*]] = shufflevector <2 x half> [[R_I0]], <2 x half> [[R_I0]], <4 x i32> <i32 0, i32 1, i32 poison, i32 poison>
375-
; MIN32-NEXT: [[TMP2:%.*]] = shufflevector <2 x half> [[R_I1]], <2 x half> [[R_I1]], <4 x i32> <i32 0, i32 1, i32 poison, i32 poison>
374+
; MIN32-NEXT: [[TMP1:%.*]] = shufflevector <2 x half> [[R_I0]], <2 x half> poison, <4 x i32> <i32 0, i32 1, i32 poison, i32 poison>
375+
; MIN32-NEXT: [[TMP2:%.*]] = shufflevector <2 x half> [[R_I1]], <2 x half> poison, <4 x i32> <i32 0, i32 1, i32 poison, i32 poison>
376376
; MIN32-NEXT: [[R:%.*]] = shufflevector <4 x half> [[TMP1]], <4 x half> [[TMP2]], <4 x i32> <i32 0, i32 1, i32 4, i32 5>
377377
; MIN32-NEXT: ret <4 x half> [[R]]
378378
;
@@ -431,7 +431,7 @@ define <3 x half> @binary_v3f16(<3 x half> %a, <3 x half> %b) {
431431
; MIN32-NEXT: [[A_I1:%.*]] = extractelement <3 x half> [[A]], i64 2
432432
; MIN32-NEXT: [[B_I1:%.*]] = extractelement <3 x half> [[B]], i64 2
433433
; MIN32-NEXT: [[R_I1:%.*]] = fadd half [[A_I1]], [[B_I1]]
434-
; MIN32-NEXT: [[TMP1:%.*]] = shufflevector <2 x half> [[R_I0]], <2 x half> [[R_I0]], <3 x i32> <i32 0, i32 1, i32 poison>
434+
; MIN32-NEXT: [[TMP1:%.*]] = shufflevector <2 x half> [[R_I0]], <2 x half> poison, <3 x i32> <i32 0, i32 1, i32 poison>
435435
; MIN32-NEXT: [[R:%.*]] = insertelement <3 x half> [[TMP1]], half [[R_I1]], i64 2
436436
; MIN32-NEXT: ret <3 x half> [[R]]
437437
;
@@ -470,8 +470,8 @@ define <4 x half> @binary_v4f16(<4 x half> %a, <4 x half> %b) {
470470
; MIN32-NEXT: [[A_I1:%.*]] = shufflevector <4 x half> [[A]], <4 x half> poison, <2 x i32> <i32 2, i32 3>
471471
; MIN32-NEXT: [[B_I1:%.*]] = shufflevector <4 x half> [[B]], <4 x half> poison, <2 x i32> <i32 2, i32 3>
472472
; MIN32-NEXT: [[R_I1:%.*]] = fadd <2 x half> [[A_I1]], [[B_I1]]
473-
; MIN32-NEXT: [[TMP1:%.*]] = shufflevector <2 x half> [[R_I0]], <2 x half> [[R_I0]], <4 x i32> <i32 0, i32 1, i32 poison, i32 poison>
474-
; MIN32-NEXT: [[TMP2:%.*]] = shufflevector <2 x half> [[R_I1]], <2 x half> [[R_I1]], <4 x i32> <i32 0, i32 1, i32 poison, i32 poison>
473+
; MIN32-NEXT: [[TMP1:%.*]] = shufflevector <2 x half> [[R_I0]], <2 x half> poison, <4 x i32> <i32 0, i32 1, i32 poison, i32 poison>
474+
; MIN32-NEXT: [[TMP2:%.*]] = shufflevector <2 x half> [[R_I1]], <2 x half> poison, <4 x i32> <i32 0, i32 1, i32 poison, i32 poison>
475475
; MIN32-NEXT: [[R:%.*]] = shufflevector <4 x half> [[TMP1]], <4 x half> [[TMP2]], <4 x i32> <i32 0, i32 1, i32 4, i32 5>
476476
; MIN32-NEXT: ret <4 x half> [[R]]
477477
;
@@ -523,7 +523,7 @@ define <3 x i16> @fptosi_v3f16(<3 x half> %a) {
523523
; MIN32-NEXT: [[R_I0:%.*]] = fptosi <2 x half> [[A_I0]] to <2 x i16>
524524
; MIN32-NEXT: [[A_I1:%.*]] = extractelement <3 x half> [[A]], i64 2
525525
; MIN32-NEXT: [[R_I1:%.*]] = fptosi half [[A_I1]] to i16
526-
; MIN32-NEXT: [[TMP1:%.*]] = shufflevector <2 x i16> [[R_I0]], <2 x i16> [[R_I0]], <3 x i32> <i32 0, i32 1, i32 poison>
526+
; MIN32-NEXT: [[TMP1:%.*]] = shufflevector <2 x i16> [[R_I0]], <2 x i16> poison, <3 x i32> <i32 0, i32 1, i32 poison>
527527
; MIN32-NEXT: [[R:%.*]] = insertelement <3 x i16> [[TMP1]], i16 [[R_I1]], i64 2
528528
; MIN32-NEXT: ret <3 x i16> [[R]]
529529
;
@@ -556,8 +556,8 @@ define <4 x i16> @fptosi_v4f16(<4 x half> %a) {
556556
; MIN32-NEXT: [[R_I0:%.*]] = fptosi <2 x half> [[A_I0]] to <2 x i16>
557557
; MIN32-NEXT: [[A_I1:%.*]] = shufflevector <4 x half> [[A]], <4 x half> poison, <2 x i32> <i32 2, i32 3>
558558
; MIN32-NEXT: [[R_I1:%.*]] = fptosi <2 x half> [[A_I1]] to <2 x i16>
559-
; MIN32-NEXT: [[TMP1:%.*]] = shufflevector <2 x i16> [[R_I0]], <2 x i16> [[R_I0]], <4 x i32> <i32 0, i32 1, i32 poison, i32 poison>
560-
; MIN32-NEXT: [[TMP2:%.*]] = shufflevector <2 x i16> [[R_I1]], <2 x i16> [[R_I1]], <4 x i32> <i32 0, i32 1, i32 poison, i32 poison>
559+
; MIN32-NEXT: [[TMP1:%.*]] = shufflevector <2 x i16> [[R_I0]], <2 x i16> poison, <4 x i32> <i32 0, i32 1, i32 poison, i32 poison>
560+
; MIN32-NEXT: [[TMP2:%.*]] = shufflevector <2 x i16> [[R_I1]], <2 x i16> poison, <4 x i32> <i32 0, i32 1, i32 poison, i32 poison>
561561
; MIN32-NEXT: [[R:%.*]] = shufflevector <4 x i16> [[TMP1]], <4 x i16> [[TMP2]], <4 x i32> <i32 0, i32 1, i32 4, i32 5>
562562
; MIN32-NEXT: ret <4 x i16> [[R]]
563563
;
@@ -804,7 +804,7 @@ define <3 x i16> @load_insertelement_v3i16(ptr %pa, i16 %b) {
804804
;
805805
; MIN32-LABEL: @load_insertelement_v3i16(
806806
; MIN32-NEXT: [[A_I0:%.*]] = load <2 x i16>, ptr [[PA:%.*]], align 8
807-
; MIN32-NEXT: [[TMP1:%.*]] = shufflevector <2 x i16> [[A_I0]], <2 x i16> [[A_I0]], <3 x i32> <i32 0, i32 1, i32 poison>
807+
; MIN32-NEXT: [[TMP1:%.*]] = shufflevector <2 x i16> [[A_I0]], <2 x i16> poison, <3 x i32> <i32 0, i32 1, i32 poison>
808808
; MIN32-NEXT: [[R:%.*]] = insertelement <3 x i16> [[TMP1]], i16 [[B:%.*]], i64 2
809809
; MIN32-NEXT: ret <3 x i16> [[R]]
810810
;
@@ -836,8 +836,8 @@ define <4 x i16> @load_insertelement_v4i16(ptr %pa, i16 %b) {
836836
; MIN32-NEXT: [[PA_I1:%.*]] = getelementptr <2 x i16>, ptr [[PA]], i32 1
837837
; MIN32-NEXT: [[A_I1:%.*]] = load <2 x i16>, ptr [[PA_I1]], align 4
838838
; MIN32-NEXT: [[TMP1:%.*]] = insertelement <2 x i16> [[A_I1]], i16 [[B:%.*]], i64 1
839-
; MIN32-NEXT: [[TMP2:%.*]] = shufflevector <2 x i16> [[A_I0]], <2 x i16> [[A_I0]], <4 x i32> <i32 0, i32 1, i32 poison, i32 poison>
840-
; MIN32-NEXT: [[TMP3:%.*]] = shufflevector <2 x i16> [[TMP1]], <2 x i16> [[TMP1]], <4 x i32> <i32 0, i32 1, i32 poison, i32 poison>
839+
; MIN32-NEXT: [[TMP2:%.*]] = shufflevector <2 x i16> [[A_I0]], <2 x i16> poison, <4 x i32> <i32 0, i32 1, i32 poison, i32 poison>
840+
; MIN32-NEXT: [[TMP3:%.*]] = shufflevector <2 x i16> [[TMP1]], <2 x i16> poison, <4 x i32> <i32 0, i32 1, i32 poison, i32 poison>
841841
; MIN32-NEXT: [[R:%.*]] = shufflevector <4 x i16> [[TMP2]], <4 x i16> [[TMP3]], <4 x i32> <i32 0, i32 1, i32 4, i32 5>
842842
; MIN32-NEXT: ret <4 x i16> [[R]]
843843
;
@@ -906,8 +906,8 @@ define void @shufflevector_shrink(ptr %pa) {
906906
; MIN32-NEXT: [[A_I0:%.*]] = load <2 x i16>, ptr [[PA:%.*]], align 8
907907
; MIN32-NEXT: [[PA_I1:%.*]] = getelementptr <2 x i16>, ptr [[PA]], i32 1
908908
; MIN32-NEXT: [[A_I1:%.*]] = load <2 x i16>, ptr [[PA_I1]], align 4
909-
; MIN32-NEXT: [[TMP1:%.*]] = shufflevector <2 x i16> [[A_I0]], <2 x i16> [[A_I0]], <4 x i32> <i32 0, i32 1, i32 poison, i32 poison>
910-
; MIN32-NEXT: [[TMP2:%.*]] = shufflevector <2 x i16> [[A_I1]], <2 x i16> [[A_I1]], <4 x i32> <i32 0, i32 1, i32 poison, i32 poison>
909+
; MIN32-NEXT: [[TMP1:%.*]] = shufflevector <2 x i16> [[A_I0]], <2 x i16> poison, <4 x i32> <i32 0, i32 1, i32 poison, i32 poison>
910+
; MIN32-NEXT: [[TMP2:%.*]] = shufflevector <2 x i16> [[A_I1]], <2 x i16> poison, <4 x i32> <i32 0, i32 1, i32 poison, i32 poison>
911911
; MIN32-NEXT: [[A:%.*]] = shufflevector <4 x i16> [[TMP1]], <4 x i16> [[TMP2]], <4 x i32> <i32 0, i32 1, i32 4, i32 5>
912912
; MIN32-NEXT: [[R:%.*]] = shufflevector <4 x i16> [[A]], <4 x i16> poison, <2 x i32> <i32 1, i32 2>
913913
; MIN32-NEXT: store <2 x i16> [[R]], ptr [[PA]], align 4
@@ -1221,7 +1221,7 @@ define <3 x half> @call_v3f16(<3 x half> %a, <3 x half> %b) {
12211221
; MIN32-NEXT: [[A_I1:%.*]] = extractelement <3 x half> [[A]], i64 2
12221222
; MIN32-NEXT: [[B_I1:%.*]] = extractelement <3 x half> [[B]], i64 2
12231223
; MIN32-NEXT: [[R_I1:%.*]] = call half @llvm.minnum.f16(half [[A_I1]], half [[B_I1]])
1224-
; MIN32-NEXT: [[TMP1:%.*]] = shufflevector <2 x half> [[R_I0]], <2 x half> [[R_I0]], <3 x i32> <i32 0, i32 1, i32 poison>
1224+
; MIN32-NEXT: [[TMP1:%.*]] = shufflevector <2 x half> [[R_I0]], <2 x half> poison, <3 x i32> <i32 0, i32 1, i32 poison>
12251225
; MIN32-NEXT: [[R:%.*]] = insertelement <3 x half> [[TMP1]], half [[R_I1]], i64 2
12261226
; MIN32-NEXT: ret <3 x half> [[R]]
12271227
;
@@ -1260,8 +1260,8 @@ define <4 x half> @call_v4f16(<4 x half> %a, <4 x half> %b) {
12601260
; MIN32-NEXT: [[A_I1:%.*]] = shufflevector <4 x half> [[A]], <4 x half> poison, <2 x i32> <i32 2, i32 3>
12611261
; MIN32-NEXT: [[B_I1:%.*]] = shufflevector <4 x half> [[B]], <4 x half> poison, <2 x i32> <i32 2, i32 3>
12621262
; MIN32-NEXT: [[R_I1:%.*]] = call <2 x half> @llvm.minnum.v2f16(<2 x half> [[A_I1]], <2 x half> [[B_I1]])
1263-
; MIN32-NEXT: [[TMP1:%.*]] = shufflevector <2 x half> [[R_I0]], <2 x half> [[R_I0]], <4 x i32> <i32 0, i32 1, i32 poison, i32 poison>
1264-
; MIN32-NEXT: [[TMP2:%.*]] = shufflevector <2 x half> [[R_I1]], <2 x half> [[R_I1]], <4 x i32> <i32 0, i32 1, i32 poison, i32 poison>
1263+
; MIN32-NEXT: [[TMP1:%.*]] = shufflevector <2 x half> [[R_I0]], <2 x half> poison, <4 x i32> <i32 0, i32 1, i32 poison, i32 poison>
1264+
; MIN32-NEXT: [[TMP2:%.*]] = shufflevector <2 x half> [[R_I1]], <2 x half> poison, <4 x i32> <i32 0, i32 1, i32 poison, i32 poison>
12651265
; MIN32-NEXT: [[R:%.*]] = shufflevector <4 x half> [[TMP1]], <4 x half> [[TMP2]], <4 x i32> <i32 0, i32 1, i32 4, i32 5>
12661266
; MIN32-NEXT: ret <4 x half> [[R]]
12671267
;
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
2+
; RUN: opt %s -passes="scalarizer<min-bits=32>" -S | FileCheck %s
3+
4+
define void @vector_scalar_not_aligned(ptr addrspace(1) %arg0, ptr addrspace(1) %arg1) {
5+
; CHECK-LABEL: @vector_scalar_not_aligned(
6+
; CHECK-NEXT: [[VAL1:%.*]] = load <35 x i32>, ptr addrspace(1) [[ARG_0:%.*]], align 4
7+
; CHECK-NEXT: [[VAL2:%.*]] = load <35 x i32>, ptr addrspace(1) [[ARG_1:%.*]], align 4
8+
; CHECK-NEXT: [[BOOLVEC1:%.*]] = icmp ne <35 x i32> [[VAL1]], zeroinitializer
9+
; CHECK-NEXT: [[BOOLVEC1_I0:%.*]] = shufflevector <35 x i1> [[BOOLVEC1]], <35 x i1> poison, <32 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 10, i32 11, i32 12, i32 13, i32 14, i32 15, i32 16, i32 17, i32 18, i32 19, i32 20, i32 21, i32 22, i32 23, i32 24, i32 25, i32 26, i32 27, i32 28, i32 29, i32 30, i32 31>
10+
; CHECK-NEXT: [[BOOLVEC1_I1:%.*]] = shufflevector <35 x i1> [[BOOLVEC1]], <35 x i1> poison, <3 x i32> <i32 32, i32 33, i32 34>
11+
; CHECK-NEXT: [[BOOLVEC2:%.*]] = icmp ne <35 x i32> [[VAL2]], zeroinitializer
12+
; CHECK-NEXT: [[BOOLVEC2_I0:%.*]] = shufflevector <35 x i1> [[BOOLVEC2]], <35 x i1> poison, <32 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 10, i32 11, i32 12, i32 13, i32 14, i32 15, i32 16, i32 17, i32 18, i32 19, i32 20, i32 21, i32 22, i32 23, i32 24, i32 25, i32 26, i32 27, i32 28, i32 29, i32 30, i32 31>
13+
; CHECK-NEXT: [[BOOLRESULT_I0:%.*]] = xor <32 x i1> [[BOOLVEC1_I0]], [[BOOLVEC2_I0]]
14+
; CHECK-NEXT: [[BOOLVEC2_I1:%.*]] = shufflevector <35 x i1> [[BOOLVEC2]], <35 x i1> poison, <3 x i32> <i32 32, i32 33, i32 34>
15+
; CHECK-NEXT: [[BOOLRESULT_I1:%.*]] = xor <3 x i1> [[BOOLVEC1_I1]], [[BOOLVEC2_I1]]
16+
; CHECK-NEXT: [[INST1:%.*]] = shufflevector <32 x i1> [[BOOLRESULT_I0]], <32 x i1> poison, <35 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 10, i32 11, i32 12, i32 13, i32 14, i32 15, i32 16, i32 17, i32 18, i32 19, i32 20, i32 21, i32 22, i32 23, i32 24, i32 25, i32 26, i32 27, i32 28, i32 29, i32 30, i32 31, i32 poison, i32 poison, i32 poison>
17+
; CHECK-NEXT: [[INST2:%.*]] = shufflevector <3 x i1> [[BOOLRESULT_I1]], <3 x i1> poison, <35 x i32> <i32 0, i32 1, i32 2, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison, i32 poison>
18+
; CHECK-NEXT: [[BOOLRESULT:%.*]] = shufflevector <35 x i1> [[INST1]], <35 x i1> [[INST2]], <35 x i32> <i32 0, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 10, i32 11, i32 12, i32 13, i32 14, i32 15, i32 16, i32 17, i32 18, i32 19, i32 20, i32 21, i32 22, i32 23, i32 24, i32 25, i32 26, i32 27, i32 28, i32 29, i32 30, i32 31, i32 35, i32 36, i32 37>
19+
; CHECK-NEXT: [[EXT:%.*]] = zext <35 x i1> [[BOOLRESULT]] to <35 x i32>
20+
; CHECK-NEXT: ret void
21+
22+
%val1 = load <35 x i32>, ptr addrspace(1) %arg0, align 4
23+
%val2 = load <35 x i32>, ptr addrspace(1) %arg1, align 4
24+
%boolVec1 = icmp ne <35 x i32> %val1, zeroinitializer
25+
%boolVec2 = icmp ne <35 x i32> %val2, zeroinitializer
26+
%boolResult = xor <35 x i1> %boolVec1, %boolVec2
27+
%ext = zext <35 x i1> %boolResult to <35 x i32>
28+
ret void
29+
}

0 commit comments

Comments
 (0)