llvm.org GIT mirror llvm / 168ef66
Clean up function attributes on PPC fast-isel tests. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@243079 91177308-0d34-0410-b5e6-96231b3b80d8 Eric Christopher 4 years ago
16 changed file(s) with 145 addition(s) and 145 deletion(s). Raw diff Collapse all Expand all
11
22 ; Test add with non-legal types
33
4 define void @add_i8(i8 %a, i8 %b) nounwind ssp {
4 define void @add_i8(i8 %a, i8 %b) nounwind {
55 entry:
66 ; ELF64: add_i8
77 %a.addr = alloca i8, align 4
1111 ret void
1212 }
1313
14 define void @add_i8_imm(i8 %a) nounwind ssp {
14 define void @add_i8_imm(i8 %a) nounwind {
1515 entry:
1616 ; ELF64: add_i8_imm
1717 %a.addr = alloca i8, align 4
2121 ret void
2222 }
2323
24 define void @add_i16(i16 %a, i16 %b) nounwind ssp {
24 define void @add_i16(i16 %a, i16 %b) nounwind {
2525 entry:
2626 ; ELF64: add_i16
2727 %a.addr = alloca i16, align 4
3131 ret void
3232 }
3333
34 define void @add_i16_imm(i16 %a, i16 %b) nounwind ssp {
34 define void @add_i16_imm(i16 %a, i16 %b) nounwind {
3535 entry:
3636 ; ELF64: add_i16_imm
3737 %a.addr = alloca i16, align 4
4343
4444 ; Test or with non-legal types
4545
46 define void @or_i8(i8 %a, i8 %b) nounwind ssp {
46 define void @or_i8(i8 %a, i8 %b) nounwind {
4747 entry:
4848 ; ELF64: or_i8
4949 %a.addr = alloca i8, align 4
5353 ret void
5454 }
5555
56 define void @or_i8_imm(i8 %a) nounwind ssp {
56 define void @or_i8_imm(i8 %a) nounwind {
5757 entry:
5858 ; ELF64: or_i8_imm
5959 %a.addr = alloca i8, align 4
6363 ret void
6464 }
6565
66 define void @or_i16(i16 %a, i16 %b) nounwind ssp {
66 define void @or_i16(i16 %a, i16 %b) nounwind {
6767 entry:
6868 ; ELF64: or_i16
6969 %a.addr = alloca i16, align 4
7373 ret void
7474 }
7575
76 define void @or_i16_imm(i16 %a) nounwind ssp {
76 define void @or_i16_imm(i16 %a) nounwind {
7777 entry:
7878 ; ELF64: or_i16_imm
7979 %a.addr = alloca i16, align 4
8585
8686 ; Test sub with non-legal types
8787
88 define void @sub_i8(i8 %a, i8 %b) nounwind ssp {
88 define void @sub_i8(i8 %a, i8 %b) nounwind {
8989 entry:
9090 ; ELF64: sub_i8
9191 %a.addr = alloca i8, align 4
9595 ret void
9696 }
9797
98 define void @sub_i8_imm(i8 %a) nounwind ssp {
98 define void @sub_i8_imm(i8 %a) nounwind {
9999 entry:
100100 ; ELF64: sub_i8_imm
101101 %a.addr = alloca i8, align 4
105105 ret void
106106 }
107107
108 define void @sub_i16(i16 %a, i16 %b) nounwind ssp {
108 define void @sub_i16(i16 %a, i16 %b) nounwind {
109109 entry:
110110 ; ELF64: sub_i16
111111 %a.addr = alloca i16, align 4
115115 ret void
116116 }
117117
118 define void @sub_i16_imm(i16 %a) nounwind ssp {
118 define void @sub_i16_imm(i16 %a) nounwind {
119119 entry:
120120 ; ELF64: sub_i16_imm
121121 %a.addr = alloca i16, align 4
125125 ret void
126126 }
127127
128 define void @sub_i16_badimm(i16 %a) nounwind ssp {
128 define void @sub_i16_badimm(i16 %a) nounwind {
129129 entry:
130130 ; ELF64: sub_i16_imm
131131 %a.addr = alloca i16, align 4
0 ; RUN: llc < %s -O0 -verify-machineinstrs -fast-isel-abort=1 -mtriple=powerpc64-unknown-linux-gnu -mcpu=pwr7 | FileCheck %s --check-prefix=ELF64
11
2 define i32 @t1(i32 %a, i32 %b) nounwind uwtable ssp {
2 define i32 @t1(i32 %a, i32 %b) nounwind {
33 entry:
44 ; ELF64: t1
55 %x = add i32 %a, %b
5555 declare signext i8 @t7();
5656 declare zeroext i8 @t8();
5757
58 define i32 @t10(i32 %argc, i8** nocapture %argv) {
58 define i32 @t10(i32 %argc, i8** nocapture %argv) nounwind {
5959 entry:
6060 ; ELF64: t10
6161 %call = call i32 @bar(i8 zeroext 0, i8 zeroext -8, i8 zeroext -69, i8 zeroext 28, i8 zeroext 40, i8 zeroext -70)
9696 ; ret i32 %tmp1
9797 ;}
9898
99 declare void @float_foo(float %f) ssp
99 declare void @float_foo(float %f)
100100
101 define void @float_const() ssp {
101 define void @float_const() nounwind {
102102 entry:
103103 ; ELF64: float_const
104104 call void @float_foo(float 0x401C666660000000)
107107 ret void
108108 }
109109
110 define void @float_reg(float %dummy, float %f) ssp {
110 define void @float_reg(float %dummy, float %f) nounwind {
111111 entry:
112112 ; ELF64: float_reg
113113 call void @float_foo(float %f)
115115 ret void
116116 }
117117
118 declare void @double_foo(double %d) ssp
118 declare void @double_foo(double %d)
119119
120 define void @double_const() ssp {
120 define void @double_const() nounwind {
121121 entry:
122122 ; ELF64: double_const
123123 call void @double_foo(double 0x1397723CCABD0000401C666660000000)
126126 ret void
127127 }
128128
129 define void @double_reg(double %dummy, double %d) ssp {
129 define void @double_reg(double %dummy, double %d) nounwind {
130130 entry:
131131 ; ELF64: double_reg
132132 call void @double_foo(double %d)
22 ; When fastisel better supports VSX fix up this test case.
33 ;
44 ; RUN: llc < %s -O0 -verify-machineinstrs -fast-isel-abort=1 -mtriple=powerpc64-unknown-linux-gnu -mcpu=pwr7 -mattr=-vsx | FileCheck %s --check-prefix=ELF64
5 define void @t1a(float %a) uwtable ssp {
5 define void @t1a(float %a) nounwind {
66 entry:
77 ; ELF64: t1a
88 %cmp = fcmp oeq float %a, 0.000000e+00
2121
2222 declare void @foo()
2323
24 define void @t1b(float %a) uwtable ssp {
24 define void @t1b(float %a) nounwind {
2525 entry:
2626 ; ELF64: t1b
2727 %cmp = fcmp oeq float %a, -0.000000e+00
3838 ret void
3939 }
4040
41 define void @t2a(double %a) uwtable ssp {
41 define void @t2a(double %a) nounwind {
4242 entry:
4343 ; ELF64: t2a
4444 %cmp = fcmp oeq double %a, 0.000000e+00
5555 ret void
5656 }
5757
58 define void @t2b(double %a) uwtable ssp {
58 define void @t2b(double %a) nounwind {
5959 entry:
6060 ; ELF64: t2b
6161 %cmp = fcmp oeq double %a, -0.000000e+00
7272 ret void
7373 }
7474
75 define void @t4(i8 signext %a) uwtable ssp {
75 define void @t4(i8 signext %a) nounwind {
7676 entry:
7777 ; ELF64: t4
7878 %cmp = icmp eq i8 %a, -1
8888 ret void
8989 }
9090
91 define void @t5(i8 zeroext %a) uwtable ssp {
91 define void @t5(i8 zeroext %a) nounwind {
9292 entry:
9393 ; ELF64: t5
9494 %cmp = icmp eq i8 %a, 1
104104 ret void
105105 }
106106
107 define void @t6(i16 signext %a) uwtable ssp {
107 define void @t6(i16 signext %a) nounwind {
108108 entry:
109109 ; ELF64: t6
110110 %cmp = icmp eq i16 %a, -1
120120 ret void
121121 }
122122
123 define void @t7(i16 zeroext %a) uwtable ssp {
123 define void @t7(i16 zeroext %a) nounwind {
124124 entry:
125125 ; ELF64: t7
126126 %cmp = icmp eq i16 %a, 1
136136 ret void
137137 }
138138
139 define void @t8(i32 %a) uwtable ssp {
139 define void @t8(i32 %a) nounwind {
140140 entry:
141141 ; ELF64: t8
142142 %cmp = icmp eq i32 %a, -1
151151 ret void
152152 }
153153
154 define void @t9(i32 %a) uwtable ssp {
154 define void @t9(i32 %a) nounwind {
155155 entry:
156156 ; ELF64: t9
157157 %cmp = icmp eq i32 %a, 1
166166 ret void
167167 }
168168
169 define void @t10(i32 %a) uwtable ssp {
169 define void @t10(i32 %a) nounwind {
170170 entry:
171171 ; ELF64: t10
172172 %cmp = icmp eq i32 %a, 384
181181 ret void
182182 }
183183
184 define void @t11(i32 %a) uwtable ssp {
184 define void @t11(i32 %a) nounwind {
185185 entry:
186186 ; ELF64: t11
187187 %cmp = icmp eq i32 %a, 4096
196196 ret void
197197 }
198198
199 define void @t12(i8 %a) uwtable ssp {
199 define void @t12(i8 %a) nounwind {
200200 entry:
201201 ; ELF64: t12
202202 %cmp = icmp ugt i8 %a, -113
228228 ret void
229229 }
230230
231 define void @t14(i64 %a) uwtable ssp {
231 define void @t14(i64 %a) nounwind {
232232 entry:
233233 ; ELF64: t14
234234 %cmp = icmp eq i64 %a, -1
243243 ret void
244244 }
245245
246 define void @t15(i64 %a) uwtable ssp {
246 define void @t15(i64 %a) nounwind {
247247 entry:
248248 ; ELF64: t15
249249 %cmp = icmp eq i64 %a, 1
258258 ret void
259259 }
260260
261 define void @t16(i64 %a) uwtable ssp {
261 define void @t16(i64 %a) nounwind {
262262 entry:
263263 ; ELF64: t16
264264 %cmp = icmp eq i64 %a, 384
273273 ret void
274274 }
275275
276 define void @t17(i64 %a) uwtable ssp {
276 define void @t17(i64 %a) nounwind {
277277 entry:
278278 ; ELF64: t17
279279 %cmp = icmp eq i64 %a, 32768
0 ; RUN: llc < %s -O0 -verify-machineinstrs -fast-isel-abort=1 -mtriple=powerpc64-unknown-linux-gnu -mcpu=pwr7 -mattr=-vsx | FileCheck %s --check-prefix=ELF64
11
2 define zeroext i1 @testi1(i8 %in) nounwind uwtable ssp {
2 define zeroext i1 @testi1(i8 %in) nounwind {
33 entry:
44 %c = icmp eq i8 %in, 5
55 br i1 %c, label %true, label %false
11
22 ; Test sitofp
33
4 define void @sitofp_double_i32(i32 %a, double %b) nounwind ssp {
4 define void @sitofp_double_i32(i32 %a, double %b) nounwind {
55 entry:
66 ; ELF64: sitofp_double_i32
77 %b.addr = alloca double, align 8
1313 ret void
1414 }
1515
16 define void @sitofp_double_i64(i64 %a, double %b) nounwind ssp {
16 define void @sitofp_double_i64(i64 %a, double %b) nounwind {
1717 entry:
1818 ; ELF64: sitofp_double_i64
1919 %b.addr = alloca double, align 8
2525 ret void
2626 }
2727
28 define void @sitofp_double_i16(i16 %a, double %b) nounwind ssp {
28 define void @sitofp_double_i16(i16 %a, double %b) nounwind {
2929 entry:
3030 ; ELF64: sitofp_double_i16
3131 %b.addr = alloca double, align 8
3838 ret void
3939 }
4040
41 define void @sitofp_double_i8(i8 %a, double %b) nounwind ssp {
41 define void @sitofp_double_i8(i8 %a, double %b) nounwind {
4242 entry:
4343 ; ELF64: sitofp_double_i8
4444 %b.addr = alloca double, align 8
5353
5454 ; Test fptosi
5555
56 define void @fptosi_float_i32(float %a) nounwind ssp {
56 define void @fptosi_float_i32(float %a) nounwind {
5757 entry:
5858 ; ELF64: fptosi_float_i32
5959 %b.addr = alloca i32, align 4
6565 ret void
6666 }
6767
68 define void @fptosi_float_i64(float %a) nounwind ssp {
68 define void @fptosi_float_i64(float %a) nounwind {
6969 entry:
7070 ; ELF64: fptosi_float_i64
7171 %b.addr = alloca i64, align 4
7777 ret void
7878 }
7979
80 define void @fptosi_double_i32(double %a) nounwind ssp {
80 define void @fptosi_double_i32(double %a) nounwind {
8181 entry:
8282 ; ELF64: fptosi_double_i32
8383 %b.addr = alloca i32, align 8
8989 ret void
9090 }
9191
92 define void @fptosi_double_i64(double %a) nounwind ssp {
92 define void @fptosi_double_i64(double %a) nounwind {
9393 entry:
9494 ; ELF64: fptosi_double_i64
9595 %b.addr = alloca i64, align 8
103103
104104 ; Test fptoui
105105
106 define void @fptoui_float_i32(float %a) nounwind ssp {
106 define void @fptoui_float_i32(float %a) nounwind {
107107 entry:
108108 ; ELF64: fptoui_float_i32
109109 %b.addr = alloca i32, align 4
115115 ret void
116116 }
117117
118 define void @fptoui_double_i32(double %a) nounwind ssp {
118 define void @fptoui_double_i32(double %a) nounwind {
119119 entry:
120120 ; ELF64: fptoui_double_i32
121121 %b.addr = alloca i32, align 8
1010
1111 ; Test sitofp
1212
13 define void @sitofp_single_i64(i64 %a, float %b) nounwind ssp {
13 define void @sitofp_single_i64(i64 %a, float %b) nounwind {
1414 entry:
1515 ; ELF64: sitofp_single_i64
1616 ; ELF64LE: sitofp_single_i64
3131 ret void
3232 }
3333
34 define void @sitofp_single_i32(i32 %a, float %b) nounwind ssp {
34 define void @sitofp_single_i32(i32 %a, float %b) nounwind {
3535 entry:
3636 ; ELF64: sitofp_single_i32
3737 ; ELF64LE: sitofp_single_i32
5656 ret void
5757 }
5858
59 define void @sitofp_single_i16(i16 %a, float %b) nounwind ssp {
59 define void @sitofp_single_i16(i16 %a, float %b) nounwind {
6060 entry:
6161 ; ELF64: sitofp_single_i16
6262 ; ELF64LE: sitofp_single_i16
8080 ret void
8181 }
8282
83 define void @sitofp_single_i8(i8 %a) nounwind ssp {
83 define void @sitofp_single_i8(i8 %a) nounwind {
8484 entry:
8585 ; ELF64: sitofp_single_i8
8686 ; ELF64LE: sitofp_single_i8
104104 ret void
105105 }
106106
107 define void @sitofp_double_i32(i32 %a, double %b) nounwind ssp {
107 define void @sitofp_double_i32(i32 %a, double %b) nounwind {
108108 entry:
109109 ; ELF64: sitofp_double_i32
110110 ; ELF64LE: sitofp_double_i32
128128 ret void
129129 }
130130
131 define void @sitofp_double_i64(i64 %a, double %b) nounwind ssp {
131 define void @sitofp_double_i64(i64 %a, double %b) nounwind {
132132 entry:
133133 ; ELF64: sitofp_double_i64
134134 ; ELF64LE: sitofp_double_i64
148148 ret void
149149 }
150150
151 define void @sitofp_double_i16(i16 %a, double %b) nounwind ssp {
151 define void @sitofp_double_i16(i16 %a, double %b) nounwind {
152152 entry:
153153 ; ELF64: sitofp_double_i16
154154 ; ELF64LE: sitofp_double_i16
171171 ret void
172172 }
173173
174 define void @sitofp_double_i8(i8 %a, double %b) nounwind ssp {
174 define void @sitofp_double_i8(i8 %a, double %b) nounwind {
175175 entry:
176176 ; ELF64: sitofp_double_i8
177177 ; ELF64LE: sitofp_double_i8
196196
197197 ; Test uitofp
198198
199 define void @uitofp_single_i64(i64 %a, float %b) nounwind ssp {
199 define void @uitofp_single_i64(i64 %a, float %b) nounwind {
200200 entry:
201201 ; ELF64: uitofp_single_i64
202202 ; ELF64LE: uitofp_single_i64
214214 ret void
215215 }
216216
217 define void @uitofp_single_i32(i32 %a, float %b) nounwind ssp {
217 define void @uitofp_single_i32(i32 %a, float %b) nounwind {
218218 entry:
219219 ; ELF64: uitofp_single_i32
220220 ; ELF64LE: uitofp_single_i32
237237 ret void
238238 }
239239
240 define void @uitofp_single_i16(i16 %a, float %b) nounwind ssp {
240 define void @uitofp_single_i16(i16 %a, float %b) nounwind {
241241 entry:
242242 ; ELF64: uitofp_single_i16
243243 ; ELF64LE: uitofp_single_i16
261261 ret void
262262 }
263263
264 define void @uitofp_single_i8(i8 %a) nounwind ssp {
264 define void @uitofp_single_i8(i8 %a) nounwind {
265265 entry:
266266 ; ELF64: uitofp_single_i8
267267 ; ELF64LE: uitofp_single_i8
285285 ret void
286286 }
287287
288 define void @uitofp_double_i64(i64 %a, double %b) nounwind ssp {
288 define void @uitofp_double_i64(i64 %a, double %b) nounwind {
289289 entry:
290290 ; ELF64: uitofp_double_i64
291291 ; ELF64LE: uitofp_double_i64
303303 ret void
304304 }
305305
306 define void @uitofp_double_i32(i32 %a, double %b) nounwind ssp {
306 define void @uitofp_double_i32(i32 %a, double %b) nounwind {
307307 entry:
308308 ; ELF64: uitofp_double_i32
309309 ; ELF64LE: uitofp_double_i32
326326 ret void
327327 }
328328
329 define void @uitofp_double_i16(i16 %a, double %b) nounwind ssp {
329 define void @uitofp_double_i16(i16 %a, double %b) nounwind {
330330 entry:
331331 ; ELF64: uitofp_double_i16
332332 ; ELF64LE: uitofp_double_i16
349349 ret void
350350 }
351351
352 define void @uitofp_double_i8(i8 %a, double %b) nounwind ssp {
352 define void @uitofp_double_i8(i8 %a, double %b) nounwind {
353353 entry:
354354 ; ELF64: uitofp_double_i8
355355 ; ELF64LE: uitofp_double_i8
374374
375375 ; Test fptosi
376376
377 define void @fptosi_float_i32(float %a) nounwind ssp {
377 define void @fptosi_float_i32(float %a) nounwind {
378378 entry:
379379 ; ELF64: fptosi_float_i32
380380 ; ELF64LE: fptosi_float_i32
394394 ret void
395395 }
396396
397 define void @fptosi_float_i64(float %a) nounwind ssp {
397 define void @fptosi_float_i64(float %a) nounwind {
398398 entry:
399399 ; ELF64: fptosi_float_i64
400400 ; ELF64LE: fptosi_float_i64
414414 ret void
415415 }
416416
417 define void @fptosi_double_i32(double %a) nounwind ssp {
417 define void @fptosi_double_i32(double %a) nounwind {
418418 entry:
419419 ; ELF64: fptosi_double_i32
420420 ; ELF64LE: fptosi_double_i32
434434 ret void
435435 }
436436
437 define void @fptosi_double_i64(double %a) nounwind ssp {
437 define void @fptosi_double_i64(double %a) nounwind {
438438 entry:
439439 ; ELF64: fptosi_double_i64
440440 ; ELF64LE: fptosi_double_i64
456456
457457 ; Test fptoui
458458
459 define void @fptoui_float_i32(float %a) nounwind ssp {
459 define void @fptoui_float_i32(float %a) nounwind {
460460 entry:
461461 ; ELF64: fptoui_float_i32
462462 ; ELF64LE: fptoui_float_i32
476476 ret void
477477 }
478478
479 define void @fptoui_float_i64(float %a) nounwind ssp {
479 define void @fptoui_float_i64(float %a) nounwind {
480480 entry:
481481 ; ELF64: fptoui_float_i64
482482 ; ELF64LE: fptoui_float_i64
494494 ret void
495495 }
496496
497 define void @fptoui_double_i32(double %a) nounwind ssp {
497 define void @fptoui_double_i32(double %a) nounwind {
498498 entry:
499499 ; ELF64: fptoui_double_i32
500500 ; ELF64LE: fptoui_double_i32
514514 ret void
515515 }
516516
517 define void @fptoui_double_i64(double %a) nounwind ssp {
517 define void @fptoui_double_i64(double %a) nounwind {
518518 entry:
519519 ; ELF64: fptoui_double_i64
520520 ; ELF64LE: fptoui_double_i64
1010 ret void
1111 }
1212
13 define internal i32 @_Z13get_global_idj(i32 %dim) nounwind ssp {
13 define internal i32 @_Z13get_global_idj(i32 %dim) nounwind {
1414 entry:
1515 ret i32 undef
1616 }
1717
18 define void @wrap(i8 addrspace(1)* addrspace(1)* %arglist, i32 addrspace(1)* %gtid) nounwind ssp {
18 define void @wrap(i8 addrspace(1)* addrspace(1)* %arglist, i32 addrspace(1)* %gtid) nounwind {
1919 entry:
2020 call void @stretch(<4 x i8> addrspace(1)* undef, <4 x i8> addrspace(1)* undef, i32 undef, i32 undef, i32 undef, i32 undef, <2 x float> undef, <4 x float> undef)
2121 ret void
11
22 ; zext
33
4 define i32 @zext_8_32(i8 %a) nounwind ssp {
4 define i32 @zext_8_32(i8 %a) nounwind {
55 ; ELF64: zext_8_32
66 %r = zext i8 %a to i32
77 ; ELF64: clrlwi {{[0-9]+}}, {{[0-9]+}}, 24
88 ret i32 %r
99 }
1010
11 define i32 @zext_16_32(i16 %a) nounwind ssp {
11 define i32 @zext_16_32(i16 %a) nounwind {
1212 ; ELF64: zext_16_32
1313 %r = zext i16 %a to i32
1414 ; ELF64: clrlwi {{[0-9]+}}, {{[0-9]+}}, 16
1515 ret i32 %r
1616 }
1717
18 define i64 @zext_8_64(i8 %a) nounwind ssp {
18 define i64 @zext_8_64(i8 %a) nounwind {
1919 ; ELF64: zext_8_64
2020 %r = zext i8 %a to i64
2121 ; ELF64: rldicl {{[0-9]+}}, {{[0-9]+}}, 0, 56
2222 ret i64 %r
2323 }
2424
25 define i64 @zext_16_64(i16 %a) nounwind ssp {
25 define i64 @zext_16_64(i16 %a) nounwind {
2626 ; ELF64: zext_16_64
2727 %r = zext i16 %a to i64
2828 ; ELF64: rldicl {{[0-9]+}}, {{[0-9]+}}, 0, 48
2929 ret i64 %r
3030 }
3131
32 define i64 @zext_32_64(i32 %a) nounwind ssp {
32 define i64 @zext_32_64(i32 %a) nounwind {
3333 ; ELF64: zext_32_64
3434 %r = zext i32 %a to i64
3535 ; ELF64: rldicl {{[0-9]+}}, {{[0-9]+}}, 0, 32
3838
3939 ; sext
4040
41 define i32 @sext_8_32(i8 %a) nounwind ssp {
41 define i32 @sext_8_32(i8 %a) nounwind {
4242 ; ELF64: sext_8_32
4343 %r = sext i8 %a to i32
4444 ; ELF64: extsb
4545 ret i32 %r
4646 }
4747
48 define i32 @sext_16_32(i16 %a) nounwind ssp {
48 define i32 @sext_16_32(i16 %a) nounwind {
4949 ; ELF64: sext_16_32
5050 %r = sext i16 %a to i32
5151 ; ELF64: extsh
5252 ret i32 %r
5353 }
5454
55 define i64 @sext_8_64(i8 %a) nounwind ssp {
55 define i64 @sext_8_64(i8 %a) nounwind {
5656 ; ELF64: sext_8_64
5757 %r = sext i8 %a to i64
5858 ; ELF64: extsb
5959 ret i64 %r
6060 }
6161
62 define i64 @sext_16_64(i16 %a) nounwind ssp {
62 define i64 @sext_16_64(i16 %a) nounwind {
6363 ; ELF64: sext_16_64
6464 %r = sext i16 %a to i64
6565 ; ELF64: extsh
6666 ret i64 %r
6767 }
6868
69 define i64 @sext_32_64(i32 %a) nounwind ssp {
69 define i64 @sext_32_64(i32 %a) nounwind {
7070 ; ELF64: sext_32_64
7171 %r = sext i32 %a to i64
7272 ; ELF64: extsw
33 @b = global i16 2, align 2
44 @c = global i32 4, align 4
55
6 define void @t1() nounwind uwtable ssp {
6 define void @t1() nounwind {
77 ; ELF64: t1
88 %1 = load i8, i8* @a, align 1
99 call void @foo1(i8 zeroext %1)
1313 ret void
1414 }
1515
16 define void @t2() nounwind uwtable ssp {
16 define void @t2() nounwind {
1717 ; ELF64: t2
1818 %1 = load i16, i16* @b, align 2
1919 call void @foo2(i16 zeroext %1)
2323 ret void
2424 }
2525
26 define void @t2a() nounwind uwtable ssp {
26 define void @t2a() nounwind {
2727 ; ELF64: t2a
2828 %1 = load i32, i32* @c, align 4
2929 call void @foo3(i32 zeroext %1)
3737 declare void @foo2(i16 zeroext)
3838 declare void @foo3(i32 zeroext)
3939
40 define i32 @t3() nounwind uwtable ssp {
40 define i32 @t3() nounwind {
4141 ; ELF64: t3
4242 %1 = load i8, i8* @a, align 1
4343 %2 = zext i8 %1 to i32
4646 ret i32 %2
4747 }
4848
49 define i32 @t4() nounwind uwtable ssp {
49 define i32 @t4() nounwind {
5050 ; ELF64: t4
5151 %1 = load i16, i16* @b, align 2
5252 %2 = zext i16 %1 to i32
5555 ret i32 %2
5656 }
5757
58 define i32 @t5() nounwind uwtable ssp {
58 define i32 @t5() nounwind {
5959 ; ELF64: t5
6060 %1 = load i16, i16* @b, align 2
6161 %2 = sext i16 %1 to i32
6464 ret i32 %2
6565 }
6666
67 define i32 @t6() nounwind uwtable ssp {
67 define i32 @t6() nounwind {
6868 ; ELF64: t6
6969 %1 = load i8, i8* @a, align 2
7070 %2 = sext i8 %1 to i32
7373 ret i32 %2
7474 }
7575
76 define i64 @t7() nounwind uwtable ssp {
76 define i64 @t7() nounwind {
7777 ; ELF64: t7
7878 %1 = load i8, i8* @a, align 1
7979 %2 = zext i8 %1 to i64
8282 ret i64 %2
8383 }
8484
85 define i64 @t8() nounwind uwtable ssp {
85 define i64 @t8() nounwind {
8686 ; ELF64: t8
8787 %1 = load i16, i16* @b, align 2
8888 %2 = zext i16 %1 to i64
9191 ret i64 %2
9292 }
9393
94 define i64 @t9() nounwind uwtable ssp {
94 define i64 @t9() nounwind {
9595 ; ELF64: t9
9696 %1 = load i16, i16* @b, align 2
9797 %2 = sext i16 %1 to i64
100100 ret i64 %2
101101 }
102102
103 define i64 @t10() nounwind uwtable ssp {
103 define i64 @t10() nounwind {
104104 ; ELF64: t10
105105 %1 = load i8, i8* @a, align 2
106106 %2 = sext i8 %1 to i64
109109 ret i64 %2
110110 }
111111
112 define i64 @t11() nounwind uwtable ssp {
112 define i64 @t11() nounwind {
113113 ; ELF64: t11
114114 %1 = load i32, i32* @c, align 4
115115 %2 = zext i32 %1 to i64
118118 ret i64 %2
119119 }
120120
121 define i64 @t12() nounwind uwtable ssp {
121 define i64 @t12() nounwind {
122122 ; ELF64: t12
123123 %1 = load i32, i32* @c, align 4
124124 %2 = sext i32 %1 to i64
0 ; RUN: llc < %s -O0 -verify-machineinstrs -fast-isel-abort=1 -mtriple=powerpc64-unknown-linux-gnu -mcpu=pwr7 | FileCheck %s --check-prefix=ELF64
11
2 define void @t1(i8* %x) {
2 define void @t1(i8* %x) nounwind {
33 entry:
44 ; ELF64: t1
55 br label %L0
2323
2424 ; load
2525
26 define i8 @t1() nounwind uwtable ssp {
26 define i8 @t1() nounwind {
2727 ; ELF64: t1
2828 %1 = load i8, i8* @a, align 1
2929 ; ELF64: lbz
3232 ret i8 %2
3333 }
3434
35 define i16 @t2() nounwind uwtable ssp {
35 define i16 @t2() nounwind {
3636 ; ELF64: t2
3737 %1 = load i16, i16* @b, align 2
3838 ; ELF64: lhz
4141 ret i16 %2
4242 }
4343
44 define i32 @t3() nounwind uwtable ssp {
44 define i32 @t3() nounwind {
4545 ; ELF64: t3
4646 %1 = load i32, i32* @c, align 4
4747 ; ELF64: lwz
5050 ret i32 %2
5151 }
5252
53 define i64 @t4() nounwind uwtable ssp {
53 define i64 @t4() nounwind {
5454 ; ELF64: t4
5555 %1 = load i64, i64* @d, align 4
5656 ; ELF64: ld
5959 ret i64 %2
6060 }
6161
62 define float @t5() nounwind uwtable ssp {
62 define float @t5() nounwind {
6363 ; ELF64: t5
6464 %1 = load float, float* @e, align 4
6565 ; ELF64: lfs
6868 ret float %2
6969 }
7070
71 define double @t6() nounwind uwtable ssp {
71 define double @t6() nounwind {
7272 ; ELF64: t6
7373 %1 = load double, double* @f, align 8
7474 ; ELF64: lfd
7979
8080 ; store
8181
82 define void @t7(i8 %v) nounwind uwtable ssp {
82 define void @t7(i8 %v) nounwind {
8383 ; ELF64: t7
8484 %1 = add nsw i8 %v, 1
8585 store i8 %1, i8* @a, align 1
9090 ret void
9191 }
9292
93 define void @t8(i16 %v) nounwind uwtable ssp {
93 define void @t8(i16 %v) nounwind {
9494 ; ELF64: t8
9595 %1 = add nsw i16 %v, 1
9696 store i16 %1, i16* @b, align 2
101101 ret void
102102 }
103103
104 define void @t9(i32 %v) nounwind uwtable ssp {
104 define void @t9(i32 %v) nounwind {
105105 ; ELF64: t9
106106 %1 = add nsw i32 %v, 1
107107 store i32 %1, i32* @c, align 4
112112 ret void
113113 }
114114
115 define void @t10(i64 %v) nounwind uwtable ssp {
115 define void @t10(i64 %v) nounwind {
116116 ; ELF64: t10
117117 %1 = add nsw i64 %v, 1
118118 store i64 %1, i64* @d, align 4
123123 ret void
124124 }
125125
126 define void @t11(float %v) nounwind uwtable ssp {
126 define void @t11(float %v) nounwind {
127127 ; ELF64: t11
128128 %1 = fadd float %v, 1.0
129129 store float %1, float* @e, align 4
132132 ret void
133133 }
134134
135 define void @t12(double %v) nounwind uwtable ssp {
135 define void @t12(double %v) nounwind {
136136 ; ELF64: t12
137137 %1 = fadd double %v, 1.0
138138 store double %1, double* @f, align 8
142142 }
143143
144144 ;; lwa requires an offset divisible by 4, so we need lwax here.
145 define i64 @t13() nounwind uwtable ssp {
145 define i64 @t13() nounwind {
146146 ; ELF64: t13
147147 %1 = load i32, i32* getelementptr inbounds (%struct.s, %struct.s* @g, i32 0, i32 1), align 1
148148 %2 = sext i32 %1 to i64
154154 }
155155
156156 ;; ld requires an offset divisible by 4, so we need ldx here.
157 define i64 @t14() nounwind uwtable ssp {
157 define i64 @t14() nounwind {
158158 ; ELF64: t14
159159 %1 = load i64, i64* getelementptr inbounds (%struct.t, %struct.t* @h, i32 0, i32 1), align 1
160160 ; ELF64: li
165165 }
166166
167167 ;; std requires an offset divisible by 4, so we need stdx here.
168 define void @t15(i64 %v) nounwind uwtable ssp {
168 define void @t15(i64 %v) nounwind {
169169 ; ELF64: t15
170170 %1 = add nsw i64 %v, 1
171171 store i64 %1, i64* getelementptr inbounds (%struct.t, %struct.t* @h, i32 0, i32 1), align 1
178178 }
179179
180180 ;; ld requires an offset that fits in 16 bits, so we need ldx here.
181 define i64 @t16() nounwind uwtable ssp {
181 define i64 @t16() nounwind {
182182 ; ELF64: t16
183183 %1 = load i64, i64* getelementptr inbounds ([8192 x i64], [8192 x i64]* @i, i32 0, i64 5000), align 8
184184 ; ELF64: lis
190190 }
191191
192192 ;; std requires an offset that fits in 16 bits, so we need stdx here.
193 define void @t17(i64 %v) nounwind uwtable ssp {
193 define void @t17(i64 %v) nounwind {
194194 ; ELF64: t17
195195 %1 = add nsw i64 %v, 1
196196 store i64 %1, i64* getelementptr inbounds ([8192 x i64], [8192 x i64]* @i, i32 0, i64 5000), align 8
22 ; doesn't crash. (It crashed formerly on ARM, and proved useful in
33 ; discovering a bug on PowerPC as well.)
44
5 define i32 @f(i32* %x) nounwind ssp {
5 define i32 @f(i32* %x) nounwind {
66 %y = getelementptr inbounds i32, i32* %x, i32 5000
77 %tmp103 = load i32, i32* %y, align 4
88 ret i32 %tmp103
33 ;
44 ; RUN: llc < %s -O0 -verify-machineinstrs -fast-isel-abort=1 -mtriple=powerpc64-unknown-linux-gnu -mcpu=pwr7 -mattr=-vsx | FileCheck %s --check-prefix=ELF64
55
6 define zeroext i1 @rettrue() nounwind uwtable ssp {
6 define zeroext i1 @rettrue() nounwind {
77 entry:
88 ; ELF64-LABEL: rettrue
99 ; ELF64: li 3, 1
1111 ret i1 true
1212 }
1313
14 define zeroext i1 @retfalse() nounwind uwtable ssp {
14 define zeroext i1 @retfalse() nounwind {
1515 entry:
1616 ; ELF64-LABEL: retfalse
1717 ; ELF64: li 3, 0
1919 ret i1 false
2020 }
2121
22 define signext i1 @retstrue() nounwind uwtable ssp {
22 define signext i1 @retstrue() nounwind {
2323 entry:
2424 ; ELF64-LABEL: retstrue
2525 ; ELF64: li 3, -1
2727 ret i1 true
2828 }
2929
30 define signext i1 @retsfalse() nounwind uwtable ssp {
30 define signext i1 @retsfalse() nounwind {
3131 entry:
3232 ; ELF64-LABEL: retsfalse
3333 ; ELF64: li 3, 0
3535 ret i1 false
3636 }
3737
38 define signext i8 @ret2(i8 signext %a) nounwind uwtable ssp {
38 define signext i8 @ret2(i8 signext %a) nounwind {
3939 entry:
4040 ; ELF64-LABEL: ret2
4141 ; ELF64: extsb
4343 ret i8 %a
4444 }
4545
46 define zeroext i8 @ret3(i8 signext %a) nounwind uwtable ssp {
46 define zeroext i8 @ret3(i8 signext %a) nounwind {
4747 entry:
4848 ; ELF64-LABEL: ret3
4949 ; ELF64: rldicl {{[0-9]+}}, {{[0-9]+}}, 0, 56
5151 ret i8 %a
5252 }
5353
54 define signext i16 @ret4(i16 signext %a) nounwind uwtable ssp {
54 define signext i16 @ret4(i16 signext %a) nounwind {
5555 entry:
5656 ; ELF64-LABEL: ret4
5757 ; ELF64: extsh
5959 ret i16 %a
6060 }
6161
62 define zeroext i16 @ret5(i16 signext %a) nounwind uwtable ssp {
62 define zeroext i16 @ret5(i16 signext %a) nounwind {
6363 entry:
6464 ; ELF64-LABEL: ret5
6565 ; ELF64: rldicl {{[0-9]+}}, {{[0-9]+}}, 0, 48
6767 ret i16 %a
6868 }
6969
70 define i16 @ret6(i16 %a) nounwind uwtable ssp {
70 define i16 @ret6(i16 %a) nounwind {
7171 entry:
7272 ; ELF64-LABEL: ret6
7373 ; ELF64: rldicl {{[0-9]+}}, {{[0-9]+}}, 0, 48
7575 ret i16 %a
7676 }
7777
78 define signext i32 @ret7(i32 signext %a) nounwind uwtable ssp {
78 define signext i32 @ret7(i32 signext %a) nounwind {
7979 entry:
8080 ; ELF64-LABEL: ret7
8181 ; ELF64: extsw
8383 ret i32 %a
8484 }
8585
86 define zeroext i32 @ret8(i32 signext %a) nounwind uwtable ssp {
86 define zeroext i32 @ret8(i32 signext %a) nounwind {
8787 entry:
8888 ; ELF64-LABEL: ret8
8989 ; ELF64: rldicl {{[0-9]+}}, {{[0-9]+}}, 0, 32
9191 ret i32 %a
9292 }
9393
94 define i32 @ret9(i32 %a) nounwind uwtable ssp {
94 define i32 @ret9(i32 %a) nounwind {
9595 entry:
9696 ; ELF64-LABEL: ret9
9797 ; ELF64: rldicl {{[0-9]+}}, {{[0-9]+}}, 0, 32
9999 ret i32 %a
100100 }
101101
102 define i64 @ret10(i64 %a) nounwind uwtable ssp {
102 define i64 @ret10(i64 %a) nounwind {
103103 entry:
104104 ; ELF64-LABEL: ret10
105105 ; ELF64-NOT: exts
108108 ret i64 %a
109109 }
110110
111 define float @ret11(float %a) nounwind uwtable ssp {
111 define float @ret11(float %a) nounwind {
112112 entry:
113113 ; ELF64-LABEL: ret11
114114 ; ELF64: blr
115115 ret float %a
116116 }
117117
118 define double @ret12(double %a) nounwind uwtable ssp {
118 define double @ret12(double %a) nounwind {
119119 entry:
120120 ; ELF64-LABEL: ret12
121121 ; ELF64: blr
122122 ret double %a
123123 }
124124
125 define i8 @ret13() nounwind uwtable ssp {
125 define i8 @ret13() nounwind {
126126 entry:
127127 ; ELF64-LABEL: ret13
128128 ; ELF64: li
130130 ret i8 15;
131131 }
132132
133 define i16 @ret14() nounwind uwtable ssp {
133 define i16 @ret14() nounwind {
134134 entry:
135135 ; ELF64-LABEL: ret14
136136 ; ELF64: li
138138 ret i16 -225;
139139 }
140140
141 define i32 @ret15() nounwind uwtable ssp {
141 define i32 @ret15() nounwind {
142142 entry:
143143 ; ELF64-LABEL: ret15
144144 ; ELF64: lis
147147 ret i32 278135;
148148 }
149149
150 define i64 @ret16() nounwind uwtable ssp {
150 define i64 @ret16() nounwind {
151151 entry:
152152 ; ELF64-LABEL: ret16
153153 ; ELF64: li
158158 ret i64 27813515225;
159159 }
160160
161 define float @ret17() nounwind uwtable ssp {
161 define float @ret17() nounwind {
162162 entry:
163163 ; ELF64-LABEL: ret17
164164 ; ELF64: addis
167167 ret float 2.5;
168168 }
169169
170 define double @ret18() nounwind uwtable ssp {
170 define double @ret18() nounwind {
171171 entry:
172172 ; ELF64-LABEL: ret18
173173 ; ELF64: addis
0 ; RUN: llc < %s -O0 -verify-machineinstrs -fast-isel-abort=1 -mtriple=powerpc64-unknown-linux-gnu -mcpu=pwr7 | FileCheck %s --check-prefix=ELF64
11
2 define i32 @shl() nounwind ssp {
2 define i32 @shl() nounwind {
33 entry:
44 ; ELF64: shl
55 ; ELF64: slw
77 ret i32 %shl
88 }
99
10 define i32 @shl_reg(i32 %src1, i32 %src2) nounwind ssp {
10 define i32 @shl_reg(i32 %src1, i32 %src2) nounwind {
1111 entry:
1212 ; ELF64: shl_reg
1313 ; ELF64: slw
1515 ret i32 %shl
1616 }
1717
18 define i32 @lshr() nounwind ssp {
18 define i32 @lshr() nounwind {
1919 entry:
2020 ; ELF64: lshr
2121 ; ELF64: srw
2323 ret i32 %lshr
2424 }
2525
26 define i32 @lshr_reg(i32 %src1, i32 %src2) nounwind ssp {
26 define i32 @lshr_reg(i32 %src1, i32 %src2) nounwind {
2727 entry:
2828 ; ELF64: lshr_reg
2929 ; ELF64: srw
3131 ret i32 %lshr
3232 }
3333
34 define i32 @ashr() nounwind ssp {
34 define i32 @ashr() nounwind {
3535 entry:
3636 ; ELF64: ashr
3737 ; ELF64: srawi
3939 ret i32 %ashr
4040 }
4141
42 define i32 @ashr_reg(i32 %src1, i32 %src2) nounwind ssp {
42 define i32 @ashr_reg(i32 %src1, i32 %src2) nounwind {
4343 entry:
4444 ; ELF64: ashr_reg
4545 ; ELF64: sraw
11 ; sext(a) + sext(b) != sext(a + b)
22 ; RUN: llc -mtriple=powerpc64-unknown-freebsd10.0 %s -O0 -o - | FileCheck %s
33
4 define zeroext i8 @gep_promotion(i8* %ptr) nounwind uwtable ssp {
4 define zeroext i8 @gep_promotion(i8* %ptr) nounwind {
55 entry:
66 %ptr.addr = alloca i8*, align 8
77 %add = add i8 64, 64 ; 0x40 + 0x40