xref: /llvm-project/llvm/test/CodeGen/SystemZ/frame-26.mir (revision 4b61d04645a5289354b8f0884a132a70bc8b4350)
1# RUN: llc -mtriple=s390x-linux-gnu -start-before=prologepilog %s -o - -print-after=prologepilog \
2# RUN:  -verify-machineinstrs 2>&1 | FileCheck %s
3#
4# Test that R6 when used for an argument is modelled as being live throughout
5# the function when not saved in the prologue..
6
7# CHECK:      # *** IR Dump After Prologue/Epilogue Insertion & Frame Finalization (prologepilog) ***:
8# CHECK-NEXT: # Machine code for function fun0:
9# CHECK-LABEL: bb.0:
10# CHECK: liveins:{{.*}} $r6d
11# CHECK: STMG killed $r7d, killed $r15d
12# CHECK: STG renamable $r6d
13# CHECK: End machine code for function fun0.
14
15
16--- |
17
18  @g_181 = external dso_local global i32, align 4
19  @g_1390 = external dso_local constant ptr, align 8
20
21  define internal i8 @fun0(i8 %arg, i8 %arg1, i32 %arg2, i8 %arg3, ptr %arg4, float %F0, float %F1) #0 {
22    ret i8 0
23  }
24
25  ; Same function but in a single block which will make the verifier complain
26  ; if R6 is killed by the original store before the point where the
27  ; RegScavenger inserts its (killing) store of R6.
28  define internal i8 @fun1(i8 %arg, i8 %arg1, i32 %arg2, i8 %arg3, ptr %arg4) #0 {
29    ret i8 0
30  }
31
32  attributes #0 = { "frame-pointer"="all" }
33
34...
35---
36name:            fun0
37alignment:       16
38tracksRegLiveness: true
39liveins:
40  - { reg: '$r6d' }
41  - { reg: '$f0s' }
42  - { reg: '$f2s' }
43frameInfo:
44  maxAlignment:    8
45stack:
46  - { id: 0, size: 96, alignment: 8 }
47  - { id: 1, size: 1960, alignment: 8 }
48  - { id: 2, size: 8, alignment: 8 }
49  - { id: 3, size: 320, alignment: 8 }
50  - { id: 4, size: 4, alignment: 4 }
51  - { id: 5, size: 8, alignment: 8 }
52  - { id: 6, size: 8, alignment: 8 }
53  - { id: 7, size: 4, alignment: 4 }
54  - { id: 8, size: 8, alignment: 8 }
55  - { id: 9, size: 4, alignment: 4 }
56  - { id: 10, size: 8, alignment: 8 }
57  - { id: 11, size: 8, alignment: 8 }
58  - { id: 12, size: 8, alignment: 8 }
59  - { id: 13, size: 8, alignment: 8 }
60  - { id: 14, size: 24, alignment: 4 }
61  - { id: 15, size: 4, alignment: 4 }
62  - { id: 16, size: 1792, alignment: 8 }
63  - { id: 17, size: 8, alignment: 8 }
64  - { id: 18, size: 8, alignment: 8 }
65  - { id: 19, size: 8, alignment: 8 }
66  - { id: 20, size: 1, alignment: 2 }
67  - { id: 21, size: 672, alignment: 8 }
68  - { id: 22, size: 4, alignment: 4 }
69  - { id: 23, size: 4, alignment: 4 }
70  - { id: 24, size: 4, alignment: 4 }
71  - { id: 25, size: 64, alignment: 8 }
72machineFunctionInfo: {}
73body:             |
74  bb.0:
75    liveins: $f0s, $f2s, $r6d
76
77    STG killed renamable $r6d, undef renamable $r1d, 0, $noreg :: (store (s64) into `ptr undef`)
78    renamable $r0d = LARL @g_181
79    nofpexcept CEBR renamable $f0s, renamable $f2s, implicit-def $cc, implicit $fpc
80    STG renamable $r0d, undef renamable $r1d, 0, $noreg :: (store (s64) into `ptr undef`)
81    BRC 15, 4, %bb.2, implicit killed $cc
82
83  bb.1:
84    liveins: $f2s, $r0d
85
86    renamable $f0s = COPY killed renamable $f2s
87
88  bb.2:
89    liveins: $f0s, $r0d
90
91    STE killed renamable $f0s, undef renamable $r1d, 0, $noreg :: (volatile store (s32) into `ptr undef`)
92    renamable $r1d = nuw LA %stack.0, 16, $noreg
93    renamable $r2d = nuw LA %stack.0, 24, $noreg
94    renamable $r3d = LA %stack.0, 40, $noreg
95    renamable $r4d = LARL @g_1390
96    STG renamable $r4d, undef renamable $r1d, 0, $noreg :: (store (s64) into `ptr undef`)
97    renamable $r5d = nuw LA %stack.0, 48, $noreg
98    renamable $r14d = LA %stack.0, 72, $noreg
99    renamable $r13d = LA %stack.0, 80, $noreg
100    renamable $r12d = LA %stack.0, 56, $noreg
101    renamable $r10d = LA %stack.0, 0, $noreg
102    STG renamable $r10d, undef renamable $r1d, 0, $noreg :: (store (s64) into `ptr undef`)
103    renamable $r9d = LA %stack.0, 64, $noreg
104    renamable $r8d = LA %stack.0, 88, $noreg
105    renamable $r7d = nuw LA %stack.0, 8, $noreg
106    MVGHI %stack.1, 904, 0
107    STG killed renamable $r9d, $noreg, 0, $noreg :: (store (s64) into `ptr null`)
108    STG killed renamable $r3d, undef renamable $r1d, 0, $noreg :: (store (s64) into `ptr undef`)
109    STG killed renamable $r14d, undef renamable $r1d, 0, $noreg :: (store (s64) into `ptr undef`)
110    STG killed renamable $r7d, undef renamable $r1d, 0, $noreg :: (store (s64) into `ptr undef`)
111    STG killed renamable $r1d, undef renamable $r1d, 0, $noreg :: (store (s64) into `ptr undef`)
112    STG killed renamable $r4d, undef renamable $r1d, 0, $noreg :: (store (s64) into `ptr undef`)
113    STG killed renamable $r2d, undef renamable $r1d, 0, $noreg :: (store (s64) into `ptr undef`)
114    STG killed renamable $r5d, undef renamable $r1d, 0, $noreg :: (store (s64) into `ptr undef`)
115    STG killed renamable $r8d, undef renamable $r1d, 0, $noreg :: (store (s64) into `ptr undef`)
116    STG killed renamable $r12d, undef renamable $r1d, 0, $noreg :: (store (s64) into `ptr undef`)
117    STG killed renamable $r13d, undef renamable $r1d, 0, $noreg :: (store (s64) into `ptr undef`)
118    STG killed renamable $r10d, undef renamable $r1d, 0, $noreg :: (store (s64) into `ptr undef`)
119    $r2l = LHI 0
120    STG killed renamable $r0d, undef renamable $r1d, 0, $noreg :: (store (s64) into `ptr undef`)
121    Return implicit $r2l
122
123...
124---
125name:            fun1
126alignment:       16
127tracksRegLiveness: true
128liveins:
129  - { reg: '$r6d' }
130frameInfo:
131  maxAlignment:    8
132stack:
133  - { id: 0, size: 96, alignment: 8 }
134  - { id: 1, size: 1960, alignment: 8 }
135  - { id: 2, size: 8, alignment: 8 }
136  - { id: 3, size: 320, alignment: 8 }
137  - { id: 4, size: 4, alignment: 4 }
138  - { id: 5, size: 8, alignment: 8 }
139  - { id: 6, size: 8, alignment: 8 }
140  - { id: 7, size: 4, alignment: 4 }
141  - { id: 8, size: 8, alignment: 8 }
142  - { id: 9, size: 4, alignment: 4 }
143  - { id: 10, size: 8, alignment: 8 }
144  - { id: 11, size: 8, alignment: 8 }
145  - { id: 12, size: 8, alignment: 8 }
146  - { id: 13, size: 8, alignment: 8 }
147  - { id: 14, size: 24, alignment: 4 }
148  - { id: 15, size: 4, alignment: 4 }
149  - { id: 16, size: 1792, alignment: 8 }
150  - { id: 17, size: 8, alignment: 8 }
151  - { id: 18, size: 8, alignment: 8 }
152  - { id: 19, size: 8, alignment: 8 }
153  - { id: 20, size: 1, alignment: 2 }
154  - { id: 21, size: 672, alignment: 8 }
155  - { id: 22, size: 4, alignment: 4 }
156  - { id: 23, size: 4, alignment: 4 }
157  - { id: 24, size: 4, alignment: 4 }
158  - { id: 25, size: 64, alignment: 8 }
159machineFunctionInfo: {}
160body:             |
161  bb.0:
162    liveins: $r6d
163
164    STG killed renamable $r6d, undef renamable $r1d, 0, $noreg :: (store (s64) into `ptr undef`)
165    renamable $r0d = LARL @g_181
166    STG renamable $r0d, undef renamable $r1d, 0, $noreg :: (store (s64) into `ptr undef`)
167    renamable $r1d = nuw LA %stack.0, 16, $noreg
168    renamable $r2d = nuw LA %stack.0, 24, $noreg
169    renamable $r3d = LA %stack.0, 40, $noreg
170    renamable $r4d = LARL @g_1390
171    STG renamable $r4d, undef renamable $r1d, 0, $noreg :: (store (s64) into `ptr undef`)
172    renamable $r5d = nuw LA %stack.0, 48, $noreg
173    renamable $r14d = LA %stack.0, 72, $noreg
174    renamable $r13d = LA %stack.0, 80, $noreg
175    renamable $r12d = LA %stack.0, 56, $noreg
176    renamable $r10d = LA %stack.0, 0, $noreg
177    STG renamable $r10d, undef renamable $r1d, 0, $noreg :: (store (s64) into `ptr undef`)
178    renamable $r9d = LA %stack.0, 64, $noreg
179    renamable $r8d = LA %stack.0, 88, $noreg
180    renamable $r7d = nuw LA %stack.0, 8, $noreg
181    MVGHI %stack.1, 904, 0
182    STG killed renamable $r9d, $noreg, 0, $noreg :: (store (s64) into `ptr null`)
183    STG killed renamable $r3d, undef renamable $r1d, 0, $noreg :: (store (s64) into `ptr undef`)
184    STG killed renamable $r14d, undef renamable $r1d, 0, $noreg :: (store (s64) into `ptr undef`)
185    STG killed renamable $r7d, undef renamable $r1d, 0, $noreg :: (store (s64) into `ptr undef`)
186    STG killed renamable $r1d, undef renamable $r1d, 0, $noreg :: (store (s64) into `ptr undef`)
187    STG killed renamable $r4d, undef renamable $r1d, 0, $noreg :: (store (s64) into `ptr undef`)
188    STG killed renamable $r2d, undef renamable $r1d, 0, $noreg :: (store (s64) into `ptr undef`)
189    STG killed renamable $r5d, undef renamable $r1d, 0, $noreg :: (store (s64) into `ptr undef`)
190    STG killed renamable $r8d, undef renamable $r1d, 0, $noreg :: (store (s64) into `ptr undef`)
191    STG killed renamable $r12d, undef renamable $r1d, 0, $noreg :: (store (s64) into `ptr undef`)
192    STG killed renamable $r13d, undef renamable $r1d, 0, $noreg :: (store (s64) into `ptr undef`)
193    STG killed renamable $r10d, undef renamable $r1d, 0, $noreg :: (store (s64) into `ptr undef`)
194    $r2l = LHI 0
195    STG killed renamable $r0d, undef renamable $r1d, 0, $noreg :: (store (s64) into `ptr undef`)
196    Return implicit $r2l
197
198...
199