1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=aarch64 %s -o - | FileCheck %s
7 define i32 @foo_nounwind(i1 %cmp) nounwind {
8 ; CHECK-LABEL: foo_nounwind:
10 ; CHECK-NEXT: stp x29, x30, [sp, #-16]! // 16-byte Folded Spill
11 ; CHECK-NEXT: sub sp, sp, #97, lsl #12 // =397312
12 ; CHECK-NEXT: sub sp, sp, #2688
13 ; CHECK-NEXT: tbz w0, #0, .LBB0_2
14 ; CHECK-NEXT: // %bb.1: // %br1
15 ; CHECK-NEXT: mov w0, wzr
17 ; CHECK-NEXT: add w0, w0, #1
18 ; CHECK-NEXT: add sp, sp, #97, lsl #12 // =397312
19 ; CHECK-NEXT: add sp, sp, #2688
20 ; CHECK-NEXT: ldp x29, x30, [sp], #16 // 16-byte Folded Reload
22 ; CHECK-NEXT: .LBB0_2: // %br2
23 ; CHECK-NEXT: mov w8, #42 // =0x2a
24 ; CHECK-NEXT: mov x0, sp
25 ; CHECK-NEXT: str w8, [sp]
27 ; CHECK-NEXT: add sp, sp, #97, lsl #12 // =397312
28 ; CHECK-NEXT: add sp, sp, #2688
29 ; CHECK-NEXT: ldp x29, x30, [sp], #16 // 16-byte Folded Reload
31 %ptr = alloca i32, i32 100000, align 4
32 br i1 %cmp, label %br1, label %br2
35 %call1 = call i32 @g0(i32 0)
36 %rv1 = add i32 %call1, 1
40 store i32 42, ptr %ptr, align 4
41 %call2 = call i32 @g1(ptr %ptr)
42 %rv2 = tail call i32 @g0(i32 %call2)
46 define i32 @foo_default(i1 %cmp) {
47 ; CHECK-LABEL: foo_default:
49 ; CHECK-NEXT: stp x29, x30, [sp, #-16]! // 16-byte Folded Spill
50 ; CHECK-NEXT: sub sp, sp, #97, lsl #12 // =397312
51 ; CHECK-NEXT: sub sp, sp, #2688
52 ; CHECK-NEXT: .cfi_def_cfa_offset 400016
53 ; CHECK-NEXT: .cfi_offset w30, -8
54 ; CHECK-NEXT: .cfi_offset w29, -16
55 ; CHECK-NEXT: tbz w0, #0, .LBB1_2
56 ; CHECK-NEXT: // %bb.1: // %br1
57 ; CHECK-NEXT: mov w0, wzr
59 ; CHECK-NEXT: add w0, w0, #1
60 ; CHECK-NEXT: add sp, sp, #97, lsl #12 // =397312
61 ; CHECK-NEXT: add sp, sp, #2688
62 ; CHECK-NEXT: ldp x29, x30, [sp], #16 // 16-byte Folded Reload
64 ; CHECK-NEXT: .LBB1_2: // %br2
65 ; CHECK-NEXT: mov w8, #42 // =0x2a
66 ; CHECK-NEXT: mov x0, sp
67 ; CHECK-NEXT: str w8, [sp]
69 ; CHECK-NEXT: add sp, sp, #97, lsl #12 // =397312
70 ; CHECK-NEXT: add sp, sp, #2688
71 ; CHECK-NEXT: ldp x29, x30, [sp], #16 // 16-byte Folded Reload
73 %ptr = alloca i32, i32 100000, align 4
74 br i1 %cmp, label %br1, label %br2
77 %call1 = call i32 @g0(i32 0)
78 %rv1 = add i32 %call1, 1
82 store i32 42, ptr %ptr, align 4
83 %call2 = call i32 @g1(ptr %ptr)
84 %rv2 = tail call i32 @g0(i32 %call2)
88 define i32 @foo_uwtable(i1 %cmp) uwtable {
89 ; CHECK-LABEL: foo_uwtable:
91 ; CHECK-NEXT: stp x29, x30, [sp, #-16]! // 16-byte Folded Spill
92 ; CHECK-NEXT: .cfi_def_cfa_offset 16
93 ; CHECK-NEXT: .cfi_offset w30, -8
94 ; CHECK-NEXT: .cfi_offset w29, -16
95 ; CHECK-NEXT: sub sp, sp, #97, lsl #12 // =397312
96 ; CHECK-NEXT: .cfi_def_cfa_offset 397328
97 ; CHECK-NEXT: sub sp, sp, #2688
98 ; CHECK-NEXT: .cfi_def_cfa_offset 400016
99 ; CHECK-NEXT: .cfi_remember_state
100 ; CHECK-NEXT: tbz w0, #0, .LBB2_2
101 ; CHECK-NEXT: // %bb.1: // %br1
102 ; CHECK-NEXT: mov w0, wzr
104 ; CHECK-NEXT: add w0, w0, #1
105 ; CHECK-NEXT: add sp, sp, #97, lsl #12 // =397312
106 ; CHECK-NEXT: .cfi_def_cfa_offset 2704
107 ; CHECK-NEXT: add sp, sp, #2688
108 ; CHECK-NEXT: .cfi_def_cfa_offset 16
109 ; CHECK-NEXT: ldp x29, x30, [sp], #16 // 16-byte Folded Reload
110 ; CHECK-NEXT: .cfi_def_cfa_offset 0
111 ; CHECK-NEXT: .cfi_restore w30
112 ; CHECK-NEXT: .cfi_restore w29
114 ; CHECK-NEXT: .LBB2_2: // %br2
115 ; CHECK-NEXT: .cfi_restore_state
116 ; CHECK-NEXT: mov w8, #42 // =0x2a
117 ; CHECK-NEXT: mov x0, sp
118 ; CHECK-NEXT: str w8, [sp]
120 ; CHECK-NEXT: add sp, sp, #97, lsl #12 // =397312
121 ; CHECK-NEXT: .cfi_def_cfa_offset 2704
122 ; CHECK-NEXT: add sp, sp, #2688
123 ; CHECK-NEXT: .cfi_def_cfa_offset 16
124 ; CHECK-NEXT: ldp x29, x30, [sp], #16 // 16-byte Folded Reload
125 ; CHECK-NEXT: .cfi_def_cfa_offset 0
126 ; CHECK-NEXT: .cfi_restore w30
127 ; CHECK-NEXT: .cfi_restore w29
129 %ptr = alloca i32, i32 100000, align 4
130 br i1 %cmp, label %br1, label %br2
133 %call1 = call i32 @g0(i32 0)
134 %rv1 = add i32 %call1, 1
138 store i32 42, ptr %ptr, align 4
139 %call2 = call i32 @g1(ptr %ptr)
140 %rv2 = tail call i32 @g0(i32 %call2)
144 define i32 @foo_uwtable_sync(i1 %cmp) uwtable(sync) {
145 ; CHECK-LABEL: foo_uwtable_sync:
147 ; CHECK-NEXT: stp x29, x30, [sp, #-16]! // 16-byte Folded Spill
148 ; CHECK-NEXT: sub sp, sp, #97, lsl #12 // =397312
149 ; CHECK-NEXT: sub sp, sp, #2688
150 ; CHECK-NEXT: .cfi_def_cfa_offset 400016
151 ; CHECK-NEXT: .cfi_offset w30, -8
152 ; CHECK-NEXT: .cfi_offset w29, -16
153 ; CHECK-NEXT: tbz w0, #0, .LBB3_2
154 ; CHECK-NEXT: // %bb.1: // %br1
155 ; CHECK-NEXT: mov w0, wzr
157 ; CHECK-NEXT: add w0, w0, #1
158 ; CHECK-NEXT: add sp, sp, #97, lsl #12 // =397312
159 ; CHECK-NEXT: add sp, sp, #2688
160 ; CHECK-NEXT: ldp x29, x30, [sp], #16 // 16-byte Folded Reload
162 ; CHECK-NEXT: .LBB3_2: // %br2
163 ; CHECK-NEXT: mov w8, #42 // =0x2a
164 ; CHECK-NEXT: mov x0, sp
165 ; CHECK-NEXT: str w8, [sp]
167 ; CHECK-NEXT: add sp, sp, #97, lsl #12 // =397312
168 ; CHECK-NEXT: add sp, sp, #2688
169 ; CHECK-NEXT: ldp x29, x30, [sp], #16 // 16-byte Folded Reload
171 %ptr = alloca i32, i32 100000, align 4
172 br i1 %cmp, label %br1, label %br2
175 %call1 = call i32 @g0(i32 0)
176 %rv1 = add i32 %call1, 1
180 store i32 42, ptr %ptr, align 4
181 %call2 = call i32 @g1(ptr %ptr)
182 %rv2 = tail call i32 @g0(i32 %call2)
186 define i32 @foo_uwtable_async(i1 %cmp) uwtable(async) {
187 ; CHECK-LABEL: foo_uwtable_async:
189 ; CHECK-NEXT: stp x29, x30, [sp, #-16]! // 16-byte Folded Spill
190 ; CHECK-NEXT: .cfi_def_cfa_offset 16
191 ; CHECK-NEXT: .cfi_offset w30, -8
192 ; CHECK-NEXT: .cfi_offset w29, -16
193 ; CHECK-NEXT: sub sp, sp, #97, lsl #12 // =397312
194 ; CHECK-NEXT: .cfi_def_cfa_offset 397328
195 ; CHECK-NEXT: sub sp, sp, #2688
196 ; CHECK-NEXT: .cfi_def_cfa_offset 400016
197 ; CHECK-NEXT: .cfi_remember_state
198 ; CHECK-NEXT: tbz w0, #0, .LBB4_2
199 ; CHECK-NEXT: // %bb.1: // %br1
200 ; CHECK-NEXT: mov w0, wzr
202 ; CHECK-NEXT: add w0, w0, #1
203 ; CHECK-NEXT: add sp, sp, #97, lsl #12 // =397312
204 ; CHECK-NEXT: .cfi_def_cfa_offset 2704
205 ; CHECK-NEXT: add sp, sp, #2688
206 ; CHECK-NEXT: .cfi_def_cfa_offset 16
207 ; CHECK-NEXT: ldp x29, x30, [sp], #16 // 16-byte Folded Reload
208 ; CHECK-NEXT: .cfi_def_cfa_offset 0
209 ; CHECK-NEXT: .cfi_restore w30
210 ; CHECK-NEXT: .cfi_restore w29
212 ; CHECK-NEXT: .LBB4_2: // %br2
213 ; CHECK-NEXT: .cfi_restore_state
214 ; CHECK-NEXT: mov w8, #42 // =0x2a
215 ; CHECK-NEXT: mov x0, sp
216 ; CHECK-NEXT: str w8, [sp]
218 ; CHECK-NEXT: add sp, sp, #97, lsl #12 // =397312
219 ; CHECK-NEXT: .cfi_def_cfa_offset 2704
220 ; CHECK-NEXT: add sp, sp, #2688
221 ; CHECK-NEXT: .cfi_def_cfa_offset 16
222 ; CHECK-NEXT: ldp x29, x30, [sp], #16 // 16-byte Folded Reload
223 ; CHECK-NEXT: .cfi_def_cfa_offset 0
224 ; CHECK-NEXT: .cfi_restore w30
225 ; CHECK-NEXT: .cfi_restore w29
227 %ptr = alloca i32, i32 100000, align 4
228 br i1 %cmp, label %br1, label %br2
231 %call1 = call i32 @g0(i32 0)
232 %rv1 = add i32 %call1, 1
236 store i32 42, ptr %ptr, align 4
237 %call2 = call i32 @g1(ptr %ptr)
238 %rv2 = tail call i32 @g0(i32 %call2)