@@ -39,11 +39,13 @@ define i32 @caller_i64_in_regs() nounwind {
39
39
; ILP32: bb.1 (%ir-block.0):
40
40
; ILP32-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
41
41
; ILP32-NEXT: [[C1:%[0-9]+]]:_(s64) = G_CONSTANT i64 2
42
+ ; ILP32-NEXT: ADJCALLSTACKDOWN 0, 0, implicit-def $x2, implicit $x2
42
43
; ILP32-NEXT: [[UV:%[0-9]+]]:_(s32), [[UV1:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[C1]](s64)
43
44
; ILP32-NEXT: $x10 = COPY [[C]](s32)
44
45
; ILP32-NEXT: $x11 = COPY [[UV]](s32)
45
46
; ILP32-NEXT: $x12 = COPY [[UV1]](s32)
46
47
; ILP32-NEXT: PseudoCALL target-flags(riscv-call) @callee_i64_in_regs, csr_ilp32_lp64, implicit-def $x1, implicit $x10, implicit $x11, implicit $x12, implicit-def $x10
48
+ ; ILP32-NEXT: ADJCALLSTACKUP 0, 0, implicit-def $x2, implicit $x2
47
49
; ILP32-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10
48
50
; ILP32-NEXT: $x10 = COPY [[COPY]](s32)
49
51
; ILP32-NEXT: PseudoRET implicit $x10
@@ -52,11 +54,13 @@ define i32 @caller_i64_in_regs() nounwind {
52
54
; ILP32F: bb.1 (%ir-block.0):
53
55
; ILP32F-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
54
56
; ILP32F-NEXT: [[C1:%[0-9]+]]:_(s64) = G_CONSTANT i64 2
57
+ ; ILP32F-NEXT: ADJCALLSTACKDOWN 0, 0, implicit-def $x2, implicit $x2
55
58
; ILP32F-NEXT: [[UV:%[0-9]+]]:_(s32), [[UV1:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[C1]](s64)
56
59
; ILP32F-NEXT: $x10 = COPY [[C]](s32)
57
60
; ILP32F-NEXT: $x11 = COPY [[UV]](s32)
58
61
; ILP32F-NEXT: $x12 = COPY [[UV1]](s32)
59
62
; ILP32F-NEXT: PseudoCALL target-flags(riscv-call) @callee_i64_in_regs, csr_ilp32f_lp64f, implicit-def $x1, implicit $x10, implicit $x11, implicit $x12, implicit-def $x10
63
+ ; ILP32F-NEXT: ADJCALLSTACKUP 0, 0, implicit-def $x2, implicit $x2
60
64
; ILP32F-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10
61
65
; ILP32F-NEXT: $x10 = COPY [[COPY]](s32)
62
66
; ILP32F-NEXT: PseudoRET implicit $x10
@@ -65,11 +69,13 @@ define i32 @caller_i64_in_regs() nounwind {
65
69
; ILP32D: bb.1 (%ir-block.0):
66
70
; ILP32D-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 1
67
71
; ILP32D-NEXT: [[C1:%[0-9]+]]:_(s64) = G_CONSTANT i64 2
72
+ ; ILP32D-NEXT: ADJCALLSTACKDOWN 0, 0, implicit-def $x2, implicit $x2
68
73
; ILP32D-NEXT: [[UV:%[0-9]+]]:_(s32), [[UV1:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[C1]](s64)
69
74
; ILP32D-NEXT: $x10 = COPY [[C]](s32)
70
75
; ILP32D-NEXT: $x11 = COPY [[UV]](s32)
71
76
; ILP32D-NEXT: $x12 = COPY [[UV1]](s32)
72
77
; ILP32D-NEXT: PseudoCALL target-flags(riscv-call) @callee_i64_in_regs, csr_ilp32d_lp64d, implicit-def $x1, implicit $x10, implicit $x11, implicit $x12, implicit-def $x10
78
+ ; ILP32D-NEXT: ADJCALLSTACKUP 0, 0, implicit-def $x2, implicit $x2
73
79
; ILP32D-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10
74
80
; ILP32D-NEXT: $x10 = COPY [[COPY]](s32)
75
81
; ILP32D-NEXT: PseudoRET implicit $x10
@@ -136,6 +142,7 @@ define i32 @caller_many_scalars() nounwind {
136
142
; ILP32-NEXT: [[C5:%[0-9]+]]:_(s32) = G_CONSTANT i32 6
137
143
; ILP32-NEXT: [[C6:%[0-9]+]]:_(s64) = G_CONSTANT i64 7
138
144
; ILP32-NEXT: [[C7:%[0-9]+]]:_(s32) = G_CONSTANT i32 8
145
+ ; ILP32-NEXT: ADJCALLSTACKDOWN 8, 0, implicit-def $x2, implicit $x2
139
146
; ILP32-NEXT: [[ANYEXT:%[0-9]+]]:_(s32) = G_ANYEXT [[C]](s8)
140
147
; ILP32-NEXT: [[ANYEXT1:%[0-9]+]]:_(s32) = G_ANYEXT [[C1]](s16)
141
148
; ILP32-NEXT: [[UV:%[0-9]+]]:_(s32), [[UV1:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[C3]](s64)
@@ -156,6 +163,7 @@ define i32 @caller_many_scalars() nounwind {
156
163
; ILP32-NEXT: $x16 = COPY [[C5]](s32)
157
164
; ILP32-NEXT: $x17 = COPY [[UV2]](s32)
158
165
; ILP32-NEXT: PseudoCALL target-flags(riscv-call) @callee_many_scalars, csr_ilp32_lp64, implicit-def $x1, implicit $x10, implicit $x11, implicit $x12, implicit $x13, implicit $x14, implicit $x15, implicit $x16, implicit $x17, implicit-def $x10
166
+ ; ILP32-NEXT: ADJCALLSTACKUP 8, 0, implicit-def $x2, implicit $x2
159
167
; ILP32-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $x10
160
168
; ILP32-NEXT: $x10 = COPY [[COPY1]](s32)
161
169
; ILP32-NEXT: PseudoRET implicit $x10
@@ -170,6 +178,7 @@ define i32 @caller_many_scalars() nounwind {
170
178
; ILP32F-NEXT: [[C5:%[0-9]+]]:_(s32) = G_CONSTANT i32 6
171
179
; ILP32F-NEXT: [[C6:%[0-9]+]]:_(s64) = G_CONSTANT i64 7
172
180
; ILP32F-NEXT: [[C7:%[0-9]+]]:_(s32) = G_CONSTANT i32 8
181
+ ; ILP32F-NEXT: ADJCALLSTACKDOWN 8, 0, implicit-def $x2, implicit $x2
173
182
; ILP32F-NEXT: [[ANYEXT:%[0-9]+]]:_(s32) = G_ANYEXT [[C]](s8)
174
183
; ILP32F-NEXT: [[ANYEXT1:%[0-9]+]]:_(s32) = G_ANYEXT [[C1]](s16)
175
184
; ILP32F-NEXT: [[UV:%[0-9]+]]:_(s32), [[UV1:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[C3]](s64)
@@ -190,6 +199,7 @@ define i32 @caller_many_scalars() nounwind {
190
199
; ILP32F-NEXT: $x16 = COPY [[C5]](s32)
191
200
; ILP32F-NEXT: $x17 = COPY [[UV2]](s32)
192
201
; ILP32F-NEXT: PseudoCALL target-flags(riscv-call) @callee_many_scalars, csr_ilp32f_lp64f, implicit-def $x1, implicit $x10, implicit $x11, implicit $x12, implicit $x13, implicit $x14, implicit $x15, implicit $x16, implicit $x17, implicit-def $x10
202
+ ; ILP32F-NEXT: ADJCALLSTACKUP 8, 0, implicit-def $x2, implicit $x2
193
203
; ILP32F-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $x10
194
204
; ILP32F-NEXT: $x10 = COPY [[COPY1]](s32)
195
205
; ILP32F-NEXT: PseudoRET implicit $x10
@@ -204,6 +214,7 @@ define i32 @caller_many_scalars() nounwind {
204
214
; ILP32D-NEXT: [[C5:%[0-9]+]]:_(s32) = G_CONSTANT i32 6
205
215
; ILP32D-NEXT: [[C6:%[0-9]+]]:_(s64) = G_CONSTANT i64 7
206
216
; ILP32D-NEXT: [[C7:%[0-9]+]]:_(s32) = G_CONSTANT i32 8
217
+ ; ILP32D-NEXT: ADJCALLSTACKDOWN 8, 0, implicit-def $x2, implicit $x2
207
218
; ILP32D-NEXT: [[ANYEXT:%[0-9]+]]:_(s32) = G_ANYEXT [[C]](s8)
208
219
; ILP32D-NEXT: [[ANYEXT1:%[0-9]+]]:_(s32) = G_ANYEXT [[C1]](s16)
209
220
; ILP32D-NEXT: [[UV:%[0-9]+]]:_(s32), [[UV1:%[0-9]+]]:_(s32) = G_UNMERGE_VALUES [[C3]](s64)
@@ -224,6 +235,7 @@ define i32 @caller_many_scalars() nounwind {
224
235
; ILP32D-NEXT: $x16 = COPY [[C5]](s32)
225
236
; ILP32D-NEXT: $x17 = COPY [[UV2]](s32)
226
237
; ILP32D-NEXT: PseudoCALL target-flags(riscv-call) @callee_many_scalars, csr_ilp32d_lp64d, implicit-def $x1, implicit $x10, implicit $x11, implicit $x12, implicit $x13, implicit $x14, implicit $x15, implicit $x16, implicit $x17, implicit-def $x10
238
+ ; ILP32D-NEXT: ADJCALLSTACKUP 8, 0, implicit-def $x2, implicit $x2
227
239
; ILP32D-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $x10
228
240
; ILP32D-NEXT: $x10 = COPY [[COPY1]](s32)
229
241
; ILP32D-NEXT: PseudoRET implicit $x10
@@ -248,7 +260,9 @@ define i32 @caller_small_scalar_ret() nounwind {
248
260
; ILP32-LABEL: name: caller_small_scalar_ret
249
261
; ILP32: bb.1 (%ir-block.0):
250
262
; ILP32-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 987654321234567
263
+ ; ILP32-NEXT: ADJCALLSTACKDOWN 0, 0, implicit-def $x2, implicit $x2
251
264
; ILP32-NEXT: PseudoCALL target-flags(riscv-call) @callee_small_scalar_ret, csr_ilp32_lp64, implicit-def $x1, implicit-def $x10, implicit-def $x11
265
+ ; ILP32-NEXT: ADJCALLSTACKUP 0, 0, implicit-def $x2, implicit $x2
252
266
; ILP32-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10
253
267
; ILP32-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $x11
254
268
; ILP32-NEXT: [[MV:%[0-9]+]]:_(s64) = G_MERGE_VALUES [[COPY]](s32), [[COPY1]](s32)
@@ -260,7 +274,9 @@ define i32 @caller_small_scalar_ret() nounwind {
260
274
; ILP32F-LABEL: name: caller_small_scalar_ret
261
275
; ILP32F: bb.1 (%ir-block.0):
262
276
; ILP32F-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 987654321234567
277
+ ; ILP32F-NEXT: ADJCALLSTACKDOWN 0, 0, implicit-def $x2, implicit $x2
263
278
; ILP32F-NEXT: PseudoCALL target-flags(riscv-call) @callee_small_scalar_ret, csr_ilp32f_lp64f, implicit-def $x1, implicit-def $x10, implicit-def $x11
279
+ ; ILP32F-NEXT: ADJCALLSTACKUP 0, 0, implicit-def $x2, implicit $x2
264
280
; ILP32F-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10
265
281
; ILP32F-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $x11
266
282
; ILP32F-NEXT: [[MV:%[0-9]+]]:_(s64) = G_MERGE_VALUES [[COPY]](s32), [[COPY1]](s32)
@@ -272,7 +288,9 @@ define i32 @caller_small_scalar_ret() nounwind {
272
288
; ILP32D-LABEL: name: caller_small_scalar_ret
273
289
; ILP32D: bb.1 (%ir-block.0):
274
290
; ILP32D-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 987654321234567
291
+ ; ILP32D-NEXT: ADJCALLSTACKDOWN 0, 0, implicit-def $x2, implicit $x2
275
292
; ILP32D-NEXT: PseudoCALL target-flags(riscv-call) @callee_small_scalar_ret, csr_ilp32d_lp64d, implicit-def $x1, implicit-def $x10, implicit-def $x11
293
+ ; ILP32D-NEXT: ADJCALLSTACKUP 0, 0, implicit-def $x2, implicit $x2
276
294
; ILP32D-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10
277
295
; ILP32D-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $x11
278
296
; ILP32D-NEXT: [[MV:%[0-9]+]]:_(s64) = G_MERGE_VALUES [[COPY]](s32), [[COPY1]](s32)
@@ -304,7 +322,9 @@ define %struct.small @callee_small_struct_ret() nounwind {
304
322
define i32 @caller_small_struct_ret () nounwind {
305
323
; ILP32-LABEL: name: caller_small_struct_ret
306
324
; ILP32: bb.1 (%ir-block.0):
325
+ ; ILP32-NEXT: ADJCALLSTACKDOWN 0, 0, implicit-def $x2, implicit $x2
307
326
; ILP32-NEXT: PseudoCALL target-flags(riscv-call) @callee_small_struct_ret, csr_ilp32_lp64, implicit-def $x1, implicit-def $x10, implicit-def $x11
327
+ ; ILP32-NEXT: ADJCALLSTACKUP 0, 0, implicit-def $x2, implicit $x2
308
328
; ILP32-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10
309
329
; ILP32-NEXT: [[COPY1:%[0-9]+]]:_(p0) = COPY $x11
310
330
; ILP32-NEXT: [[PTRTOINT:%[0-9]+]]:_(s32) = G_PTRTOINT [[COPY1]](p0)
@@ -314,7 +334,9 @@ define i32 @caller_small_struct_ret() nounwind {
314
334
;
315
335
; ILP32F-LABEL: name: caller_small_struct_ret
316
336
; ILP32F: bb.1 (%ir-block.0):
337
+ ; ILP32F-NEXT: ADJCALLSTACKDOWN 0, 0, implicit-def $x2, implicit $x2
317
338
; ILP32F-NEXT: PseudoCALL target-flags(riscv-call) @callee_small_struct_ret, csr_ilp32f_lp64f, implicit-def $x1, implicit-def $x10, implicit-def $x11
339
+ ; ILP32F-NEXT: ADJCALLSTACKUP 0, 0, implicit-def $x2, implicit $x2
318
340
; ILP32F-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10
319
341
; ILP32F-NEXT: [[COPY1:%[0-9]+]]:_(p0) = COPY $x11
320
342
; ILP32F-NEXT: [[PTRTOINT:%[0-9]+]]:_(s32) = G_PTRTOINT [[COPY1]](p0)
@@ -324,7 +346,9 @@ define i32 @caller_small_struct_ret() nounwind {
324
346
;
325
347
; ILP32D-LABEL: name: caller_small_struct_ret
326
348
; ILP32D: bb.1 (%ir-block.0):
349
+ ; ILP32D-NEXT: ADJCALLSTACKDOWN 0, 0, implicit-def $x2, implicit $x2
327
350
; ILP32D-NEXT: PseudoCALL target-flags(riscv-call) @callee_small_struct_ret, csr_ilp32d_lp64d, implicit-def $x1, implicit-def $x10, implicit-def $x11
351
+ ; ILP32D-NEXT: ADJCALLSTACKUP 0, 0, implicit-def $x2, implicit $x2
328
352
; ILP32D-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10
329
353
; ILP32D-NEXT: [[COPY1:%[0-9]+]]:_(p0) = COPY $x11
330
354
; ILP32D-NEXT: [[PTRTOINT:%[0-9]+]]:_(s32) = G_PTRTOINT [[COPY1]](p0)
@@ -378,8 +402,10 @@ define i32 @caller_large_struct_ret() nounwind {
378
402
; ILP32-LABEL: name: caller_large_struct_ret
379
403
; ILP32: bb.1 (%ir-block.0):
380
404
; ILP32-NEXT: [[FRAME_INDEX:%[0-9]+]]:_(p0) = G_FRAME_INDEX %stack.0
405
+ ; ILP32-NEXT: ADJCALLSTACKDOWN 0, 0, implicit-def $x2, implicit $x2
381
406
; ILP32-NEXT: $x10 = COPY [[FRAME_INDEX]](p0)
382
407
; ILP32-NEXT: PseudoCALL target-flags(riscv-call) @callee_large_struct_ret, csr_ilp32_lp64, implicit-def $x1, implicit $x10
408
+ ; ILP32-NEXT: ADJCALLSTACKUP 0, 0, implicit-def $x2, implicit $x2
383
409
; ILP32-NEXT: [[LOAD:%[0-9]+]]:_(s32) = G_LOAD [[FRAME_INDEX]](p0) :: (dereferenceable load (s32) from %ir.1)
384
410
; ILP32-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 12
385
411
; ILP32-NEXT: [[PTR_ADD:%[0-9]+]]:_(p0) = nuw G_PTR_ADD [[FRAME_INDEX]], [[C]](s32)
@@ -391,8 +417,10 @@ define i32 @caller_large_struct_ret() nounwind {
391
417
; ILP32F-LABEL: name: caller_large_struct_ret
392
418
; ILP32F: bb.1 (%ir-block.0):
393
419
; ILP32F-NEXT: [[FRAME_INDEX:%[0-9]+]]:_(p0) = G_FRAME_INDEX %stack.0
420
+ ; ILP32F-NEXT: ADJCALLSTACKDOWN 0, 0, implicit-def $x2, implicit $x2
394
421
; ILP32F-NEXT: $x10 = COPY [[FRAME_INDEX]](p0)
395
422
; ILP32F-NEXT: PseudoCALL target-flags(riscv-call) @callee_large_struct_ret, csr_ilp32f_lp64f, implicit-def $x1, implicit $x10
423
+ ; ILP32F-NEXT: ADJCALLSTACKUP 0, 0, implicit-def $x2, implicit $x2
396
424
; ILP32F-NEXT: [[LOAD:%[0-9]+]]:_(s32) = G_LOAD [[FRAME_INDEX]](p0) :: (dereferenceable load (s32) from %ir.1)
397
425
; ILP32F-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 12
398
426
; ILP32F-NEXT: [[PTR_ADD:%[0-9]+]]:_(p0) = nuw G_PTR_ADD [[FRAME_INDEX]], [[C]](s32)
@@ -404,8 +432,10 @@ define i32 @caller_large_struct_ret() nounwind {
404
432
; ILP32D-LABEL: name: caller_large_struct_ret
405
433
; ILP32D: bb.1 (%ir-block.0):
406
434
; ILP32D-NEXT: [[FRAME_INDEX:%[0-9]+]]:_(p0) = G_FRAME_INDEX %stack.0
435
+ ; ILP32D-NEXT: ADJCALLSTACKDOWN 0, 0, implicit-def $x2, implicit $x2
407
436
; ILP32D-NEXT: $x10 = COPY [[FRAME_INDEX]](p0)
408
437
; ILP32D-NEXT: PseudoCALL target-flags(riscv-call) @callee_large_struct_ret, csr_ilp32d_lp64d, implicit-def $x1, implicit $x10
438
+ ; ILP32D-NEXT: ADJCALLSTACKUP 0, 0, implicit-def $x2, implicit $x2
409
439
; ILP32D-NEXT: [[LOAD:%[0-9]+]]:_(s32) = G_LOAD [[FRAME_INDEX]](p0) :: (dereferenceable load (s32) from %ir.1)
410
440
; ILP32D-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 12
411
441
; ILP32D-NEXT: [[PTR_ADD:%[0-9]+]]:_(p0) = nuw G_PTR_ADD [[FRAME_INDEX]], [[C]](s32)
0 commit comments