Skip to content

Commit df1c8ba

Browse files
committed
[RISCV][CostModel] Add additional deinterleave tests with EMUL>1
1 parent 1440f02 commit df1c8ba

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

llvm/test/Analysis/CostModel/RISCV/shuffle-interleave.ll

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,3 +68,33 @@ define {<4 x i8>, <4 x i8>} @deinterleave_2(<8 x i8> %v) {
6868
%res1 = insertvalue {<4 x i8>, <4 x i8>} %res0, <4 x i8> %v1, 1
6969
ret {<4 x i8>, <4 x i8>} %res1
7070
}
71+
72+
define {<4 x i32>, <4 x i32>} @deinterleave_2_m1_dest(<8 x i32> %v) {
73+
; CHECK-LABEL: 'deinterleave_2_m1_dest'
74+
; CHECK-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %v0 = shufflevector <8 x i32> %v, <8 x i32> poison, <4 x i32> <i32 0, i32 2, i32 4, i32 6>
75+
; CHECK-NEXT: Cost Model: Found an estimated cost of 8 for instruction: %v1 = shufflevector <8 x i32> %v, <8 x i32> poison, <4 x i32> <i32 1, i32 3, i32 5, i32 7>
76+
; CHECK-NEXT: Cost Model: Found an estimated cost of -1 for instruction: %res0 = insertvalue { <4 x i32>, <4 x i32> } poison, <4 x i32> %v0, 0
77+
; CHECK-NEXT: Cost Model: Found an estimated cost of -1 for instruction: %res1 = insertvalue { <4 x i32>, <4 x i32> } %res0, <4 x i32> %v1, 1
78+
; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret { <4 x i32>, <4 x i32> } %res1
79+
;
80+
%v0 = shufflevector <8 x i32> %v, <8 x i32> poison, <4 x i32> <i32 0, i32 2, i32 4, i32 6>
81+
%v1 = shufflevector <8 x i32> %v, <8 x i32> poison, <4 x i32> <i32 1, i32 3, i32 5, i32 7>
82+
%res0 = insertvalue {<4 x i32>, <4 x i32>} poison, <4 x i32> %v0, 0
83+
%res1 = insertvalue {<4 x i32>, <4 x i32>} %res0, <4 x i32> %v1, 1
84+
ret {<4 x i32>, <4 x i32>} %res1
85+
}
86+
87+
define {<8 x i32>, <8 x i32>} @deinterleave_2_m2_dest(<16 x i32> %v) {
88+
; CHECK-LABEL: 'deinterleave_2_m2_dest'
89+
; CHECK-NEXT: Cost Model: Found an estimated cost of 22 for instruction: %v0 = shufflevector <16 x i32> %v, <16 x i32> poison, <8 x i32> <i32 0, i32 2, i32 4, i32 6, i32 8, i32 10, i32 12, i32 14>
90+
; CHECK-NEXT: Cost Model: Found an estimated cost of 22 for instruction: %v1 = shufflevector <16 x i32> %v, <16 x i32> poison, <8 x i32> <i32 1, i32 3, i32 5, i32 7, i32 9, i32 11, i32 13, i32 15>
91+
; CHECK-NEXT: Cost Model: Found an estimated cost of -1 for instruction: %res0 = insertvalue { <8 x i32>, <8 x i32> } poison, <8 x i32> %v0, 0
92+
; CHECK-NEXT: Cost Model: Found an estimated cost of -1 for instruction: %res1 = insertvalue { <8 x i32>, <8 x i32> } %res0, <8 x i32> %v1, 1
93+
; CHECK-NEXT: Cost Model: Found an estimated cost of 0 for instruction: ret { <8 x i32>, <8 x i32> } %res1
94+
;
95+
%v0 = shufflevector <16 x i32> %v, <16 x i32> poison, <8 x i32> <i32 0, i32 2, i32 4, i32 6, i32 8, i32 10, i32 12, i32 14>
96+
%v1 = shufflevector <16 x i32> %v, <16 x i32> poison, <8 x i32> <i32 1, i32 3, i32 5, i32 7, i32 9, i32 11, i32 13, i32 15>
97+
%res0 = insertvalue {<8 x i32>, <8 x i32>} poison, <8 x i32> %v0, 0
98+
%res1 = insertvalue {<8 x i32>, <8 x i32>} %res0, <8 x i32> %v1, 1
99+
ret {<8 x i32>, <8 x i32>} %res1
100+
}

0 commit comments

Comments
 (0)