1 ; RUN: opt < %s -cost-model -analyze | FileCheck %s
2 target datalayout = "E-m:e-i64:64-n32:64"
3 target triple = "powerpc64-unknown-linux-gnu"
5 define <16 x i8> @test_l_v16i8(<16 x i8>* %p) #0 {
7 %r = load <16 x i8>, <16 x i8>* %p, align 1
10 ; CHECK-LABEL: test_l_v16i8
11 ; CHECK: cost of 2 for instruction: %r = load <16 x i8>, <16 x i8>* %p, align 1
14 define <32 x i8> @test_l_v32i8(<32 x i8>* %p) #0 {
16 %r = load <32 x i8>, <32 x i8>* %p, align 1
19 ; CHECK-LABEL: test_l_v32i8
20 ; CHECK: cost of 4 for instruction: %r = load <32 x i8>, <32 x i8>* %p, align 1
23 define <8 x i16> @test_l_v8i16(<8 x i16>* %p) #0 {
25 %r = load <8 x i16>, <8 x i16>* %p, align 2
28 ; CHECK-LABEL: test_l_v8i16
29 ; CHECK: cost of 2 for instruction: %r = load <8 x i16>, <8 x i16>* %p, align 2
32 define <16 x i16> @test_l_v16i16(<16 x i16>* %p) #0 {
34 %r = load <16 x i16>, <16 x i16>* %p, align 2
37 ; CHECK-LABEL: test_l_v16i16
38 ; CHECK: cost of 4 for instruction: %r = load <16 x i16>, <16 x i16>* %p, align 2
41 define <4 x i32> @test_l_v4i32(<4 x i32>* %p) #0 {
43 %r = load <4 x i32>, <4 x i32>* %p, align 4
46 ; CHECK-LABEL: test_l_v4i32
47 ; CHECK: cost of 2 for instruction: %r = load <4 x i32>, <4 x i32>* %p, align 4
50 define <8 x i32> @test_l_v8i32(<8 x i32>* %p) #0 {
52 %r = load <8 x i32>, <8 x i32>* %p, align 4
55 ; CHECK-LABEL: test_l_v8i32
56 ; CHECK: cost of 4 for instruction: %r = load <8 x i32>, <8 x i32>* %p, align 4
59 define <2 x i64> @test_l_v2i64(<2 x i64>* %p) #0 {
61 %r = load <2 x i64>, <2 x i64>* %p, align 8
64 ; CHECK-LABEL: test_l_v2i64
65 ; CHECK: cost of 1 for instruction: %r = load <2 x i64>, <2 x i64>* %p, align 8
68 define <4 x i64> @test_l_v4i64(<4 x i64>* %p) #0 {
70 %r = load <4 x i64>, <4 x i64>* %p, align 8
73 ; CHECK-LABEL: test_l_v4i64
74 ; CHECK: cost of 2 for instruction: %r = load <4 x i64>, <4 x i64>* %p, align 8
77 define <4 x float> @test_l_v4float(<4 x float>* %p) #0 {
79 %r = load <4 x float>, <4 x float>* %p, align 4
82 ; CHECK-LABEL: test_l_v4float
83 ; CHECK: cost of 2 for instruction: %r = load <4 x float>, <4 x float>* %p, align 4
86 define <8 x float> @test_l_v8float(<8 x float>* %p) #0 {
88 %r = load <8 x float>, <8 x float>* %p, align 4
91 ; CHECK-LABEL: test_l_v8float
92 ; CHECK: cost of 4 for instruction: %r = load <8 x float>, <8 x float>* %p, align 4
95 define <2 x double> @test_l_v2double(<2 x double>* %p) #0 {
97 %r = load <2 x double>, <2 x double>* %p, align 8
100 ; CHECK-LABEL: test_l_v2double
101 ; CHECK: cost of 1 for instruction: %r = load <2 x double>, <2 x double>* %p, align 8
104 define <4 x double> @test_l_v4double(<4 x double>* %p) #0 {
106 %r = load <4 x double>, <4 x double>* %p, align 8
109 ; CHECK-LABEL: test_l_v4double
110 ; CHECK: cost of 2 for instruction: %r = load <4 x double>, <4 x double>* %p, align 8
113 define <16 x i8> @test_l_p8v16i8(<16 x i8>* %p) #2 {
115 %r = load <16 x i8>, <16 x i8>* %p, align 1
118 ; CHECK-LABEL: test_l_p8v16i8
119 ; CHECK: cost of 1 for instruction: %r = load <16 x i8>, <16 x i8>* %p, align 1
122 define <32 x i8> @test_l_p8v32i8(<32 x i8>* %p) #2 {
124 %r = load <32 x i8>, <32 x i8>* %p, align 1
127 ; CHECK-LABEL: test_l_p8v32i8
128 ; CHECK: cost of 2 for instruction: %r = load <32 x i8>, <32 x i8>* %p, align 1
131 define <8 x i16> @test_l_p8v8i16(<8 x i16>* %p) #2 {
133 %r = load <8 x i16>, <8 x i16>* %p, align 2
136 ; CHECK-LABEL: test_l_p8v8i16
137 ; CHECK: cost of 1 for instruction: %r = load <8 x i16>, <8 x i16>* %p, align 2
140 define <16 x i16> @test_l_p8v16i16(<16 x i16>* %p) #2 {
142 %r = load <16 x i16>, <16 x i16>* %p, align 2
145 ; CHECK-LABEL: test_l_p8v16i16
146 ; CHECK: cost of 2 for instruction: %r = load <16 x i16>, <16 x i16>* %p, align 2
149 define <4 x i32> @test_l_p8v4i32(<4 x i32>* %p) #2 {
151 %r = load <4 x i32>, <4 x i32>* %p, align 4
154 ; CHECK-LABEL: test_l_p8v4i32
155 ; CHECK: cost of 1 for instruction: %r = load <4 x i32>, <4 x i32>* %p, align 4
158 define <8 x i32> @test_l_p8v8i32(<8 x i32>* %p) #2 {
160 %r = load <8 x i32>, <8 x i32>* %p, align 4
163 ; CHECK-LABEL: test_l_p8v8i32
164 ; CHECK: cost of 2 for instruction: %r = load <8 x i32>, <8 x i32>* %p, align 4
167 define <2 x i64> @test_l_p8v2i64(<2 x i64>* %p) #2 {
169 %r = load <2 x i64>, <2 x i64>* %p, align 8
172 ; CHECK-LABEL: test_l_p8v2i64
173 ; CHECK: cost of 1 for instruction: %r = load <2 x i64>, <2 x i64>* %p, align 8
176 define <4 x i64> @test_l_p8v4i64(<4 x i64>* %p) #2 {
178 %r = load <4 x i64>, <4 x i64>* %p, align 8
181 ; CHECK-LABEL: test_l_p8v4i64
182 ; CHECK: cost of 2 for instruction: %r = load <4 x i64>, <4 x i64>* %p, align 8
185 define <4 x float> @test_l_p8v4float(<4 x float>* %p) #2 {
187 %r = load <4 x float>, <4 x float>* %p, align 4
190 ; CHECK-LABEL: test_l_p8v4float
191 ; CHECK: cost of 1 for instruction: %r = load <4 x float>, <4 x float>* %p, align 4
194 define <8 x float> @test_l_p8v8float(<8 x float>* %p) #2 {
196 %r = load <8 x float>, <8 x float>* %p, align 4
199 ; CHECK-LABEL: test_l_p8v8float
200 ; CHECK: cost of 2 for instruction: %r = load <8 x float>, <8 x float>* %p, align 4
203 define <2 x double> @test_l_p8v2double(<2 x double>* %p) #2 {
205 %r = load <2 x double>, <2 x double>* %p, align 8
208 ; CHECK-LABEL: test_l_p8v2double
209 ; CHECK: cost of 1 for instruction: %r = load <2 x double>, <2 x double>* %p, align 8
212 define <4 x double> @test_l_p8v4double(<4 x double>* %p) #2 {
214 %r = load <4 x double>, <4 x double>* %p, align 8
217 ; CHECK-LABEL: test_l_p8v4double
218 ; CHECK: cost of 2 for instruction: %r = load <4 x double>, <4 x double>* %p, align 8
221 define <4 x float> @test_l_qv4float(<4 x float>* %p) #1 {
223 %r = load <4 x float>, <4 x float>* %p, align 4
226 ; CHECK-LABEL: test_l_qv4float
227 ; CHECK: cost of 2 for instruction: %r = load <4 x float>, <4 x float>* %p, align 4
230 define <8 x float> @test_l_qv8float(<8 x float>* %p) #1 {
232 %r = load <8 x float>, <8 x float>* %p, align 4
235 ; CHECK-LABEL: test_l_qv8float
236 ; CHECK: cost of 4 for instruction: %r = load <8 x float>, <8 x float>* %p, align 4
239 define <4 x double> @test_l_qv4double(<4 x double>* %p) #1 {
241 %r = load <4 x double>, <4 x double>* %p, align 8
244 ; CHECK-LABEL: test_l_qv4double
245 ; CHECK: cost of 2 for instruction: %r = load <4 x double>, <4 x double>* %p, align 8
248 define <8 x double> @test_l_qv8double(<8 x double>* %p) #1 {
250 %r = load <8 x double>, <8 x double>* %p, align 8
253 ; CHECK-LABEL: test_l_qv8double
254 ; CHECK: cost of 4 for instruction: %r = load <8 x double>, <8 x double>* %p, align 8
257 define void @test_s_v16i8(<16 x i8>* %p, <16 x i8> %v) #0 {
259 store <16 x i8> %v, <16 x i8>* %p, align 1
262 ; CHECK-LABEL: test_s_v16i8
263 ; CHECK: cost of 1 for instruction: store <16 x i8> %v, <16 x i8>* %p, align 1
266 define void @test_s_v32i8(<32 x i8>* %p, <32 x i8> %v) #0 {
268 store <32 x i8> %v, <32 x i8>* %p, align 1
271 ; CHECK-LABEL: test_s_v32i8
272 ; CHECK: cost of 2 for instruction: store <32 x i8> %v, <32 x i8>* %p, align 1
275 define void @test_s_v8i16(<8 x i16>* %p, <8 x i16> %v) #0 {
277 store <8 x i16> %v, <8 x i16>* %p, align 2
280 ; CHECK-LABEL: test_s_v8i16
281 ; CHECK: cost of 1 for instruction: store <8 x i16> %v, <8 x i16>* %p, align 2
284 define void @test_s_v16i16(<16 x i16>* %p, <16 x i16> %v) #0 {
286 store <16 x i16> %v, <16 x i16>* %p, align 2
289 ; CHECK-LABEL: test_s_v16i16
290 ; CHECK: cost of 2 for instruction: store <16 x i16> %v, <16 x i16>* %p, align 2
293 define void @test_s_v4i32(<4 x i32>* %p, <4 x i32> %v) #0 {
295 store <4 x i32> %v, <4 x i32>* %p, align 4
298 ; CHECK-LABEL: test_s_v4i32
299 ; CHECK: cost of 1 for instruction: store <4 x i32> %v, <4 x i32>* %p, align 4
302 define void @test_s_v8i32(<8 x i32>* %p, <8 x i32> %v) #0 {
304 store <8 x i32> %v, <8 x i32>* %p, align 4
307 ; CHECK-LABEL: test_s_v8i32
308 ; CHECK: cost of 2 for instruction: store <8 x i32> %v, <8 x i32>* %p, align 4
311 define void @test_s_v2i64(<2 x i64>* %p, <2 x i64> %v) #0 {
313 store <2 x i64> %v, <2 x i64>* %p, align 8
316 ; CHECK-LABEL: test_s_v2i64
317 ; CHECK: cost of 1 for instruction: store <2 x i64> %v, <2 x i64>* %p, align 8
320 define void @test_s_v4i64(<4 x i64>* %p, <4 x i64> %v) #0 {
322 store <4 x i64> %v, <4 x i64>* %p, align 8
325 ; CHECK-LABEL: test_s_v4i64
326 ; CHECK: cost of 2 for instruction: store <4 x i64> %v, <4 x i64>* %p, align 8
329 define void @test_s_v4float(<4 x float>* %p, <4 x float> %v) #0 {
331 store <4 x float> %v, <4 x float>* %p, align 4
334 ; CHECK-LABEL: test_s_v4float
335 ; CHECK: cost of 1 for instruction: store <4 x float> %v, <4 x float>* %p, align 4
338 define void @test_s_v8float(<8 x float>* %p, <8 x float> %v) #0 {
340 store <8 x float> %v, <8 x float>* %p, align 4
343 ; CHECK-LABEL: test_s_v8float
344 ; CHECK: cost of 2 for instruction: store <8 x float> %v, <8 x float>* %p, align 4
347 define void @test_s_v2double(<2 x double>* %p, <2 x double> %v) #0 {
349 store <2 x double> %v, <2 x double>* %p, align 8
352 ; CHECK-LABEL: test_s_v2double
353 ; CHECK: cost of 1 for instruction: store <2 x double> %v, <2 x double>* %p, align 8
356 define void @test_s_v4double(<4 x double>* %p, <4 x double> %v) #0 {
358 store <4 x double> %v, <4 x double>* %p, align 8
361 ; CHECK-LABEL: test_s_v4double
362 ; CHECK: cost of 2 for instruction: store <4 x double> %v, <4 x double>* %p, align 8
365 define void @test_s_qv4float(<4 x float>* %p, <4 x float> %v) #1 {
367 store <4 x float> %v, <4 x float>* %p, align 4
370 ; CHECK-LABEL: test_s_qv4float
371 ; CHECK: cost of 7 for instruction: store <4 x float> %v, <4 x float>* %p, align 4
374 define void @test_s_qv8float(<8 x float>* %p, <8 x float> %v) #1 {
376 store <8 x float> %v, <8 x float>* %p, align 4
379 ; CHECK-LABEL: test_s_qv8float
380 ; CHECK: cost of 15 for instruction: store <8 x float> %v, <8 x float>* %p, align 4
383 define void @test_s_qv4double(<4 x double>* %p, <4 x double> %v) #1 {
385 store <4 x double> %v, <4 x double>* %p, align 8
388 ; CHECK-LABEL: test_s_qv4double
389 ; CHECK: cost of 7 for instruction: store <4 x double> %v, <4 x double>* %p, align 8
392 define void @test_s_qv8double(<8 x double>* %p, <8 x double> %v) #1 {
394 store <8 x double> %v, <8 x double>* %p, align 8
397 ; CHECK-LABEL: test_s_qv8double
398 ; CHECK: cost of 15 for instruction: store <8 x double> %v, <8 x double>* %p, align 8
401 attributes #0 = { nounwind "target-cpu"="pwr7" }
402 attributes #1 = { nounwind "target-cpu"="a2q" }
403 attributes #2 = { nounwind "target-cpu"="pwr8" }