1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc < %s -mtriple=arm64-apple-ios7.0 -homogeneous-prolog-epilog -frame-helper-size-threshold=6 | FileCheck %s
3 ; RUN: llc < %s -mtriple=aarch64-unknown-linux-gnu -homogeneous-prolog-epilog -frame-helper-size-threshold=6 | FileCheck %s --check-prefixes=CHECK-LINUX
5 define float @_Z3foofffi(float %b, float %x, float %y, i32 %z) uwtable ssp minsize "frame-pointer"="non-leaf" {
6 ; CHECK-LABEL: _Z3foofffi:
7 ; CHECK: ; %bb.0: ; %entry
8 ; CHECK-NEXT: stp d11, d10, [sp, #-64]!
9 ; CHECK-NEXT: stp d9, d8, [sp, #16]
10 ; CHECK-NEXT: stp x20, x19, [sp, #32]
11 ; CHECK-NEXT: stp x29, x30, [sp, #48]
12 ; CHECK-NEXT: add x29, sp, #48
13 ; CHECK-NEXT: .cfi_def_cfa w29, 16
14 ; CHECK-NEXT: .cfi_offset w30, -8
15 ; CHECK-NEXT: .cfi_offset w29, -16
16 ; CHECK-NEXT: .cfi_offset w19, -24
17 ; CHECK-NEXT: .cfi_offset w20, -32
18 ; CHECK-NEXT: .cfi_offset b8, -40
19 ; CHECK-NEXT: .cfi_offset b9, -48
20 ; CHECK-NEXT: .cfi_offset b10, -56
21 ; CHECK-NEXT: .cfi_offset b11, -64
22 ; CHECK-NEXT: fmov s3, #1.00000000
23 ; CHECK-NEXT: sub w19, w0, #1
24 ; CHECK-NEXT: fadd s8, s0, s3
25 ; CHECK-NEXT: fadd s0, s8, s1
26 ; CHECK-NEXT: scvtf s1, w0
27 ; CHECK-NEXT: fadd s0, s0, s2
28 ; CHECK-NEXT: fsub s9, s0, s1
29 ; CHECK-NEXT: fmov s0, s8
30 ; CHECK-NEXT: bl __Z3goof
31 ; CHECK-NEXT: fmov s10, s0
32 ; CHECK-NEXT: fmov s0, s9
33 ; CHECK-NEXT: bl __Z3goof
34 ; CHECK-NEXT: fadd s0, s10, s0
35 ; CHECK-NEXT: scvtf s1, w19
36 ; CHECK-NEXT: ldp x29, x30, [sp, #48]
37 ; CHECK-NEXT: ldp x20, x19, [sp, #32]
38 ; CHECK-NEXT: fmul s0, s8, s0
39 ; CHECK-NEXT: fadd s0, s9, s0
40 ; CHECK-NEXT: ldp d9, d8, [sp, #16]
41 ; CHECK-NEXT: fsub s0, s0, s1
42 ; CHECK-NEXT: ldp d11, d10, [sp], #64
45 ; CHECK-LINUX-LABEL: _Z3foofffi:
46 ; CHECK-LINUX: // %bb.0: // %entry
47 ; CHECK-LINUX-NEXT: stp d11, d10, [sp, #-64]!
48 ; CHECK-LINUX-NEXT: stp d9, d8, [sp, #16]
49 ; CHECK-LINUX-NEXT: stp x29, x30, [sp, #32]
50 ; CHECK-LINUX-NEXT: stp x20, x19, [sp, #48]
51 ; CHECK-LINUX-NEXT: add x29, sp, #32
52 ; CHECK-LINUX-NEXT: .cfi_def_cfa w29, 32
53 ; CHECK-LINUX-NEXT: .cfi_offset w19, -8
54 ; CHECK-LINUX-NEXT: .cfi_offset w20, -16
55 ; CHECK-LINUX-NEXT: .cfi_offset w30, -24
56 ; CHECK-LINUX-NEXT: .cfi_offset w29, -32
57 ; CHECK-LINUX-NEXT: .cfi_offset b8, -40
58 ; CHECK-LINUX-NEXT: .cfi_offset b9, -48
59 ; CHECK-LINUX-NEXT: .cfi_offset b10, -56
60 ; CHECK-LINUX-NEXT: .cfi_offset b11, -64
61 ; CHECK-LINUX-NEXT: fmov s3, #1.00000000
62 ; CHECK-LINUX-NEXT: sub w19, w0, #1
63 ; CHECK-LINUX-NEXT: fadd s8, s0, s3
64 ; CHECK-LINUX-NEXT: fadd s0, s8, s1
65 ; CHECK-LINUX-NEXT: scvtf s1, w0
66 ; CHECK-LINUX-NEXT: fadd s0, s0, s2
67 ; CHECK-LINUX-NEXT: fsub s9, s0, s1
68 ; CHECK-LINUX-NEXT: fmov s0, s8
69 ; CHECK-LINUX-NEXT: bl _Z3goof
70 ; CHECK-LINUX-NEXT: fmov s10, s0
71 ; CHECK-LINUX-NEXT: fmov s0, s9
72 ; CHECK-LINUX-NEXT: bl _Z3goof
73 ; CHECK-LINUX-NEXT: fadd s0, s10, s0
74 ; CHECK-LINUX-NEXT: scvtf s1, w19
75 ; CHECK-LINUX-NEXT: ldp x20, x19, [sp, #48]
76 ; CHECK-LINUX-NEXT: ldp x29, x30, [sp, #32]
77 ; CHECK-LINUX-NEXT: fmul s0, s8, s0
78 ; CHECK-LINUX-NEXT: fadd s0, s9, s0
79 ; CHECK-LINUX-NEXT: ldp d9, d8, [sp, #16]
80 ; CHECK-LINUX-NEXT: fsub s0, s0, s1
81 ; CHECK-LINUX-NEXT: ldp d11, d10, [sp], #64
82 ; CHECK-LINUX-NEXT: ret
84 %inc = fadd float %b, 1.000000e+00
85 %add = fadd float %inc, %x
86 %add1 = fadd float %add, %y
87 %conv = sitofp i32 %z to float
88 %sub = fsub float %add1, %conv
89 %dec = add nsw i32 %z, -1
90 %call = tail call float @_Z3goof(float %inc) #2
91 %call2 = tail call float @_Z3goof(float %sub) #2
92 %add3 = fadd float %call, %call2
93 %mul = fmul float %inc, %add3
94 %add4 = fadd float %sub, %mul
95 %conv5 = sitofp i32 %dec to float
96 %sub6 = fsub float %add4, %conv5
100 define i32 @_Z3zoov() nounwind ssp minsize {
101 ; CHECK-LABEL: _Z3zoov:
103 ; CHECK-NEXT: stp x29, x30, [sp, #-16]!
104 ; CHECK-NEXT: bl __Z3hoov
105 ; CHECK-NEXT: add w0, w0, #1
106 ; CHECK-NEXT: ldp x29, x30, [sp], #16
109 ; CHECK-LINUX-LABEL: _Z3zoov:
110 ; CHECK-LINUX: // %bb.0:
111 ; CHECK-LINUX-NEXT: stp x29, x30, [sp, #-16]!
112 ; CHECK-LINUX-NEXT: bl _Z3hoov
113 ; CHECK-LINUX-NEXT: add w0, w0, #1
114 ; CHECK-LINUX-NEXT: ldp x29, x30, [sp], #16
115 ; CHECK-LINUX-NEXT: ret
116 %1 = tail call i32 @_Z3hoov() #2
117 %2 = add nsw i32 %1, 1
122 declare float @_Z3goof(float) nounwind ssp minsize
123 declare i32 @_Z3hoov() nounwind ssp minsize