1 ; Test the allocation of emergency spill slots.
3 ; RUN: llc < %s -mtriple=s390x-linux-gnu | FileCheck %s
5 ; For frames of size less than 4096 - 2*160, no emercengy spill slot
6 ; is required. Check the maximum such case.
7 define void @f1(i64 %x) {
9 ; CHECK: stg %r2, 160(%r15)
11 %y = alloca [471 x i64], align 8
12 store volatile i64 %x, ptr %y
16 ; If the frame size is at least 4096 - 2*160, we do need the emergency
17 ; spill slots. Check the minimum such case.
18 define void @f2(i64 %x) {
20 ; CHECK: stg %r2, 176(%r15)
22 %y = alloca [472 x i64], align 8
23 store volatile i64 %x, ptr %y
27 ; However, if there are incoming stack arguments, those also need to be
28 ; in reach, so the maximum frame size without emergency spill slots is
29 ; 4096 - 2*160 - <size of incoming stack arguments>. Check the maximum
30 ; case where we still need no emergency spill slots ...
31 define void @f3(i64 %x, i64 %r3, i64 %r4, i64 %r5, i64 %r6, i64 %stack) {
33 ; CHECK: stg %r2, 160(%r15)
35 %y = alloca [470 x i64], align 8
36 store volatile i64 %x, ptr %y
40 ; ... and the minimum case where we do.
41 define void @f4(i64 %x, i64 %r3, i64 %r4, i64 %r5, i64 %r6, i64 %stack) {
43 ; CHECK: stg %r2, 176(%r15)
45 %y = alloca [471 x i64], align 8
46 store volatile i64 %x, ptr %y
50 ; Try again for the case of two stack arguments.
51 ; Check the maximum case where we still need no emergency spill slots ...
52 define void @f5(i64 %x, i64 %r3, i64 %r4, i64 %r5, i64 %r6, i64 %stack1, i64 %stack2) {
54 ; CHECK: stg %r2, 160(%r15)
56 %y = alloca [469 x i64], align 8
57 store volatile i64 %x, ptr %y
61 ; ... and the minimum case where we do.
62 define void @f6(i64 %x, i64 %r3, i64 %r4, i64 %r5, i64 %r6, i64 %stack1, i64 %stack2) {
64 ; CHECK: stg %r2, 176(%r15)
66 %y = alloca [470 x i64], align 8
67 store volatile i64 %x, ptr %y