1 ; RUN: opt < %s -passes="print<cost-model>" 2>&1 -disable-output | 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(ptr %p) #0 {
7 %r = load <16 x i8>, ptr %p, align 1
10 ; CHECK-LABEL: test_l_v16i8
11 ; CHECK: cost of 2 for instruction: %r = load <16 x i8>, ptr %p, align 1
14 define <32 x i8> @test_l_v32i8(ptr %p) #0 {
16 %r = load <32 x i8>, ptr %p, align 1
19 ; CHECK-LABEL: test_l_v32i8
20 ; CHECK: cost of 4 for instruction: %r = load <32 x i8>, ptr %p, align 1
23 define <8 x i16> @test_l_v8i16(ptr %p) #0 {
25 %r = load <8 x i16>, ptr %p, align 2
28 ; CHECK-LABEL: test_l_v8i16
29 ; CHECK: cost of 2 for instruction: %r = load <8 x i16>, ptr %p, align 2
32 define <16 x i16> @test_l_v16i16(ptr %p) #0 {
34 %r = load <16 x i16>, ptr %p, align 2
37 ; CHECK-LABEL: test_l_v16i16
38 ; CHECK: cost of 4 for instruction: %r = load <16 x i16>, ptr %p, align 2
41 define <4 x i32> @test_l_v4i32(ptr %p) #0 {
43 %r = load <4 x i32>, ptr %p, align 4
46 ; CHECK-LABEL: test_l_v4i32
47 ; CHECK: cost of 2 for instruction: %r = load <4 x i32>, ptr %p, align 4
50 define <8 x i32> @test_l_v8i32(ptr %p) #0 {
52 %r = load <8 x i32>, ptr %p, align 4
55 ; CHECK-LABEL: test_l_v8i32
56 ; CHECK: cost of 4 for instruction: %r = load <8 x i32>, ptr %p, align 4
59 define <2 x i64> @test_l_v2i64(ptr %p) #0 {
61 %r = load <2 x i64>, ptr %p, align 8
64 ; CHECK-LABEL: test_l_v2i64
65 ; CHECK: cost of 1 for instruction: %r = load <2 x i64>, ptr %p, align 8
68 define <4 x i64> @test_l_v4i64(ptr %p) #0 {
70 %r = load <4 x i64>, ptr %p, align 8
73 ; CHECK-LABEL: test_l_v4i64
74 ; CHECK: cost of 2 for instruction: %r = load <4 x i64>, ptr %p, align 8
77 define <4 x float> @test_l_v4float(ptr %p) #0 {
79 %r = load <4 x float>, ptr %p, align 4
82 ; CHECK-LABEL: test_l_v4float
83 ; CHECK: cost of 2 for instruction: %r = load <4 x float>, ptr %p, align 4
86 define <8 x float> @test_l_v8float(ptr %p) #0 {
88 %r = load <8 x float>, ptr %p, align 4
91 ; CHECK-LABEL: test_l_v8float
92 ; CHECK: cost of 4 for instruction: %r = load <8 x float>, ptr %p, align 4
95 define <2 x double> @test_l_v2double(ptr %p) #0 {
97 %r = load <2 x double>, ptr %p, align 8
100 ; CHECK-LABEL: test_l_v2double
101 ; CHECK: cost of 1 for instruction: %r = load <2 x double>, ptr %p, align 8
104 define <4 x double> @test_l_v4double(ptr %p) #0 {
106 %r = load <4 x double>, ptr %p, align 8
109 ; CHECK-LABEL: test_l_v4double
110 ; CHECK: cost of 2 for instruction: %r = load <4 x double>, ptr %p, align 8
113 define <16 x i8> @test_l_p8v16i8(ptr %p) #2 {
115 %r = load <16 x i8>, ptr %p, align 1
118 ; CHECK-LABEL: test_l_p8v16i8
119 ; CHECK: cost of 1 for instruction: %r = load <16 x i8>, ptr %p, align 1
122 define <32 x i8> @test_l_p8v32i8(ptr %p) #2 {
124 %r = load <32 x i8>, ptr %p, align 1
127 ; CHECK-LABEL: test_l_p8v32i8
128 ; CHECK: cost of 2 for instruction: %r = load <32 x i8>, ptr %p, align 1
131 define <8 x i16> @test_l_p8v8i16(ptr %p) #2 {
133 %r = load <8 x i16>, ptr %p, align 2
136 ; CHECK-LABEL: test_l_p8v8i16
137 ; CHECK: cost of 1 for instruction: %r = load <8 x i16>, ptr %p, align 2
140 define <16 x i16> @test_l_p8v16i16(ptr %p) #2 {
142 %r = load <16 x i16>, ptr %p, align 2
145 ; CHECK-LABEL: test_l_p8v16i16
146 ; CHECK: cost of 2 for instruction: %r = load <16 x i16>, ptr %p, align 2
149 define <4 x i32> @test_l_p8v4i32(ptr %p) #2 {
151 %r = load <4 x i32>, ptr %p, align 4
154 ; CHECK-LABEL: test_l_p8v4i32
155 ; CHECK: cost of 1 for instruction: %r = load <4 x i32>, ptr %p, align 4
158 define <8 x i32> @test_l_p8v8i32(ptr %p) #2 {
160 %r = load <8 x i32>, ptr %p, align 4
163 ; CHECK-LABEL: test_l_p8v8i32
164 ; CHECK: cost of 2 for instruction: %r = load <8 x i32>, ptr %p, align 4
167 define <2 x i64> @test_l_p8v2i64(ptr %p) #2 {
169 %r = load <2 x i64>, ptr %p, align 8
172 ; CHECK-LABEL: test_l_p8v2i64
173 ; CHECK: cost of 1 for instruction: %r = load <2 x i64>, ptr %p, align 8
176 define <4 x i64> @test_l_p8v4i64(ptr %p) #2 {
178 %r = load <4 x i64>, ptr %p, align 8
181 ; CHECK-LABEL: test_l_p8v4i64
182 ; CHECK: cost of 2 for instruction: %r = load <4 x i64>, ptr %p, align 8
185 define <4 x float> @test_l_p8v4float(ptr %p) #2 {
187 %r = load <4 x float>, ptr %p, align 4
190 ; CHECK-LABEL: test_l_p8v4float
191 ; CHECK: cost of 1 for instruction: %r = load <4 x float>, ptr %p, align 4
194 define <8 x float> @test_l_p8v8float(ptr %p) #2 {
196 %r = load <8 x float>, ptr %p, align 4
199 ; CHECK-LABEL: test_l_p8v8float
200 ; CHECK: cost of 2 for instruction: %r = load <8 x float>, ptr %p, align 4
203 define <2 x double> @test_l_p8v2double(ptr %p) #2 {
205 %r = load <2 x double>, ptr %p, align 8
208 ; CHECK-LABEL: test_l_p8v2double
209 ; CHECK: cost of 1 for instruction: %r = load <2 x double>, ptr %p, align 8
212 define <4 x double> @test_l_p8v4double(ptr %p) #2 {
214 %r = load <4 x double>, ptr %p, align 8
217 ; CHECK-LABEL: test_l_p8v4double
218 ; CHECK: cost of 2 for instruction: %r = load <4 x double>, ptr %p, align 8
221 define void @test_s_v16i8(ptr %p, <16 x i8> %v) #0 {
223 store <16 x i8> %v, ptr %p, align 1
226 ; CHECK-LABEL: test_s_v16i8
227 ; CHECK: cost of 1 for instruction: store <16 x i8> %v, ptr %p, align 1
230 define void @test_s_v32i8(ptr %p, <32 x i8> %v) #0 {
232 store <32 x i8> %v, ptr %p, align 1
235 ; CHECK-LABEL: test_s_v32i8
236 ; CHECK: cost of 2 for instruction: store <32 x i8> %v, ptr %p, align 1
239 define void @test_s_v8i16(ptr %p, <8 x i16> %v) #0 {
241 store <8 x i16> %v, ptr %p, align 2
244 ; CHECK-LABEL: test_s_v8i16
245 ; CHECK: cost of 1 for instruction: store <8 x i16> %v, ptr %p, align 2
248 define void @test_s_v16i16(ptr %p, <16 x i16> %v) #0 {
250 store <16 x i16> %v, ptr %p, align 2
253 ; CHECK-LABEL: test_s_v16i16
254 ; CHECK: cost of 2 for instruction: store <16 x i16> %v, ptr %p, align 2
257 define void @test_s_v4i32(ptr %p, <4 x i32> %v) #0 {
259 store <4 x i32> %v, ptr %p, align 4
262 ; CHECK-LABEL: test_s_v4i32
263 ; CHECK: cost of 1 for instruction: store <4 x i32> %v, ptr %p, align 4
266 define void @test_s_v8i32(ptr %p, <8 x i32> %v) #0 {
268 store <8 x i32> %v, ptr %p, align 4
271 ; CHECK-LABEL: test_s_v8i32
272 ; CHECK: cost of 2 for instruction: store <8 x i32> %v, ptr %p, align 4
275 define void @test_s_v2i64(ptr %p, <2 x i64> %v) #0 {
277 store <2 x i64> %v, ptr %p, align 8
280 ; CHECK-LABEL: test_s_v2i64
281 ; CHECK: cost of 1 for instruction: store <2 x i64> %v, ptr %p, align 8
284 define void @test_s_v4i64(ptr %p, <4 x i64> %v) #0 {
286 store <4 x i64> %v, ptr %p, align 8
289 ; CHECK-LABEL: test_s_v4i64
290 ; CHECK: cost of 2 for instruction: store <4 x i64> %v, ptr %p, align 8
293 define void @test_s_v4float(ptr %p, <4 x float> %v) #0 {
295 store <4 x float> %v, ptr %p, align 4
298 ; CHECK-LABEL: test_s_v4float
299 ; CHECK: cost of 1 for instruction: store <4 x float> %v, ptr %p, align 4
302 define void @test_s_v8float(ptr %p, <8 x float> %v) #0 {
304 store <8 x float> %v, ptr %p, align 4
307 ; CHECK-LABEL: test_s_v8float
308 ; CHECK: cost of 2 for instruction: store <8 x float> %v, ptr %p, align 4
311 define void @test_s_v2double(ptr %p, <2 x double> %v) #0 {
313 store <2 x double> %v, ptr %p, align 8
316 ; CHECK-LABEL: test_s_v2double
317 ; CHECK: cost of 1 for instruction: store <2 x double> %v, ptr %p, align 8
320 define void @test_s_v4double(ptr %p, <4 x double> %v) #0 {
322 store <4 x double> %v, ptr %p, align 8
325 ; CHECK-LABEL: test_s_v4double
326 ; CHECK: cost of 2 for instruction: store <4 x double> %v, ptr %p, align 8
329 attributes #0 = { nounwind "target-cpu"="pwr7" }
330 attributes #2 = { nounwind "target-cpu"="pwr8" }