1 ; NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 ; RUN: llc -mtriple=m68k -O0 -global-isel -stop-after=irtranslator -verify-machineinstrs %s -o - | FileCheck %s
4 %struct.A = type { i8, i16, i32 }
6 declare void @trivial_callee()
7 define void @test_trivial_call() {
8 ; CHECK-LABEL: name: test_trivial_call
9 ; CHECK: bb.1 (%ir-block.0):
10 ; CHECK-NEXT: ADJCALLSTACKDOWN 0, 0, implicit-def $sp, implicit-def $ccr, implicit $sp
11 ; CHECK-NEXT: CALLb @trivial_callee, csr_std, implicit $sp
12 ; CHECK-NEXT: ADJCALLSTACKUP 0, 0, implicit-def $sp, implicit-def $ccr, implicit $sp
14 call void @trivial_callee()
18 declare i32 @ret_i32_callee()
19 define i32 @test_ret_i32() {
20 ; CHECK-LABEL: name: test_ret_i32
21 ; CHECK: bb.1 (%ir-block.0):
22 ; CHECK-NEXT: ADJCALLSTACKDOWN 0, 0, implicit-def $sp, implicit-def $ccr, implicit $sp
23 ; CHECK-NEXT: CALLb @ret_i32_callee, csr_std, implicit $sp, implicit-def $d0
24 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $d0
25 ; CHECK-NEXT: ADJCALLSTACKUP 0, 0, implicit-def $sp, implicit-def $ccr, implicit $sp
26 ; CHECK-NEXT: $d0 = COPY [[COPY]](s32)
27 ; CHECK-NEXT: RTS implicit $d0
28 %res = call i32 @ret_i32_callee()
32 declare i16 @ret_i16_callee()
33 define i16 @test_ret_i16() nounwind {
34 ; CHECK-LABEL: name: test_ret_i16
35 ; CHECK: bb.1 (%ir-block.0):
36 ; CHECK-NEXT: ADJCALLSTACKDOWN 0, 0, implicit-def $sp, implicit-def $ccr, implicit $sp
37 ; CHECK-NEXT: CALLb @ret_i16_callee, csr_std, implicit $sp, implicit-def $wd0
38 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s16) = COPY $wd0
39 ; CHECK-NEXT: ADJCALLSTACKUP 0, 0, implicit-def $sp, implicit-def $ccr, implicit $sp
40 ; CHECK-NEXT: $wd0 = COPY [[COPY]](s16)
41 ; CHECK-NEXT: RTS implicit $wd0
42 %1 = call i16 @ret_i16_callee()
46 declare i8 @ret_i8_callee()
47 define i8 @test_ret_i8() nounwind {
48 ; CHECK-LABEL: name: test_ret_i8
49 ; CHECK: bb.1 (%ir-block.0):
50 ; CHECK-NEXT: ADJCALLSTACKDOWN 0, 0, implicit-def $sp, implicit-def $ccr, implicit $sp
51 ; CHECK-NEXT: CALLb @ret_i8_callee, csr_std, implicit $sp, implicit-def $bd0
52 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(s8) = COPY $bd0
53 ; CHECK-NEXT: ADJCALLSTACKUP 0, 0, implicit-def $sp, implicit-def $ccr, implicit $sp
54 ; CHECK-NEXT: $bd0 = COPY [[COPY]](s8)
55 ; CHECK-NEXT: RTS implicit $bd0
56 %1 = call i8 @ret_i8_callee()
60 declare void @sret_callee(ptr sret(%struct.A))
61 define void @test_sret(ptr sret(%struct.A) %0) nounwind {
62 ; CHECK-LABEL: name: test_sret
63 ; CHECK: bb.1 (%ir-block.1):
64 ; CHECK-NEXT: [[FRAME_INDEX:%[0-9]+]]:_(p0) = G_FRAME_INDEX %fixed-stack.0
65 ; CHECK-NEXT: [[LOAD:%[0-9]+]]:_(p0) = G_LOAD [[FRAME_INDEX]](p0) :: (load (p0) from %fixed-stack.0, align 8)
66 ; CHECK-NEXT: ADJCALLSTACKDOWN 4, 0, implicit-def $sp, implicit-def $ccr, implicit $sp
67 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(p0) = COPY $sp
68 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
69 ; CHECK-NEXT: [[PTR_ADD:%[0-9]+]]:_(p0) = G_PTR_ADD [[COPY]], [[C]](s32)
70 ; CHECK-NEXT: G_STORE [[LOAD]](p0), [[PTR_ADD]](p0) :: (store (p0) into stack, align 1)
71 ; CHECK-NEXT: CALLb @sret_callee, csr_std, implicit $sp
72 ; CHECK-NEXT: ADJCALLSTACKUP 4, 0, implicit-def $sp, implicit-def $ccr, implicit $sp
74 call void @sret_callee(ptr sret(%struct.A) %0)
78 declare void @arg_i32_i16_i8_callee(i32, i16, i8)
79 define void @test_arg_i32_i16_i8() nounwind {
80 ; CHECK-LABEL: name: test_arg_i32_i16_i8
81 ; CHECK: bb.1 (%ir-block.0):
82 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
83 ; CHECK-NEXT: [[C1:%[0-9]+]]:_(s16) = G_CONSTANT i16 1
84 ; CHECK-NEXT: [[C2:%[0-9]+]]:_(s8) = G_CONSTANT i8 2
85 ; CHECK-NEXT: ADJCALLSTACKDOWN 12, 0, implicit-def $sp, implicit-def $ccr, implicit $sp
86 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(p0) = COPY $sp
87 ; CHECK-NEXT: [[C3:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
88 ; CHECK-NEXT: [[PTR_ADD:%[0-9]+]]:_(p0) = G_PTR_ADD [[COPY]], [[C3]](s32)
89 ; CHECK-NEXT: G_STORE [[C]](s32), [[PTR_ADD]](p0) :: (store (s32) into stack, align 1)
90 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(p0) = COPY $sp
91 ; CHECK-NEXT: [[C4:%[0-9]+]]:_(s32) = G_CONSTANT i32 4
92 ; CHECK-NEXT: [[PTR_ADD1:%[0-9]+]]:_(p0) = G_PTR_ADD [[COPY1]], [[C4]](s32)
93 ; CHECK-NEXT: [[ANYEXT:%[0-9]+]]:_(s32) = G_ANYEXT [[C1]](s16)
94 ; CHECK-NEXT: G_STORE [[ANYEXT]](s32), [[PTR_ADD1]](p0) :: (store (s16) into stack + 4, align 1)
95 ; CHECK-NEXT: [[COPY2:%[0-9]+]]:_(p0) = COPY $sp
96 ; CHECK-NEXT: [[C5:%[0-9]+]]:_(s32) = G_CONSTANT i32 8
97 ; CHECK-NEXT: [[PTR_ADD2:%[0-9]+]]:_(p0) = G_PTR_ADD [[COPY2]], [[C5]](s32)
98 ; CHECK-NEXT: [[ANYEXT1:%[0-9]+]]:_(s32) = G_ANYEXT [[C2]](s8)
99 ; CHECK-NEXT: G_STORE [[ANYEXT1]](s32), [[PTR_ADD2]](p0) :: (store (s8) into stack + 8)
100 ; CHECK-NEXT: CALLb @arg_i32_i16_i8_callee, csr_std, implicit $sp
101 ; CHECK-NEXT: ADJCALLSTACKUP 12, 0, implicit-def $sp, implicit-def $ccr, implicit $sp
103 call void @arg_i32_i16_i8_callee(i32 0, i16 1, i8 2)
107 declare void @arg_struct_callee(%struct.A)
108 define void @test_arg_struct(ptr %0) nounwind {
109 ; CHECK-LABEL: name: test_arg_struct
110 ; CHECK: bb.1 (%ir-block.1):
111 ; CHECK-NEXT: [[FRAME_INDEX:%[0-9]+]]:_(p0) = G_FRAME_INDEX %fixed-stack.0
112 ; CHECK-NEXT: [[LOAD:%[0-9]+]]:_(p0) = G_LOAD [[FRAME_INDEX]](p0) :: (load (p0) from %fixed-stack.0, align 8)
113 ; CHECK-NEXT: [[LOAD1:%[0-9]+]]:_(s8) = G_LOAD [[LOAD]](p0) :: (load (s8) from %ir.0, align 2)
114 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 2
115 ; CHECK-NEXT: [[PTR_ADD:%[0-9]+]]:_(p0) = G_PTR_ADD [[LOAD]], [[C]](s32)
116 ; CHECK-NEXT: [[LOAD2:%[0-9]+]]:_(s16) = G_LOAD [[PTR_ADD]](p0) :: (load (s16) from %ir.0 + 2)
117 ; CHECK-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 4
118 ; CHECK-NEXT: [[PTR_ADD1:%[0-9]+]]:_(p0) = G_PTR_ADD [[LOAD]], [[C1]](s32)
119 ; CHECK-NEXT: [[LOAD3:%[0-9]+]]:_(s32) = G_LOAD [[PTR_ADD1]](p0) :: (load (s32) from %ir.0 + 4, align 2)
120 ; CHECK-NEXT: ADJCALLSTACKDOWN 12, 0, implicit-def $sp, implicit-def $ccr, implicit $sp
121 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(p0) = COPY $sp
122 ; CHECK-NEXT: [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
123 ; CHECK-NEXT: [[PTR_ADD2:%[0-9]+]]:_(p0) = G_PTR_ADD [[COPY]], [[C2]](s32)
124 ; CHECK-NEXT: [[ANYEXT:%[0-9]+]]:_(s32) = G_ANYEXT [[LOAD1]](s8)
125 ; CHECK-NEXT: G_STORE [[ANYEXT]](s32), [[PTR_ADD2]](p0) :: (store (s8) into stack)
126 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(p0) = COPY $sp
127 ; CHECK-NEXT: [[C3:%[0-9]+]]:_(s32) = G_CONSTANT i32 4
128 ; CHECK-NEXT: [[PTR_ADD3:%[0-9]+]]:_(p0) = G_PTR_ADD [[COPY1]], [[C3]](s32)
129 ; CHECK-NEXT: [[ANYEXT1:%[0-9]+]]:_(s32) = G_ANYEXT [[LOAD2]](s16)
130 ; CHECK-NEXT: G_STORE [[ANYEXT1]](s32), [[PTR_ADD3]](p0) :: (store (s16) into stack + 4, align 1)
131 ; CHECK-NEXT: [[COPY2:%[0-9]+]]:_(p0) = COPY $sp
132 ; CHECK-NEXT: [[C4:%[0-9]+]]:_(s32) = G_CONSTANT i32 8
133 ; CHECK-NEXT: [[PTR_ADD4:%[0-9]+]]:_(p0) = G_PTR_ADD [[COPY2]], [[C4]](s32)
134 ; CHECK-NEXT: G_STORE [[LOAD3]](s32), [[PTR_ADD4]](p0) :: (store (s32) into stack + 8, align 1)
135 ; CHECK-NEXT: CALLb @arg_struct_callee, csr_std, implicit $sp
136 ; CHECK-NEXT: ADJCALLSTACKUP 12, 0, implicit-def $sp, implicit-def $ccr, implicit $sp
138 %2 = load %struct.A, ptr %0
139 call void @arg_struct_callee(%struct.A %2)
143 declare void @arg_array_callee([8 x i8])
144 define void @test_arg_array(ptr %0) nounwind {
145 ; CHECK-LABEL: name: test_arg_array
146 ; CHECK: bb.1 (%ir-block.1):
147 ; CHECK-NEXT: [[FRAME_INDEX:%[0-9]+]]:_(p0) = G_FRAME_INDEX %fixed-stack.0
148 ; CHECK-NEXT: [[LOAD:%[0-9]+]]:_(p0) = G_LOAD [[FRAME_INDEX]](p0) :: (load (p0) from %fixed-stack.0, align 8)
149 ; CHECK-NEXT: [[LOAD1:%[0-9]+]]:_(s8) = G_LOAD [[LOAD]](p0) :: (load (s8) from %ir.0)
150 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
151 ; CHECK-NEXT: [[PTR_ADD:%[0-9]+]]:_(p0) = G_PTR_ADD [[LOAD]], [[C]](s32)
152 ; CHECK-NEXT: [[LOAD2:%[0-9]+]]:_(s8) = G_LOAD [[PTR_ADD]](p0) :: (load (s8) from %ir.0 + 1)
153 ; CHECK-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 2
154 ; CHECK-NEXT: [[PTR_ADD1:%[0-9]+]]:_(p0) = G_PTR_ADD [[LOAD]], [[C1]](s32)
155 ; CHECK-NEXT: [[LOAD3:%[0-9]+]]:_(s8) = G_LOAD [[PTR_ADD1]](p0) :: (load (s8) from %ir.0 + 2)
156 ; CHECK-NEXT: [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 3
157 ; CHECK-NEXT: [[PTR_ADD2:%[0-9]+]]:_(p0) = G_PTR_ADD [[LOAD]], [[C2]](s32)
158 ; CHECK-NEXT: [[LOAD4:%[0-9]+]]:_(s8) = G_LOAD [[PTR_ADD2]](p0) :: (load (s8) from %ir.0 + 3)
159 ; CHECK-NEXT: [[C3:%[0-9]+]]:_(s32) = G_CONSTANT i32 4
160 ; CHECK-NEXT: [[PTR_ADD3:%[0-9]+]]:_(p0) = G_PTR_ADD [[LOAD]], [[C3]](s32)
161 ; CHECK-NEXT: [[LOAD5:%[0-9]+]]:_(s8) = G_LOAD [[PTR_ADD3]](p0) :: (load (s8) from %ir.0 + 4)
162 ; CHECK-NEXT: [[C4:%[0-9]+]]:_(s32) = G_CONSTANT i32 5
163 ; CHECK-NEXT: [[PTR_ADD4:%[0-9]+]]:_(p0) = G_PTR_ADD [[LOAD]], [[C4]](s32)
164 ; CHECK-NEXT: [[LOAD6:%[0-9]+]]:_(s8) = G_LOAD [[PTR_ADD4]](p0) :: (load (s8) from %ir.0 + 5)
165 ; CHECK-NEXT: [[C5:%[0-9]+]]:_(s32) = G_CONSTANT i32 6
166 ; CHECK-NEXT: [[PTR_ADD5:%[0-9]+]]:_(p0) = G_PTR_ADD [[LOAD]], [[C5]](s32)
167 ; CHECK-NEXT: [[LOAD7:%[0-9]+]]:_(s8) = G_LOAD [[PTR_ADD5]](p0) :: (load (s8) from %ir.0 + 6)
168 ; CHECK-NEXT: [[C6:%[0-9]+]]:_(s32) = G_CONSTANT i32 7
169 ; CHECK-NEXT: [[PTR_ADD6:%[0-9]+]]:_(p0) = G_PTR_ADD [[LOAD]], [[C6]](s32)
170 ; CHECK-NEXT: [[LOAD8:%[0-9]+]]:_(s8) = G_LOAD [[PTR_ADD6]](p0) :: (load (s8) from %ir.0 + 7)
171 ; CHECK-NEXT: ADJCALLSTACKDOWN 32, 0, implicit-def $sp, implicit-def $ccr, implicit $sp
172 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(p0) = COPY $sp
173 ; CHECK-NEXT: [[C7:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
174 ; CHECK-NEXT: [[PTR_ADD7:%[0-9]+]]:_(p0) = G_PTR_ADD [[COPY]], [[C7]](s32)
175 ; CHECK-NEXT: [[ANYEXT:%[0-9]+]]:_(s32) = G_ANYEXT [[LOAD1]](s8)
176 ; CHECK-NEXT: G_STORE [[ANYEXT]](s32), [[PTR_ADD7]](p0) :: (store (s8) into stack)
177 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(p0) = COPY $sp
178 ; CHECK-NEXT: [[C8:%[0-9]+]]:_(s32) = G_CONSTANT i32 4
179 ; CHECK-NEXT: [[PTR_ADD8:%[0-9]+]]:_(p0) = G_PTR_ADD [[COPY1]], [[C8]](s32)
180 ; CHECK-NEXT: [[ANYEXT1:%[0-9]+]]:_(s32) = G_ANYEXT [[LOAD2]](s8)
181 ; CHECK-NEXT: G_STORE [[ANYEXT1]](s32), [[PTR_ADD8]](p0) :: (store (s8) into stack + 4)
182 ; CHECK-NEXT: [[COPY2:%[0-9]+]]:_(p0) = COPY $sp
183 ; CHECK-NEXT: [[C9:%[0-9]+]]:_(s32) = G_CONSTANT i32 8
184 ; CHECK-NEXT: [[PTR_ADD9:%[0-9]+]]:_(p0) = G_PTR_ADD [[COPY2]], [[C9]](s32)
185 ; CHECK-NEXT: [[ANYEXT2:%[0-9]+]]:_(s32) = G_ANYEXT [[LOAD3]](s8)
186 ; CHECK-NEXT: G_STORE [[ANYEXT2]](s32), [[PTR_ADD9]](p0) :: (store (s8) into stack + 8)
187 ; CHECK-NEXT: [[COPY3:%[0-9]+]]:_(p0) = COPY $sp
188 ; CHECK-NEXT: [[C10:%[0-9]+]]:_(s32) = G_CONSTANT i32 12
189 ; CHECK-NEXT: [[PTR_ADD10:%[0-9]+]]:_(p0) = G_PTR_ADD [[COPY3]], [[C10]](s32)
190 ; CHECK-NEXT: [[ANYEXT3:%[0-9]+]]:_(s32) = G_ANYEXT [[LOAD4]](s8)
191 ; CHECK-NEXT: G_STORE [[ANYEXT3]](s32), [[PTR_ADD10]](p0) :: (store (s8) into stack + 12)
192 ; CHECK-NEXT: [[COPY4:%[0-9]+]]:_(p0) = COPY $sp
193 ; CHECK-NEXT: [[C11:%[0-9]+]]:_(s32) = G_CONSTANT i32 16
194 ; CHECK-NEXT: [[PTR_ADD11:%[0-9]+]]:_(p0) = G_PTR_ADD [[COPY4]], [[C11]](s32)
195 ; CHECK-NEXT: [[ANYEXT4:%[0-9]+]]:_(s32) = G_ANYEXT [[LOAD5]](s8)
196 ; CHECK-NEXT: G_STORE [[ANYEXT4]](s32), [[PTR_ADD11]](p0) :: (store (s8) into stack + 16)
197 ; CHECK-NEXT: [[COPY5:%[0-9]+]]:_(p0) = COPY $sp
198 ; CHECK-NEXT: [[C12:%[0-9]+]]:_(s32) = G_CONSTANT i32 20
199 ; CHECK-NEXT: [[PTR_ADD12:%[0-9]+]]:_(p0) = G_PTR_ADD [[COPY5]], [[C12]](s32)
200 ; CHECK-NEXT: [[ANYEXT5:%[0-9]+]]:_(s32) = G_ANYEXT [[LOAD6]](s8)
201 ; CHECK-NEXT: G_STORE [[ANYEXT5]](s32), [[PTR_ADD12]](p0) :: (store (s8) into stack + 20)
202 ; CHECK-NEXT: [[COPY6:%[0-9]+]]:_(p0) = COPY $sp
203 ; CHECK-NEXT: [[C13:%[0-9]+]]:_(s32) = G_CONSTANT i32 24
204 ; CHECK-NEXT: [[PTR_ADD13:%[0-9]+]]:_(p0) = G_PTR_ADD [[COPY6]], [[C13]](s32)
205 ; CHECK-NEXT: [[ANYEXT6:%[0-9]+]]:_(s32) = G_ANYEXT [[LOAD7]](s8)
206 ; CHECK-NEXT: G_STORE [[ANYEXT6]](s32), [[PTR_ADD13]](p0) :: (store (s8) into stack + 24)
207 ; CHECK-NEXT: [[COPY7:%[0-9]+]]:_(p0) = COPY $sp
208 ; CHECK-NEXT: [[C14:%[0-9]+]]:_(s32) = G_CONSTANT i32 28
209 ; CHECK-NEXT: [[PTR_ADD14:%[0-9]+]]:_(p0) = G_PTR_ADD [[COPY7]], [[C14]](s32)
210 ; CHECK-NEXT: [[ANYEXT7:%[0-9]+]]:_(s32) = G_ANYEXT [[LOAD8]](s8)
211 ; CHECK-NEXT: G_STORE [[ANYEXT7]](s32), [[PTR_ADD14]](p0) :: (store (s8) into stack + 28)
212 ; CHECK-NEXT: CALLb @arg_array_callee, csr_std, implicit $sp
213 ; CHECK-NEXT: ADJCALLSTACKUP 32, 0, implicit-def $sp, implicit-def $ccr, implicit $sp
215 %2 = load [8 x i8], ptr %0
216 call void @arg_array_callee([8 x i8] %2)
220 declare void @arg_pass_struct_by_ptr_callee(ptr)
221 define void @test_arg_pass_struct_by_ptr(ptr %0) nounwind {
222 ; CHECK-LABEL: name: test_arg_pass_struct_by_ptr
223 ; CHECK: bb.1 (%ir-block.1):
224 ; CHECK-NEXT: [[FRAME_INDEX:%[0-9]+]]:_(p0) = G_FRAME_INDEX %fixed-stack.0
225 ; CHECK-NEXT: [[LOAD:%[0-9]+]]:_(p0) = G_LOAD [[FRAME_INDEX]](p0) :: (load (p0) from %fixed-stack.0, align 8)
226 ; CHECK-NEXT: ADJCALLSTACKDOWN 4, 0, implicit-def $sp, implicit-def $ccr, implicit $sp
227 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(p0) = COPY $sp
228 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
229 ; CHECK-NEXT: [[PTR_ADD:%[0-9]+]]:_(p0) = G_PTR_ADD [[COPY]], [[C]](s32)
230 ; CHECK-NEXT: G_STORE [[LOAD]](p0), [[PTR_ADD]](p0) :: (store (p0) into stack, align 1)
231 ; CHECK-NEXT: CALLb @arg_pass_struct_by_ptr_callee, csr_std, implicit $sp
232 ; CHECK-NEXT: ADJCALLSTACKUP 4, 0, implicit-def $sp, implicit-def $ccr, implicit $sp
234 call void @arg_pass_struct_by_ptr_callee(ptr %0)
238 declare void @arg_pass_integer_byval_callee(ptr byval(i32), ptr byval(i16), ptr byval(i8))
239 define void @test_arg_pass_integer_byval(ptr %0, ptr %1, ptr %2) nounwind {
240 ; CHECK-LABEL: name: test_arg_pass_integer_byval
241 ; CHECK: bb.1 (%ir-block.3):
242 ; CHECK-NEXT: [[FRAME_INDEX:%[0-9]+]]:_(p0) = G_FRAME_INDEX %fixed-stack.2
243 ; CHECK-NEXT: [[LOAD:%[0-9]+]]:_(p0) = G_LOAD [[FRAME_INDEX]](p0) :: (load (p0) from %fixed-stack.2, align 8)
244 ; CHECK-NEXT: [[FRAME_INDEX1:%[0-9]+]]:_(p0) = G_FRAME_INDEX %fixed-stack.1
245 ; CHECK-NEXT: [[LOAD1:%[0-9]+]]:_(p0) = G_LOAD [[FRAME_INDEX1]](p0) :: (load (p0) from %fixed-stack.1)
246 ; CHECK-NEXT: [[FRAME_INDEX2:%[0-9]+]]:_(p0) = G_FRAME_INDEX %fixed-stack.0
247 ; CHECK-NEXT: [[LOAD2:%[0-9]+]]:_(p0) = G_LOAD [[FRAME_INDEX2]](p0) :: (load (p0) from %fixed-stack.0, align 8)
248 ; CHECK-NEXT: ADJCALLSTACKDOWN 12, 0, implicit-def $sp, implicit-def $ccr, implicit $sp
249 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(p0) = COPY $sp
250 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
251 ; CHECK-NEXT: [[PTR_ADD:%[0-9]+]]:_(p0) = G_PTR_ADD [[COPY]], [[C]](s32)
252 ; CHECK-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 4
253 ; CHECK-NEXT: G_MEMCPY [[PTR_ADD]](p0), [[LOAD]](p0), [[C1]](s32), 0 :: (dereferenceable store (s32) into stack, align 2), (dereferenceable load (s32) from %ir.0, align 2)
254 ; CHECK-NEXT: [[COPY1:%[0-9]+]]:_(p0) = COPY $sp
255 ; CHECK-NEXT: [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 4
256 ; CHECK-NEXT: [[PTR_ADD1:%[0-9]+]]:_(p0) = G_PTR_ADD [[COPY1]], [[C2]](s32)
257 ; CHECK-NEXT: [[C3:%[0-9]+]]:_(s32) = G_CONSTANT i32 2
258 ; CHECK-NEXT: G_MEMCPY [[PTR_ADD1]](p0), [[LOAD1]](p0), [[C3]](s32), 0 :: (dereferenceable store (s16) into stack + 4), (dereferenceable load (s16) from %ir.1)
259 ; CHECK-NEXT: [[COPY2:%[0-9]+]]:_(p0) = COPY $sp
260 ; CHECK-NEXT: [[C4:%[0-9]+]]:_(s32) = G_CONSTANT i32 8
261 ; CHECK-NEXT: [[PTR_ADD2:%[0-9]+]]:_(p0) = G_PTR_ADD [[COPY2]], [[C4]](s32)
262 ; CHECK-NEXT: [[C5:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
263 ; CHECK-NEXT: G_MEMCPY [[PTR_ADD2]](p0), [[LOAD2]](p0), [[C5]](s32), 0 :: (dereferenceable store (s8) into stack + 8), (dereferenceable load (s8) from %ir.2)
264 ; CHECK-NEXT: CALLb @arg_pass_integer_byval_callee, csr_std, implicit $sp
265 ; CHECK-NEXT: ADJCALLSTACKUP 12, 0, implicit-def $sp, implicit-def $ccr, implicit $sp
267 call void @arg_pass_integer_byval_callee(ptr byval(i32) %0, ptr byval(i16) %1, ptr byval(i8) %2)
271 declare void @arg_pass_struct_byval_callee(ptr byval(%struct.A))
272 define void @test_arg_pass_struct_byval(ptr %0) nounwind {
273 ; CHECK-LABEL: name: test_arg_pass_struct_byval
274 ; CHECK: bb.1 (%ir-block.1):
275 ; CHECK-NEXT: [[FRAME_INDEX:%[0-9]+]]:_(p0) = G_FRAME_INDEX %fixed-stack.0
276 ; CHECK-NEXT: [[LOAD:%[0-9]+]]:_(p0) = G_LOAD [[FRAME_INDEX]](p0) :: (load (p0) from %fixed-stack.0, align 8)
277 ; CHECK-NEXT: ADJCALLSTACKDOWN 8, 0, implicit-def $sp, implicit-def $ccr, implicit $sp
278 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(p0) = COPY $sp
279 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
280 ; CHECK-NEXT: [[PTR_ADD:%[0-9]+]]:_(p0) = G_PTR_ADD [[COPY]], [[C]](s32)
281 ; CHECK-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 8
282 ; CHECK-NEXT: G_MEMCPY [[PTR_ADD]](p0), [[LOAD]](p0), [[C1]](s32), 0 :: (dereferenceable store (s64) into stack, align 2), (dereferenceable load (s64) from %ir.0, align 2)
283 ; CHECK-NEXT: CALLb @arg_pass_struct_byval_callee, csr_std, implicit $sp
284 ; CHECK-NEXT: ADJCALLSTACKUP 8, 0, implicit-def $sp, implicit-def $ccr, implicit $sp
286 call void @arg_pass_struct_byval_callee(ptr byval(%struct.A) %0)
290 declare void @arg_pass_array_byval_callee(ptr byval([32 x i8]))
291 define void @test_arg_pass_array_byval(ptr %0) nounwind {
292 ; CHECK-LABEL: name: test_arg_pass_array_byval
293 ; CHECK: bb.1 (%ir-block.1):
294 ; CHECK-NEXT: [[FRAME_INDEX:%[0-9]+]]:_(p0) = G_FRAME_INDEX %fixed-stack.0
295 ; CHECK-NEXT: [[LOAD:%[0-9]+]]:_(p0) = G_LOAD [[FRAME_INDEX]](p0) :: (load (p0) from %fixed-stack.0, align 8)
296 ; CHECK-NEXT: ADJCALLSTACKDOWN 32, 0, implicit-def $sp, implicit-def $ccr, implicit $sp
297 ; CHECK-NEXT: [[COPY:%[0-9]+]]:_(p0) = COPY $sp
298 ; CHECK-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0
299 ; CHECK-NEXT: [[PTR_ADD:%[0-9]+]]:_(p0) = G_PTR_ADD [[COPY]], [[C]](s32)
300 ; CHECK-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 32
301 ; CHECK-NEXT: G_MEMCPY [[PTR_ADD]](p0), [[LOAD]](p0), [[C1]](s32), 0 :: (dereferenceable store (s256) into stack, align 1), (dereferenceable load (s256) from %ir.0, align 1)
302 ; CHECK-NEXT: CALLb @arg_pass_array_byval_callee, csr_std, implicit $sp
303 ; CHECK-NEXT: ADJCALLSTACKUP 32, 0, implicit-def $sp, implicit-def $ccr, implicit $sp
305 call void @arg_pass_array_byval_callee(ptr byval([32 x i8]) %0)
309 define void @test_indirect_call(ptr %fptr) nounwind {
310 ; CHECK-LABEL: name: test_indirect_call
311 ; CHECK: bb.1 (%ir-block.0):
312 ; CHECK-NEXT: [[FRAME_INDEX:%[0-9]+]]:_(p0) = G_FRAME_INDEX %fixed-stack.0
313 ; CHECK-NEXT: [[LOAD:%[0-9]+]]:ar32(p0) = G_LOAD [[FRAME_INDEX]](p0) :: (load (p0) from %fixed-stack.0, align 8)
314 ; CHECK-NEXT: ADJCALLSTACKDOWN 0, 0, implicit-def $sp, implicit-def $ccr, implicit $sp
315 ; CHECK-NEXT: CALLj [[LOAD]](p0), csr_std, implicit $sp
316 ; CHECK-NEXT: ADJCALLSTACKUP 0, 0, implicit-def $sp, implicit-def $ccr, implicit $sp