1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -O3 -verify-machineinstrs -mtriple=powerpc64-unknown-unknown \
3 # RUN: -simplify-mir -run-pass=machine-cp %s -o - | FileCheck %s
12 define void @test1() {
17 define void @test2() {
22 define void @test3() {
27 define void @test4() {
32 define void @test5() {
37 define void @test6() {
46 tracksRegLiveness: true
49 liveins: $x4, $x5, $x20, $x21, $x22
50 ; CHECK-LABEL: name: test0
51 ; CHECK: liveins: $x4, $x5, $x20, $x21, $x22
53 ; CHECK-NEXT: renamable $x24 = COPY $x4
54 ; CHECK-NEXT: $x23 = COPY renamable $x20
55 ; CHECK-NEXT: renamable $x20 = ADD8 $x4, $x5
56 ; CHECK-NEXT: renamable $x4 = COPY renamable $x20
57 ; CHECK-NEXT: renamable $x20 = COPY $x23
58 ; CHECK-NEXT: renamable $x23 = COPY renamable $x24
59 ; CHECK-NEXT: $x3 = COPY renamable $x4
60 ; CHECK-NEXT: BLR8 implicit $lr8, implicit undef $rm, implicit $x3, implicit $x20, implicit $x21, implicit $x22, implicit $x23
61 renamable $x23 = COPY renamable $x4
62 renamable $x24 = COPY renamable $x23
63 renamable $x23 = COPY renamable $x22
64 renamable $x22 = COPY renamable $x21
65 renamable $x21 = COPY renamable $x20
66 renamable $x20 = ADD8 $x4, $x5
67 renamable $x4 = COPY renamable $x20
68 renamable $x20 = COPY renamable $x21
69 renamable $x21 = COPY renamable $x22
70 renamable $x22 = COPY renamable $x23
71 renamable $x23 = COPY renamable $x24
72 $x3 = COPY renamable $x4
73 BLR8 implicit $lr8, implicit undef $rm, implicit $x3, implicit $x20, implicit $x21, implicit $x22, implicit $x23
81 tracksRegLiveness: true
84 liveins: $x3, $x20, $x21, $x22, $x23
85 ; CHECK-LABEL: name: test1
86 ; CHECK: liveins: $x3, $x20, $x21, $x22, $x23
88 ; CHECK-NEXT: renamable $x24 = COPY $x3
89 ; CHECK-NEXT: renamable $x23 = COPY renamable $x22
90 ; CHECK-NEXT: renamable $x22 = COPY renamable $x21
91 ; CHECK-NEXT: renamable $x21 = COPY renamable $x20
92 ; CHECK-NEXT: BLR8 implicit $lr8, implicit undef $rm, implicit $x3, implicit $x20, implicit $x21, implicit $x22, implicit $x23, implicit $x24
93 renamable $x23 = COPY $x3
94 renamable $x24 = COPY renamable $x23
95 renamable $x23 = COPY renamable $x22
96 renamable $x22 = COPY renamable $x21
97 renamable $x21 = COPY renamable $x20
98 renamable $x20 = COPY renamable $x21
99 renamable $x21 = COPY renamable $x22
100 renamable $x22 = COPY renamable $x23
101 renamable $x23 = COPY renamable $x24
102 renamable $x24 = COPY renamable $x23
103 renamable $x23 = COPY renamable $x22
104 renamable $x22 = COPY renamable $x21
105 renamable $x21 = COPY renamable $x20
106 BLR8 implicit $lr8, implicit undef $rm, implicit $x3, implicit $x20, implicit $x21, implicit $x22, implicit $x23, implicit $x24
110 # Chain one after one.
114 tracksRegLiveness: true
117 liveins: $x3, $x18, $x19, $x20, $x21, $x22, $x23, $x24
118 ; CHECK-LABEL: name: test2
119 ; CHECK: liveins: $x3, $x18, $x19, $x20, $x21, $x22, $x23, $x24
121 ; CHECK-NEXT: renamable $x21 = COPY renamable $x20
122 ; CHECK-NEXT: renamable $x20 = COPY renamable $x21
123 ; CHECK-NEXT: renamable $x25 = COPY renamable $x24
124 ; CHECK-NEXT: renamable $x24 = COPY renamable $x25
125 ; CHECK-NEXT: BLR8 implicit $lr8, implicit undef $rm, implicit $x3, implicit $x18, implicit $x19, implicit $x20, implicit $x21, implicit $x22, implicit $x23, implicit $x24, implicit $x25
126 renamable $x21 = COPY renamable $x20
127 renamable $x20 = COPY renamable $x19
128 renamable $x19 = COPY renamable $x18
129 renamable $x18 = COPY renamable $x19
130 renamable $x19 = COPY renamable $x20
131 renamable $x20 = COPY renamable $x21
132 renamable $x25 = COPY renamable $x24
133 renamable $x24 = COPY renamable $x23
134 renamable $x23 = COPY renamable $x22
135 renamable $x22 = COPY renamable $x23
136 renamable $x23 = COPY renamable $x24
137 renamable $x24 = COPY renamable $x25
138 BLR8 implicit $lr8, implicit undef $rm, implicit $x3, implicit $x18, implicit $x19, implicit $x20, implicit $x21, implicit $x22, implicit $x23, implicit $x24, implicit $x25
142 # Reorder code in test2, thus we have two chains in build simultaneously.
146 tracksRegLiveness: true
149 liveins: $x3, $x18, $x19, $x20, $x21, $x22, $x23, $x24
150 ; CHECK-LABEL: name: test3
151 ; CHECK: liveins: $x3, $x18, $x19, $x20, $x21, $x22, $x23, $x24
153 ; CHECK-NEXT: renamable $x21 = COPY renamable $x20
154 ; CHECK-NEXT: renamable $x25 = COPY renamable $x24
155 ; CHECK-NEXT: renamable $x20 = COPY renamable $x21
156 ; CHECK-NEXT: renamable $x24 = COPY renamable $x25
157 ; CHECK-NEXT: BLR8 implicit $lr8, implicit undef $rm, implicit $x3, implicit $x18, implicit $x19, implicit $x20, implicit $x21, implicit $x22, implicit $x23, implicit $x24, implicit $x25
158 renamable $x21 = COPY renamable $x20
159 renamable $x25 = COPY renamable $x24
160 renamable $x20 = COPY renamable $x19
161 renamable $x24 = COPY renamable $x23
162 renamable $x19 = COPY renamable $x18
163 renamable $x23 = COPY renamable $x22
164 renamable $x18 = COPY renamable $x19
165 renamable $x22 = COPY renamable $x23
166 renamable $x19 = COPY renamable $x20
167 renamable $x23 = COPY renamable $x24
168 renamable $x20 = COPY renamable $x21
169 renamable $x24 = COPY renamable $x25
170 BLR8 implicit $lr8, implicit undef $rm, implicit $x3, implicit $x18, implicit $x19, implicit $x20, implicit $x21, implicit $x22, implicit $x23, implicit $x24, implicit $x25
177 tracksRegLiveness: true
180 liveins: $x3, $x4, $x5
181 ; CHECK-LABEL: name: test4
182 ; CHECK: liveins: $x3, $x4, $x5
184 ; CHECK-NEXT: BLR8 implicit $lr8, implicit undef $rm, implicit $x3
185 renamable $x5 = COPY renamable $x3
186 renamable $x4 = COPY renamable $x3
187 renamable $x2 = COPY renamable $x3
188 renamable $x3 = COPY renamable $x2
189 renamable $x3 = COPY renamable $x4
190 renamable $x3 = COPY renamable $x5
191 BLR8 implicit $lr8, implicit undef $rm, implicit $x3
195 # Chain across regmask.
199 tracksRegLiveness: true
202 liveins: $x17, $x16, $x15, $x14, $x3
203 ; CHECK-LABEL: name: test5
204 ; CHECK: liveins: $x17, $x16, $x15, $x14, $x3
206 ; CHECK-NEXT: renamable $x18 = COPY renamable $x17
207 ; CHECK-NEXT: $x17 = COPY renamable $x3
208 ; CHECK-NEXT: BL8_NOP @foo, csr_ppc64, implicit-def dead $lr8, implicit $rm, implicit-def $x3, implicit $x3
209 ; CHECK-NEXT: renamable $x3 = COPY $x17
210 ; CHECK-NEXT: BLR8 implicit $lr8, implicit undef $rm, implicit $x3
211 renamable $x18 = COPY renamable $x17
212 renamable $x17 = COPY renamable $x16
213 renamable $x16 = COPY renamable $x15
214 renamable $x15 = COPY renamable $x14
215 renamable $x14 = COPY renamable $x3
216 BL8_NOP @foo, csr_ppc64, implicit-def dead $lr8, implicit $rm, implicit-def $x3, implicit $x3
217 renamable $x3 = COPY renamable $x14
218 renamable $x14 = COPY renamable $x15
219 renamable $x15 = COPY renamable $x16
220 renamable $x16 = COPY renamable $x17
221 renamable $x17 = COPY renamable $x18
222 BLR8 implicit $lr8, implicit undef $rm, implicit $x3
226 # Two chains across regmask.
230 tracksRegLiveness: true
233 liveins: $x20, $x19, $x17, $x16, $x15, $x14, $x3, $x4
234 ; CHECK-LABEL: name: test6
235 ; CHECK: liveins: $x20, $x19, $x17, $x16, $x15, $x14, $x3, $x4
237 ; CHECK-NEXT: renamable $x21 = COPY renamable $x20
238 ; CHECK-NEXT: renamable $x18 = COPY renamable $x17
239 ; CHECK-NEXT: $x17 = COPY renamable $x3
240 ; CHECK-NEXT: $x20 = COPY renamable $x4
241 ; CHECK-NEXT: BL8_NOP @foo, csr_ppc64, implicit-def dead $lr8, implicit $rm, implicit-def $x3, implicit $x3, implicit-def $x4, implicit $x4
242 ; CHECK-NEXT: renamable $x3 = COPY $x17
243 ; CHECK-NEXT: renamable $x4 = COPY $x20
244 ; CHECK-NEXT: BLR8 implicit $lr8, implicit undef $rm, implicit $x3, implicit $x4
245 renamable $x21 = COPY renamable $x20
246 renamable $x18 = COPY renamable $x17
247 renamable $x17 = COPY renamable $x16
248 renamable $x16 = COPY renamable $x15
249 renamable $x20 = COPY renamable $x19
250 renamable $x15 = COPY renamable $x14
251 renamable $x14 = COPY renamable $x3
252 renamable $x19 = COPY renamable $x4
253 BL8_NOP @foo, csr_ppc64, implicit-def dead $lr8, implicit $rm, implicit-def $x3, implicit $x3, implicit-def $x4, implicit $x4
254 renamable $x3 = COPY renamable $x14
255 renamable $x14 = COPY renamable $x15
256 renamable $x4 = COPY renamable $x19
257 renamable $x15 = COPY renamable $x16
258 renamable $x19 = COPY renamable $x20
259 renamable $x16 = COPY renamable $x17
260 renamable $x20 = COPY renamable $x21
261 renamable $x17 = COPY renamable $x18
262 BLR8 implicit $lr8, implicit undef $rm, implicit $x3, implicit $x4