vector-reduce.ll
11.2 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
; RUN: opt < %s -mtriple=aarch64--linux-gnu -cost-model -analyze | FileCheck %s --check-prefix=COST
; RUN: llc < %s -mtriple=aarch64--linux-gnu | FileCheck %s --check-prefix=CODE
; COST-LABEL: add.i8.v8i8
; COST: Found an estimated cost of 1 for instruction: %r = call i8 @llvm.experimental.vector.reduce.add.v8i8(<8 x i8> %v)
; CODE-LABEL: add.i8.v8i8
; CODE: addv b0, v0.8b
define i8 @add.i8.v8i8(<8 x i8> %v) {
%r = call i8 @llvm.experimental.vector.reduce.add.v8i8(<8 x i8> %v)
ret i8 %r
}
; COST-LABEL: add.i8.v16i8
; COST: Found an estimated cost of 1 for instruction: %r = call i8 @llvm.experimental.vector.reduce.add.v16i8(<16 x i8> %v)
; CODE-LABEL: add.i8.v16i8
; CODE: addv b0, v0.16b
define i8 @add.i8.v16i8(<16 x i8> %v) {
%r = call i8 @llvm.experimental.vector.reduce.add.v16i8(<16 x i8> %v)
ret i8 %r
}
; COST-LABEL: add.i16.v4i16
; COST: Found an estimated cost of 1 for instruction: %r = call i16 @llvm.experimental.vector.reduce.add.v4i16(<4 x i16> %v)
; CODE-LABEL: add.i16.v4i16
; CODE: addv h0, v0.4h
define i16 @add.i16.v4i16(<4 x i16> %v) {
%r = call i16 @llvm.experimental.vector.reduce.add.v4i16(<4 x i16> %v)
ret i16 %r
}
; COST-LABEL: add.i16.v8i16
; COST: Found an estimated cost of 1 for instruction: %r = call i16 @llvm.experimental.vector.reduce.add.v8i16(<8 x i16> %v)
; CODE-LABEL: add.i16.v8i16
; CODE: addv h0, v0.8h
define i16 @add.i16.v8i16(<8 x i16> %v) {
%r = call i16 @llvm.experimental.vector.reduce.add.v8i16(<8 x i16> %v)
ret i16 %r
}
; COST-LABEL: add.i32.v4i32
; COST: Found an estimated cost of 1 for instruction: %r = call i32 @llvm.experimental.vector.reduce.add.v4i32(<4 x i32> %v)
; CODE-LABEL: add.i32.v4i32
; CODE: addv s0, v0.4s
define i32 @add.i32.v4i32(<4 x i32> %v) {
%r = call i32 @llvm.experimental.vector.reduce.add.v4i32(<4 x i32> %v)
ret i32 %r
}
; COST-LABEL: umin.i8.v8i8
; COST: Found an estimated cost of 216 for instruction: %r = call i8 @llvm.experimental.vector.reduce.umin.v8i8(<8 x i8> %v)
; CODE-LABEL: umin.i8.v8i8
; CODE: uminv b0, v0.8b
define i8 @umin.i8.v8i8(<8 x i8> %v) {
%r = call i8 @llvm.experimental.vector.reduce.umin.v8i8(<8 x i8> %v)
ret i8 %r
}
; COST-LABEL: umin.i8.v16i8
; COST: Found an estimated cost of 608 for instruction: %r = call i8 @llvm.experimental.vector.reduce.umin.v16i8(<16 x i8> %v)
; CODE-LABEL: umin.i8.v16i8
; CODE: uminv b0, v0.16b
define i8 @umin.i8.v16i8(<16 x i8> %v) {
%r = call i8 @llvm.experimental.vector.reduce.umin.v16i8(<16 x i8> %v)
ret i8 %r
}
; COST-LABEL: umin.i16.v4i16
; COST: Found an estimated cost of 64 for instruction: %r = call i16 @llvm.experimental.vector.reduce.umin.v4i16(<4 x i16> %v)
; CODE-LABEL: umin.i16.v4i16
; CODE: uminv h0, v0.4h
define i16 @umin.i16.v4i16(<4 x i16> %v) {
%r = call i16 @llvm.experimental.vector.reduce.umin.v4i16(<4 x i16> %v)
ret i16 %r
}
; COST-LABEL: umin.i16.v8i16
; COST: Found an estimated cost of 216 for instruction: %r = call i16 @llvm.experimental.vector.reduce.umin.v8i16(<8 x i16> %v)
; CODE-LABEL: umin.i16.v8i16
; CODE: uminv h0, v0.8h
define i16 @umin.i16.v8i16(<8 x i16> %v) {
%r = call i16 @llvm.experimental.vector.reduce.umin.v8i16(<8 x i16> %v)
ret i16 %r
}
; COST-LABEL: umin.i32.v4i32
; COST: Found an estimated cost of 34 for instruction: %r = call i32 @llvm.experimental.vector.reduce.umin.v4i32(<4 x i32> %v)
; CODE-LABEL: umin.i32.v4i32
; CODE: uminv s0, v0.4s
define i32 @umin.i32.v4i32(<4 x i32> %v) {
%r = call i32 @llvm.experimental.vector.reduce.umin.v4i32(<4 x i32> %v)
ret i32 %r
}
; COST-LABEL: umax.i8.v8i8
; COST: Found an estimated cost of 216 for instruction: %r = call i8 @llvm.experimental.vector.reduce.umax.v8i8(<8 x i8> %v)
; CODE-LABEL: umax.i8.v8i8
; CODE: umaxv b0, v0.8b
define i8 @umax.i8.v8i8(<8 x i8> %v) {
%r = call i8 @llvm.experimental.vector.reduce.umax.v8i8(<8 x i8> %v)
ret i8 %r
}
; COST-LABEL: umax.i8.v16i8
; COST: Found an estimated cost of 608 for instruction: %r = call i8 @llvm.experimental.vector.reduce.umax.v16i8(<16 x i8> %v)
; CODE-LABEL: umax.i8.v16i8
; CODE: umaxv b0, v0.16b
define i8 @umax.i8.v16i8(<16 x i8> %v) {
%r = call i8 @llvm.experimental.vector.reduce.umax.v16i8(<16 x i8> %v)
ret i8 %r
}
; COST-LABEL: umax.i16.v4i16
; COST: Found an estimated cost of 64 for instruction: %r = call i16 @llvm.experimental.vector.reduce.umax.v4i16(<4 x i16> %v)
; CODE-LABEL: umax.i16.v4i16
; CODE: umaxv h0, v0.4h
define i16 @umax.i16.v4i16(<4 x i16> %v) {
%r = call i16 @llvm.experimental.vector.reduce.umax.v4i16(<4 x i16> %v)
ret i16 %r
}
; COST-LABEL: umax.i16.v8i16
; COST: Found an estimated cost of 216 for instruction: %r = call i16 @llvm.experimental.vector.reduce.umax.v8i16(<8 x i16> %v)
; CODE-LABEL: umax.i16.v8i16
; CODE: umaxv h0, v0.8h
define i16 @umax.i16.v8i16(<8 x i16> %v) {
%r = call i16 @llvm.experimental.vector.reduce.umax.v8i16(<8 x i16> %v)
ret i16 %r
}
; COST-LABEL: umax.i32.v4i32
; COST: Found an estimated cost of 34 for instruction: %r = call i32 @llvm.experimental.vector.reduce.umax.v4i32(<4 x i32> %v)
; CODE-LABEL: umax.i32.v4i32
; CODE: umaxv s0, v0.4s
define i32 @umax.i32.v4i32(<4 x i32> %v) {
%r = call i32 @llvm.experimental.vector.reduce.umax.v4i32(<4 x i32> %v)
ret i32 %r
}
; COST-LABEL: smin.i8.v8i8
; COST: Found an estimated cost of 216 for instruction: %r = call i8 @llvm.experimental.vector.reduce.smin.v8i8(<8 x i8> %v)
; CODE-LABEL: smin.i8.v8i8
; CODE: sminv b0, v0.8b
define i8 @smin.i8.v8i8(<8 x i8> %v) {
%r = call i8 @llvm.experimental.vector.reduce.smin.v8i8(<8 x i8> %v)
ret i8 %r
}
; COST-LABEL: smin.i8.v16i8
; COST: Found an estimated cost of 608 for instruction: %r = call i8 @llvm.experimental.vector.reduce.smin.v16i8(<16 x i8> %v)
; CODE-LABEL: smin.i8.v16i8
; CODE: sminv b0, v0.16b
define i8 @smin.i8.v16i8(<16 x i8> %v) {
%r = call i8 @llvm.experimental.vector.reduce.smin.v16i8(<16 x i8> %v)
ret i8 %r
}
; COST-LABEL: smin.i16.v4i16
; COST: Found an estimated cost of 64 for instruction: %r = call i16 @llvm.experimental.vector.reduce.smin.v4i16(<4 x i16> %v)
; CODE-LABEL: smin.i16.v4i16
; CODE: sminv h0, v0.4h
define i16 @smin.i16.v4i16(<4 x i16> %v) {
%r = call i16 @llvm.experimental.vector.reduce.smin.v4i16(<4 x i16> %v)
ret i16 %r
}
; COST-LABEL: smin.i16.v8i16
; COST: Found an estimated cost of 216 for instruction: %r = call i16 @llvm.experimental.vector.reduce.smin.v8i16(<8 x i16> %v)
; CODE-LABEL: smin.i16.v8i16
; CODE: sminv h0, v0.8h
define i16 @smin.i16.v8i16(<8 x i16> %v) {
%r = call i16 @llvm.experimental.vector.reduce.smin.v8i16(<8 x i16> %v)
ret i16 %r
}
; COST-LABEL: smin.i32.v4i32
; COST: Found an estimated cost of 34 for instruction: %r = call i32 @llvm.experimental.vector.reduce.smin.v4i32(<4 x i32> %v)
; CODE-LABEL: smin.i32.v4i32
; CODE: sminv s0, v0.4s
define i32 @smin.i32.v4i32(<4 x i32> %v) {
%r = call i32 @llvm.experimental.vector.reduce.smin.v4i32(<4 x i32> %v)
ret i32 %r
}
; COST-LABEL: smax.i8.v8i8
; COST: Found an estimated cost of 216 for instruction: %r = call i8 @llvm.experimental.vector.reduce.smax.v8i8(<8 x i8> %v)
; CODE-LABEL: smax.i8.v8i8
; CODE: smaxv b0, v0.8b
define i8 @smax.i8.v8i8(<8 x i8> %v) {
%r = call i8 @llvm.experimental.vector.reduce.smax.v8i8(<8 x i8> %v)
ret i8 %r
}
; COST-LABEL: smax.i8.v16i8
; COST: Found an estimated cost of 608 for instruction: %r = call i8 @llvm.experimental.vector.reduce.smax.v16i8(<16 x i8> %v)
; CODE-LABEL: smax.i8.v16i8
; CODE: smaxv b0, v0.16b
define i8 @smax.i8.v16i8(<16 x i8> %v) {
%r = call i8 @llvm.experimental.vector.reduce.smax.v16i8(<16 x i8> %v)
ret i8 %r
}
; COST-LABEL: smax.i16.v4i16
; COST: Found an estimated cost of 64 for instruction: %r = call i16 @llvm.experimental.vector.reduce.smax.v4i16(<4 x i16> %v)
; CODE-LABEL: smax.i16.v4i16
; CODE: smaxv h0, v0.4h
define i16 @smax.i16.v4i16(<4 x i16> %v) {
%r = call i16 @llvm.experimental.vector.reduce.smax.v4i16(<4 x i16> %v)
ret i16 %r
}
; COST-LABEL: smax.i16.v8i16
; COST: Found an estimated cost of 216 for instruction: %r = call i16 @llvm.experimental.vector.reduce.smax.v8i16(<8 x i16> %v)
; CODE-LABEL: smax.i16.v8i16
; CODE: smaxv h0, v0.8h
define i16 @smax.i16.v8i16(<8 x i16> %v) {
%r = call i16 @llvm.experimental.vector.reduce.smax.v8i16(<8 x i16> %v)
ret i16 %r
}
; COST-LABEL: smax.i32.v4i32
; COST: Found an estimated cost of 34 for instruction: %r = call i32 @llvm.experimental.vector.reduce.smax.v4i32(<4 x i32> %v)
; CODE-LABEL: smax.i32.v4i32
; CODE: smaxv s0, v0.4s
define i32 @smax.i32.v4i32(<4 x i32> %v) {
%r = call i32 @llvm.experimental.vector.reduce.smax.v4i32(<4 x i32> %v)
ret i32 %r
}
; COST-LABEL: fmin.f32.v4f32
; COST: Found an estimated cost of 34 for instruction: %r = call nnan float @llvm.experimental.vector.reduce.fmin.v4f32(<4 x float> %v)
; CODE-LABEL: fmin.f32.v4f32
; CODE: fminnmv s0, v0.4s
define float @fmin.f32.v4f32(<4 x float> %v) {
%r = call nnan float @llvm.experimental.vector.reduce.fmin.v4f32(<4 x float> %v)
ret float %r
}
; COST-LABEL: fmax.f32.v4f32
; COST: Found an estimated cost of 34 for instruction: %r = call nnan float @llvm.experimental.vector.reduce.fmax.v4f32(<4 x float> %v)
; CODE-LABEL: fmax.f32.v4f32
; CODE: fmaxnmv s0, v0.4s
define float @fmax.f32.v4f32(<4 x float> %v) {
%r = call nnan float @llvm.experimental.vector.reduce.fmax.v4f32(<4 x float> %v)
ret float %r
}
declare i8 @llvm.experimental.vector.reduce.add.v8i8(<8 x i8>)
declare i8 @llvm.experimental.vector.reduce.add.v16i8(<16 x i8>)
declare i16 @llvm.experimental.vector.reduce.add.v4i16(<4 x i16>)
declare i16 @llvm.experimental.vector.reduce.add.v8i16(<8 x i16>)
declare i32 @llvm.experimental.vector.reduce.add.v4i32(<4 x i32>)
declare i8 @llvm.experimental.vector.reduce.umin.v8i8(<8 x i8>)
declare i8 @llvm.experimental.vector.reduce.umin.v16i8(<16 x i8>)
declare i16 @llvm.experimental.vector.reduce.umin.v4i16(<4 x i16>)
declare i16 @llvm.experimental.vector.reduce.umin.v8i16(<8 x i16>)
declare i32 @llvm.experimental.vector.reduce.umin.v4i32(<4 x i32>)
declare i8 @llvm.experimental.vector.reduce.umax.v8i8(<8 x i8>)
declare i8 @llvm.experimental.vector.reduce.umax.v16i8(<16 x i8>)
declare i16 @llvm.experimental.vector.reduce.umax.v4i16(<4 x i16>)
declare i16 @llvm.experimental.vector.reduce.umax.v8i16(<8 x i16>)
declare i32 @llvm.experimental.vector.reduce.umax.v4i32(<4 x i32>)
declare i8 @llvm.experimental.vector.reduce.smin.v8i8(<8 x i8>)
declare i8 @llvm.experimental.vector.reduce.smin.v16i8(<16 x i8>)
declare i16 @llvm.experimental.vector.reduce.smin.v4i16(<4 x i16>)
declare i16 @llvm.experimental.vector.reduce.smin.v8i16(<8 x i16>)
declare i32 @llvm.experimental.vector.reduce.smin.v4i32(<4 x i32>)
declare i8 @llvm.experimental.vector.reduce.smax.v8i8(<8 x i8>)
declare i8 @llvm.experimental.vector.reduce.smax.v16i8(<16 x i8>)
declare i16 @llvm.experimental.vector.reduce.smax.v4i16(<4 x i16>)
declare i16 @llvm.experimental.vector.reduce.smax.v8i16(<8 x i16>)
declare i32 @llvm.experimental.vector.reduce.smax.v4i32(<4 x i32>)
declare float @llvm.experimental.vector.reduce.fmin.v4f32(<4 x float>)
declare float @llvm.experimental.vector.reduce.fmax.v4f32(<4 x float>)