Skip to content

Commit c8c0b18

Browse files
committed
[LV] Update tests to not have dead interleave groups.
Update existing tests with dead interleave groups by adding users. This ensures the tests keep testing what they were intended to test with a planned change to skip unused instructions in cost computations.
1 parent f6eb89c commit c8c0b18

File tree

5 files changed

+389
-387
lines changed

5 files changed

+389
-387
lines changed

llvm/test/Transforms/LoopVectorize/AArch64/interleaved_cost.ll

Lines changed: 38 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -15,21 +15,21 @@ entry:
1515
; VF_8-LABEL: Checking a loop in 'i8_factor_2'
1616
; VF_8: Found an estimated cost of 2 for VF 8 For instruction: %tmp2 = load i8, ptr %tmp0, align 1
1717
; VF_8-NEXT: Found an estimated cost of 0 for VF 8 For instruction: %tmp3 = load i8, ptr %tmp1, align 1
18-
; VF_8-NEXT: Found an estimated cost of 0 for VF 8 For instruction: store i8 0, ptr %tmp0, align 1
19-
; VF_8-NEXT: Found an estimated cost of 2 for VF 8 For instruction: store i8 0, ptr %tmp1, align 1
18+
; VF_8-NEXT: Found an estimated cost of 0 for VF 8 For instruction: store i8 %tmp2, ptr %tmp0, align 1
19+
; VF_8-NEXT: Found an estimated cost of 2 for VF 8 For instruction: store i8 %tmp3, ptr %tmp1, align 1
2020
; VF_16-LABEL: Checking a loop in 'i8_factor_2'
2121
; VF_16: Found an estimated cost of 2 for VF 16 For instruction: %tmp2 = load i8, ptr %tmp0, align 1
2222
; VF_16-NEXT: Found an estimated cost of 0 for VF 16 For instruction: %tmp3 = load i8, ptr %tmp1, align 1
23-
; VF_16-NEXT: Found an estimated cost of 0 for VF 16 For instruction: store i8 0, ptr %tmp0, align 1
24-
; VF_16-NEXT: Found an estimated cost of 2 for VF 16 For instruction: store i8 0, ptr %tmp1, align 1
23+
; VF_16-NEXT: Found an estimated cost of 0 for VF 16 For instruction: store i8 %tmp2, ptr %tmp0, align 1
24+
; VF_16-NEXT: Found an estimated cost of 2 for VF 16 For instruction: store i8 %tmp3, ptr %tmp1, align 1
2525
for.body:
2626
%i = phi i64 [ 0, %entry ], [ %i.next, %for.body ]
2727
%tmp0 = getelementptr inbounds %i8.2, ptr %data, i64 %i, i32 0
2828
%tmp1 = getelementptr inbounds %i8.2, ptr %data, i64 %i, i32 1
2929
%tmp2 = load i8, ptr %tmp0, align 1
3030
%tmp3 = load i8, ptr %tmp1, align 1
31-
store i8 0, ptr %tmp0, align 1
32-
store i8 0, ptr %tmp1, align 1
31+
store i8 %tmp2, ptr %tmp0, align 1
32+
store i8 %tmp3, ptr %tmp1, align 1
3333
%i.next = add nuw nsw i64 %i, 1
3434
%cond = icmp slt i64 %i.next, %n
3535
br i1 %cond, label %for.body, label %for.end
@@ -46,26 +46,26 @@ entry:
4646
; VF_4-LABEL: Checking a loop in 'i16_factor_2'
4747
; VF_4: Found an estimated cost of 2 for VF 4 For instruction: %tmp2 = load i16, ptr %tmp0, align 2
4848
; VF_4-NEXT: Found an estimated cost of 0 for VF 4 For instruction: %tmp3 = load i16, ptr %tmp1, align 2
49-
; VF_4-NEXT: Found an estimated cost of 0 for VF 4 For instruction: store i16 0, ptr %tmp0, align 2
50-
; VF_4-NEXT: Found an estimated cost of 2 for VF 4 For instruction: store i16 0, ptr %tmp1, align 2
49+
; VF_4-NEXT: Found an estimated cost of 0 for VF 4 For instruction: store i16 %tmp2, ptr %tmp0, align 2
50+
; VF_4-NEXT: Found an estimated cost of 2 for VF 4 For instruction: store i16 %tmp3, ptr %tmp1, align 2
5151
; VF_8-LABEL: Checking a loop in 'i16_factor_2'
5252
; VF_8: Found an estimated cost of 2 for VF 8 For instruction: %tmp2 = load i16, ptr %tmp0, align 2
5353
; VF_8-NEXT: Found an estimated cost of 0 for VF 8 For instruction: %tmp3 = load i16, ptr %tmp1, align 2
54-
; VF_8-NEXT: Found an estimated cost of 0 for VF 8 For instruction: store i16 0, ptr %tmp0, align 2
55-
; VF_8-NEXT: Found an estimated cost of 2 for VF 8 For instruction: store i16 0, ptr %tmp1, align 2
54+
; VF_8-NEXT: Found an estimated cost of 0 for VF 8 For instruction: store i16 %tmp2, ptr %tmp0, align 2
55+
; VF_8-NEXT: Found an estimated cost of 2 for VF 8 For instruction: store i16 %tmp3, ptr %tmp1, align 2
5656
; VF_16-LABEL: Checking a loop in 'i16_factor_2'
5757
; VF_16: Found an estimated cost of 4 for VF 16 For instruction: %tmp2 = load i16, ptr %tmp0, align 2
5858
; VF_16-NEXT: Found an estimated cost of 0 for VF 16 For instruction: %tmp3 = load i16, ptr %tmp1, align 2
59-
; VF_16-NEXT: Found an estimated cost of 0 for VF 16 For instruction: store i16 0, ptr %tmp0, align 2
60-
; VF_16-NEXT: Found an estimated cost of 4 for VF 16 For instruction: store i16 0, ptr %tmp1, align 2
59+
; VF_16-NEXT: Found an estimated cost of 0 for VF 16 For instruction: store i16 %tmp2, ptr %tmp0, align 2
60+
; VF_16-NEXT: Found an estimated cost of 4 for VF 16 For instruction: store i16 %tmp3, ptr %tmp1, align 2
6161
for.body:
6262
%i = phi i64 [ 0, %entry ], [ %i.next, %for.body ]
6363
%tmp0 = getelementptr inbounds %i16.2, ptr %data, i64 %i, i32 0
6464
%tmp1 = getelementptr inbounds %i16.2, ptr %data, i64 %i, i32 1
6565
%tmp2 = load i16, ptr %tmp0, align 2
6666
%tmp3 = load i16, ptr %tmp1, align 2
67-
store i16 0, ptr %tmp0, align 2
68-
store i16 0, ptr %tmp1, align 2
67+
store i16 %tmp2, ptr %tmp0, align 2
68+
store i16 %tmp3, ptr %tmp1, align 2
6969
%i.next = add nuw nsw i64 %i, 1
7070
%cond = icmp slt i64 %i.next, %n
7171
br i1 %cond, label %for.body, label %for.end
@@ -82,31 +82,31 @@ entry:
8282
; VF_2-LABEL: Checking a loop in 'i32_factor_2'
8383
; VF_2: Found an estimated cost of 2 for VF 2 For instruction: %tmp2 = load i32, ptr %tmp0, align 4
8484
; VF_2-NEXT: Found an estimated cost of 0 for VF 2 For instruction: %tmp3 = load i32, ptr %tmp1, align 4
85-
; VF_2-NEXT: Found an estimated cost of 0 for VF 2 For instruction: store i32 0, ptr %tmp0, align 4
86-
; VF_2-NEXT: Found an estimated cost of 2 for VF 2 For instruction: store i32 0, ptr %tmp1, align 4
85+
; VF_2-NEXT: Found an estimated cost of 0 for VF 2 For instruction: store i32 %tmp2, ptr %tmp0, align 4
86+
; VF_2-NEXT: Found an estimated cost of 2 for VF 2 For instruction: store i32 %tmp3, ptr %tmp1, align 4
8787
; VF_4-LABEL: Checking a loop in 'i32_factor_2'
8888
; VF_4: Found an estimated cost of 2 for VF 4 For instruction: %tmp2 = load i32, ptr %tmp0, align 4
8989
; VF_4-NEXT: Found an estimated cost of 0 for VF 4 For instruction: %tmp3 = load i32, ptr %tmp1, align 4
90-
; VF_4-NEXT: Found an estimated cost of 0 for VF 4 For instruction: store i32 0, ptr %tmp0, align 4
91-
; VF_4-NEXT: Found an estimated cost of 2 for VF 4 For instruction: store i32 0, ptr %tmp1, align 4
90+
; VF_4-NEXT: Found an estimated cost of 0 for VF 4 For instruction: store i32 %tmp2, ptr %tmp0, align 4
91+
; VF_4-NEXT: Found an estimated cost of 2 for VF 4 For instruction: store i32 %tmp3, ptr %tmp1, align 4
9292
; VF_8-LABEL: Checking a loop in 'i32_factor_2'
9393
; VF_8: Found an estimated cost of 4 for VF 8 For instruction: %tmp2 = load i32, ptr %tmp0, align 4
9494
; VF_8-NEXT: Found an estimated cost of 0 for VF 8 For instruction: %tmp3 = load i32, ptr %tmp1, align 4
95-
; VF_8-NEXT: Found an estimated cost of 0 for VF 8 For instruction: store i32 0, ptr %tmp0, align 4
96-
; VF_8-NEXT: Found an estimated cost of 4 for VF 8 For instruction: store i32 0, ptr %tmp1, align 4
95+
; VF_8-NEXT: Found an estimated cost of 0 for VF 8 For instruction: store i32 %tmp2, ptr %tmp0, align 4
96+
; VF_8-NEXT: Found an estimated cost of 4 for VF 8 For instruction: store i32 %tmp3, ptr %tmp1, align 4
9797
; VF_16-LABEL: Checking a loop in 'i32_factor_2'
9898
; VF_16: Found an estimated cost of 8 for VF 16 For instruction: %tmp2 = load i32, ptr %tmp0, align 4
9999
; VF_16-NEXT: Found an estimated cost of 0 for VF 16 For instruction: %tmp3 = load i32, ptr %tmp1, align 4
100-
; VF_16-NEXT: Found an estimated cost of 0 for VF 16 For instruction: store i32 0, ptr %tmp0, align 4
101-
; VF_16-NEXT: Found an estimated cost of 8 for VF 16 For instruction: store i32 0, ptr %tmp1, align 4
100+
; VF_16-NEXT: Found an estimated cost of 0 for VF 16 For instruction: store i32 %tmp2, ptr %tmp0, align 4
101+
; VF_16-NEXT: Found an estimated cost of 8 for VF 16 For instruction: store i32 %tmp3, ptr %tmp1, align 4
102102
for.body:
103103
%i = phi i64 [ 0, %entry ], [ %i.next, %for.body ]
104104
%tmp0 = getelementptr inbounds %i32.2, ptr %data, i64 %i, i32 0
105105
%tmp1 = getelementptr inbounds %i32.2, ptr %data, i64 %i, i32 1
106106
%tmp2 = load i32, ptr %tmp0, align 4
107107
%tmp3 = load i32, ptr %tmp1, align 4
108-
store i32 0, ptr %tmp0, align 4
109-
store i32 0, ptr %tmp1, align 4
108+
store i32 %tmp2, ptr %tmp0, align 4
109+
store i32 %tmp3, ptr %tmp1, align 4
110110
%i.next = add nuw nsw i64 %i, 1
111111
%cond = icmp slt i64 %i.next, %n
112112
br i1 %cond, label %for.body, label %for.end
@@ -123,31 +123,31 @@ entry:
123123
; VF_2-LABEL: Checking a loop in 'i64_factor_2'
124124
; VF_2: Found an estimated cost of 2 for VF 2 For instruction: %tmp2 = load i64, ptr %tmp0, align 8
125125
; VF_2-NEXT: Found an estimated cost of 0 for VF 2 For instruction: %tmp3 = load i64, ptr %tmp1, align 8
126-
; VF_2-NEXT: Found an estimated cost of 0 for VF 2 For instruction: store i64 0, ptr %tmp0, align 8
127-
; VF_2-NEXT: Found an estimated cost of 2 for VF 2 For instruction: store i64 0, ptr %tmp1, align 8
126+
; VF_2-NEXT: Found an estimated cost of 0 for VF 2 For instruction: store i64 %tmp2, ptr %tmp0, align 8
127+
; VF_2-NEXT: Found an estimated cost of 2 for VF 2 For instruction: store i64 %tmp3, ptr %tmp1, align 8
128128
; VF_4-LABEL: Checking a loop in 'i64_factor_2'
129129
; VF_4: Found an estimated cost of 4 for VF 4 For instruction: %tmp2 = load i64, ptr %tmp0, align 8
130130
; VF_4-NEXT: Found an estimated cost of 0 for VF 4 For instruction: %tmp3 = load i64, ptr %tmp1, align 8
131-
; VF_4-NEXT: Found an estimated cost of 0 for VF 4 For instruction: store i64 0, ptr %tmp0, align 8
132-
; VF_4-NEXT: Found an estimated cost of 4 for VF 4 For instruction: store i64 0, ptr %tmp1, align 8
131+
; VF_4-NEXT: Found an estimated cost of 0 for VF 4 For instruction: store i64 %tmp2, ptr %tmp0, align 8
132+
; VF_4-NEXT: Found an estimated cost of 4 for VF 4 For instruction: store i64 %tmp3, ptr %tmp1, align 8
133133
; VF_8-LABEL: Checking a loop in 'i64_factor_2'
134134
; VF_8: Found an estimated cost of 8 for VF 8 For instruction: %tmp2 = load i64, ptr %tmp0, align 8
135135
; VF_8-NEXT: Found an estimated cost of 0 for VF 8 For instruction: %tmp3 = load i64, ptr %tmp1, align 8
136-
; VF_8-NEXT: Found an estimated cost of 0 for VF 8 For instruction: store i64 0, ptr %tmp0, align 8
137-
; VF_8-NEXT: Found an estimated cost of 8 for VF 8 For instruction: store i64 0, ptr %tmp1, align 8
136+
; VF_8-NEXT: Found an estimated cost of 0 for VF 8 For instruction: store i64 %tmp2, ptr %tmp0, align 8
137+
; VF_8-NEXT: Found an estimated cost of 8 for VF 8 For instruction: store i64 %tmp3, ptr %tmp1, align 8
138138
; VF_16-LABEL: Checking a loop in 'i64_factor_2'
139139
; VF_16: Found an estimated cost of 16 for VF 16 For instruction: %tmp2 = load i64, ptr %tmp0, align 8
140140
; VF_16-NEXT: Found an estimated cost of 0 for VF 16 For instruction: %tmp3 = load i64, ptr %tmp1, align 8
141-
; VF_16-NEXT: Found an estimated cost of 0 for VF 16 For instruction: store i64 0, ptr %tmp0, align 8
142-
; VF_16-NEXT: Found an estimated cost of 16 for VF 16 For instruction: store i64 0, ptr %tmp1, align 8
141+
; VF_16-NEXT: Found an estimated cost of 0 for VF 16 For instruction: store i64 %tmp2, ptr %tmp0, align 8
142+
; VF_16-NEXT: Found an estimated cost of 16 for VF 16 For instruction: store i64 %tmp3, ptr %tmp1, align 8
143143
for.body:
144144
%i = phi i64 [ 0, %entry ], [ %i.next, %for.body ]
145145
%tmp0 = getelementptr inbounds %i64.2, ptr %data, i64 %i, i32 0
146146
%tmp1 = getelementptr inbounds %i64.2, ptr %data, i64 %i, i32 1
147147
%tmp2 = load i64, ptr %tmp0, align 8
148148
%tmp3 = load i64, ptr %tmp1, align 8
149-
store i64 0, ptr %tmp0, align 8
150-
store i64 0, ptr %tmp1, align 8
149+
store i64 %tmp2, ptr %tmp0, align 8
150+
store i64 %tmp3, ptr %tmp1, align 8
151151
%i.next = add nuw nsw i64 %i, 1
152152
%cond = icmp slt i64 %i.next, %n
153153
br i1 %cond, label %for.body, label %for.end
@@ -170,16 +170,16 @@ entry:
170170
; VF_2-LABEL: Checking a loop in 'i64_factor_8'
171171
; VF_2: Found an estimated cost of 16 for VF 2 For instruction: %tmp2 = load i64, ptr %tmp0, align 8
172172
; VF_2-NEXT: Found an estimated cost of 0 for VF 2 For instruction: %tmp3 = load i64, ptr %tmp1, align 8
173-
; VF_2-NEXT: Found an estimated cost of 8 for VF 2 For instruction: store i64 0, ptr %tmp0, align 8
174-
; VF_2-NEXT: Found an estimated cost of 8 for VF 2 For instruction: store i64 0, ptr %tmp1, align 8
173+
; VF_2-NEXT: Found an estimated cost of 12 for VF 2 For instruction: store i64 %tmp2, ptr %tmp0, align 8
174+
; VF_2-NEXT: Found an estimated cost of 12 for VF 2 For instruction: store i64 %tmp3, ptr %tmp1, align 8
175175
for.body:
176176
%i = phi i64 [ 0, %entry ], [ %i.next, %for.body ]
177177
%tmp0 = getelementptr inbounds %i64.8, ptr %data, i64 %i, i32 2
178178
%tmp1 = getelementptr inbounds %i64.8, ptr %data, i64 %i, i32 6
179179
%tmp2 = load i64, ptr %tmp0, align 8
180180
%tmp3 = load i64, ptr %tmp1, align 8
181-
store i64 0, ptr %tmp0, align 8
182-
store i64 0, ptr %tmp1, align 8
181+
store i64 %tmp2, ptr %tmp0, align 8
182+
store i64 %tmp3, ptr %tmp1, align 8
183183
%i.next = add nuw nsw i64 %i, 1
184184
%cond = icmp slt i64 %i.next, %n
185185
br i1 %cond, label %for.body, label %for.end

0 commit comments

Comments
 (0)