annotate test/CodeGen/SystemZ/frame-21.ll @ 128:c347d3398279 default tip

fix
author mir3636
date Wed, 06 Dec 2017 14:37:17 +0900
parents 803732b1fca8
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
121
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
1 ; Test the allocation of emergency spill slots.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
2 ;
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
3 ; RUN: llc < %s -mtriple=s390x-linux-gnu | FileCheck %s
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
4
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
5 ; For frames of size less than 4096 - 2*160, no emercengy spill slot
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
6 ; is required. Check the maximum such case.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
7 define void @f1(i64 %x) {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
8 ; CHECK-LABEL: f1:
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
9 ; CHECK: stg %r2, 160(%r15)
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
10 ; CHECK: br %r14
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
11 %y = alloca [471 x i64], align 8
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
12 %ptr = getelementptr inbounds [471 x i64], [471 x i64]* %y, i64 0, i64 0
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
13 store volatile i64 %x, i64* %ptr
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
14 ret void
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
15 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
16
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
17 ; If the frame size is at least 4096 - 2*160, we do need the emergency
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
18 ; spill slots. Check the minimum such case.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
19 define void @f2(i64 %x) {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
20 ; CHECK-LABEL: f2:
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
21 ; CHECK: stg %r2, 176(%r15)
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
22 ; CHECK: br %r14
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
23 %y = alloca [472 x i64], align 8
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
24 %ptr = getelementptr inbounds [472 x i64], [472 x i64]* %y, i64 0, i64 0
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
25 store volatile i64 %x, i64* %ptr
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
26 ret void
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
27 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
28
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
29 ; However, if there are incoming stack arguments, those also need to be
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
30 ; in reach, so the maximum frame size without emergency spill slots is
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
31 ; 4096 - 2*160 - <size of incoming stack arguments>. Check the maximum
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
32 ; case where we still need no emergency spill slots ...
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
33 define void @f3(i64 %x, i64 %r3, i64 %r4, i64 %r5, i64 %r6, i64 %stack) {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
34 ; CHECK-LABEL: f3:
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
35 ; CHECK: stg %r2, 160(%r15)
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
36 ; CHECK: br %r14
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
37 %y = alloca [470 x i64], align 8
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
38 %ptr = getelementptr inbounds [470 x i64], [470 x i64]* %y, i64 0, i64 0
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
39 store volatile i64 %x, i64* %ptr
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
40 ret void
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
41 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
42
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
43 ; ... and the minimum case where we do.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
44 define void @f4(i64 %x, i64 %r3, i64 %r4, i64 %r5, i64 %r6, i64 %stack) {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
45 ; CHECK-LABEL: f4:
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
46 ; CHECK: stg %r2, 176(%r15)
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
47 ; CHECK: br %r14
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
48 %y = alloca [471 x i64], align 8
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
49 %ptr = getelementptr inbounds [471 x i64], [471 x i64]* %y, i64 0, i64 0
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
50 store volatile i64 %x, i64* %ptr
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
51 ret void
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
52 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
53
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
54 ; Try again for the case of two stack arguments.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
55 ; Check the maximum case where we still need no emergency spill slots ...
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
56 define void @f5(i64 %x, i64 %r3, i64 %r4, i64 %r5, i64 %r6, i64 %stack1, i64 %stack2) {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
57 ; CHECK-LABEL: f5:
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
58 ; CHECK: stg %r2, 160(%r15)
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
59 ; CHECK: br %r14
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
60 %y = alloca [469 x i64], align 8
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
61 %ptr = getelementptr inbounds [469 x i64], [469 x i64]* %y, i64 0, i64 0
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
62 store volatile i64 %x, i64* %ptr
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
63 ret void
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
64 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
65
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
66 ; ... and the minimum case where we do.
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
67 define void @f6(i64 %x, i64 %r3, i64 %r4, i64 %r5, i64 %r6, i64 %stack1, i64 %stack2) {
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
68 ; CHECK-LABEL: f6:
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
69 ; CHECK: stg %r2, 176(%r15)
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
70 ; CHECK: br %r14
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
71 %y = alloca [470 x i64], align 8
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
72 %ptr = getelementptr inbounds [470 x i64], [470 x i64]* %y, i64 0, i64 0
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
73 store volatile i64 %x, i64* %ptr
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
74 ret void
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
75 }
803732b1fca8 LLVM 5.0
kono
parents:
diff changeset
76