1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -simplify-mir -verify-machineinstrs -mtriple=powerpc64-ibm-aix-xcoff \
3 # RUN: -stop-after=postrapseudos %s -o - | FileCheck %s
8 tracksRegLiveness: true
12 ; CHECK-LABEL: name: foo
13 ; CHECK: liveins: $x3, $x4
15 ; CHECK-NEXT: early-clobber renamable $g8p3 = LQ 128, $x4
16 ; CHECK-NEXT: $x3 = OR8 $x7, $x7
17 ; CHECK-NEXT: STQ killed renamable $g8p3, 160, $x3
18 ; CHECK-NEXT: BLR8 implicit $lr8, implicit undef $rm, implicit $x3
19 %0:g8prc = LQ 128, $x4
20 $x3 = COPY %0.sub_gp8_x1:g8prc
22 BLR8 implicit $lr8, implicit undef $rm, implicit $x3
28 tracksRegLiveness: true
32 ; CHECK-LABEL: name: foobar
33 ; CHECK: liveins: $x3, $x4
35 ; CHECK-NEXT: renamable $g8p3 = LQARX $x3, $x4
36 ; CHECK-NEXT: STQCX renamable $g8p3, $x3, $x4, implicit-def dead $cr0
37 ; CHECK-NEXT: $x3 = OR8 $x7, killed $x7
38 ; CHECK-NEXT: BLR8 implicit $lr8, implicit undef $rm, implicit $x3
39 %0:g8prc = LQARX $x3, $x4
40 STQCX %0:g8prc, $x3, $x4, implicit-def $cr0
41 $x3 = COPY %0.sub_gp8_x1:g8prc
42 BLR8 implicit $lr8, implicit undef $rm, implicit $x3
48 tracksRegLiveness: true
52 ; CHECK-LABEL: name: bar
53 ; CHECK: liveins: $x3, $x4
55 ; CHECK-NEXT: early-clobber renamable $g8p2 = LQ 128, renamable $x3
56 ; CHECK-NEXT: STQ renamable $g8p2, 160, $x3
57 ; CHECK-NEXT: $x3 = OR8 $x4, killed $x4
58 ; CHECK-NEXT: BLR8 implicit $lr8, implicit undef $rm, implicit $x3
59 %0:g8rc_nox0 = COPY $x3
62 $x3 = COPY %1.sub_gp8_x0:g8prc
63 BLR8 implicit $lr8, implicit undef $rm, implicit $x3
66 # `spill_g8prc`'s code contains undefined behaviors. This code is only to
67 # demonstrate correctness of spiller.
71 tracksRegLiveness: true
74 liveins: $x3, $x4, $x5, $x6, $x7, $x8, $x9, $x10, $x11, $x12
75 ; CHECK-LABEL: name: spill_g8prc
76 ; CHECK: liveins: $x3, $x4, $x5, $x6, $x7, $x8, $x9, $x10, $x11, $x12, $x14, $x15, $x16, $x17, $x18, $x19, $x20, $x21, $x22, $x23, $x24, $x25, $x26, $x27, $x28, $x29, $x30, $x31
78 ; CHECK-NEXT: STD killed $x14, -144, $x1 :: (store (s64) into %fixed-stack.17, align 16)
79 ; CHECK-NEXT: STD killed $x15, -136, $x1 :: (store (s64) into %fixed-stack.16)
80 ; CHECK-NEXT: STD killed $x16, -128, $x1 :: (store (s64) into %fixed-stack.15, align 16)
81 ; CHECK-NEXT: STD killed $x17, -120, $x1 :: (store (s64) into %fixed-stack.14)
82 ; CHECK-NEXT: STD killed $x18, -112, $x1 :: (store (s64) into %fixed-stack.13, align 16)
83 ; CHECK-NEXT: STD killed $x19, -104, $x1 :: (store (s64) into %fixed-stack.12)
84 ; CHECK-NEXT: STD killed $x20, -96, $x1 :: (store (s64) into %fixed-stack.11, align 16)
85 ; CHECK-NEXT: STD killed $x21, -88, $x1 :: (store (s64) into %fixed-stack.10)
86 ; CHECK-NEXT: STD killed $x22, -80, $x1 :: (store (s64) into %fixed-stack.9, align 16)
87 ; CHECK-NEXT: STD killed $x23, -72, $x1 :: (store (s64) into %fixed-stack.8)
88 ; CHECK-NEXT: STD killed $x24, -64, $x1 :: (store (s64) into %fixed-stack.7, align 16)
89 ; CHECK-NEXT: STD killed $x25, -56, $x1 :: (store (s64) into %fixed-stack.6)
90 ; CHECK-NEXT: STD killed $x26, -48, $x1 :: (store (s64) into %fixed-stack.5, align 16)
91 ; CHECK-NEXT: STD killed $x27, -40, $x1 :: (store (s64) into %fixed-stack.4)
92 ; CHECK-NEXT: STD killed $x28, -32, $x1 :: (store (s64) into %fixed-stack.3, align 16)
93 ; CHECK-NEXT: STD killed $x29, -24, $x1 :: (store (s64) into %fixed-stack.2)
94 ; CHECK-NEXT: STD killed $x30, -16, $x1 :: (store (s64) into %fixed-stack.1, align 16)
95 ; CHECK-NEXT: STD killed $x31, -8, $x1 :: (store (s64) into %fixed-stack.0)
96 ; CHECK-NEXT: $x7 = OR8 $x3, $x3
97 ; CHECK-NEXT: renamable $g8p4 = LQARX $x5, $x6
98 ; CHECK-NEXT: STD killed $x8, -160, $x1
99 ; CHECK-NEXT: STD killed $x9, -152, $x1
100 ; CHECK-NEXT: renamable $g8p13 = LQARX $x3, renamable $x4
101 ; CHECK-NEXT: renamable $g8p4 = LQARX $x3, renamable $x4
102 ; CHECK-NEXT: STD killed $x8, -176, $x1
103 ; CHECK-NEXT: STD killed $x9, -168, $x1
104 ; CHECK-NEXT: renamable $g8p4 = LQARX $x3, renamable $x4
105 ; CHECK-NEXT: STD killed $x8, -192, $x1
106 ; CHECK-NEXT: STD killed $x9, -184, $x1
107 ; CHECK-NEXT: renamable $g8p4 = LQARX $x3, renamable $x4
108 ; CHECK-NEXT: STD killed $x8, -208, $x1
109 ; CHECK-NEXT: STD killed $x9, -200, $x1
110 ; CHECK-NEXT: renamable $g8p4 = LQARX $x3, renamable $x4
111 ; CHECK-NEXT: STD killed $x8, -224, $x1
112 ; CHECK-NEXT: STD killed $x9, -216, $x1
113 ; CHECK-NEXT: renamable $g8p10 = LQARX $x3, renamable $x4
114 ; CHECK-NEXT: renamable $g8p9 = LQARX $x3, renamable $x4
115 ; CHECK-NEXT: renamable $g8p8 = LQARX $x3, renamable $x4
116 ; CHECK-NEXT: renamable $g8p7 = LQARX $x3, renamable $x4
117 ; CHECK-NEXT: renamable $g8p15 = LQARX $x3, renamable $x4
118 ; CHECK-NEXT: renamable $g8p11 = LQARX $x3, renamable $x4
119 ; CHECK-NEXT: renamable $g8p12 = LQARX $x3, renamable $x4
120 ; CHECK-NEXT: renamable $g8p14 = LQARX $x3, renamable $x4
121 ; CHECK-NEXT: renamable $g8p5 = LQARX $x3, renamable $x4
122 ; CHECK-NEXT: renamable $g8p4 = LQARX $x3, renamable $x4
123 ; CHECK-NEXT: $x3 = OR8 $x27, $x27
124 ; CHECK-NEXT: STQCX killed renamable $g8p4, renamable $x7, renamable $x4, implicit-def dead $cr0
125 ; CHECK-NEXT: STQCX killed renamable $g8p5, renamable $x7, renamable $x4, implicit-def dead $cr0
126 ; CHECK-NEXT: STQCX killed renamable $g8p14, renamable $x7, renamable $x4, implicit-def dead $cr0
127 ; CHECK-NEXT: STQCX killed renamable $g8p12, renamable $x7, renamable $x4, implicit-def dead $cr0
128 ; CHECK-NEXT: STQCX killed renamable $g8p11, renamable $x7, renamable $x4, implicit-def dead $cr0
129 ; CHECK-NEXT: STQCX killed renamable $g8p15, renamable $x7, renamable $x4, implicit-def dead $cr0
130 ; CHECK-NEXT: STQCX killed renamable $g8p7, renamable $x7, renamable $x4, implicit-def dead $cr0
131 ; CHECK-NEXT: STQCX killed renamable $g8p8, renamable $x7, renamable $x4, implicit-def dead $cr0
132 ; CHECK-NEXT: STQCX killed renamable $g8p9, renamable $x7, renamable $x4, implicit-def dead $cr0
133 ; CHECK-NEXT: STQCX killed renamable $g8p10, renamable $x7, renamable $x4, implicit-def dead $cr0
134 ; CHECK-NEXT: $x8 = LD -224, $x1
135 ; CHECK-NEXT: $x9 = LD -216, $x1
136 ; CHECK-NEXT: STQCX killed renamable $g8p4, renamable $x7, renamable $x4, implicit-def dead $cr0
137 ; CHECK-NEXT: $x8 = LD -208, $x1
138 ; CHECK-NEXT: $x9 = LD -200, $x1
139 ; CHECK-NEXT: STQCX killed renamable $g8p4, renamable $x7, renamable $x4, implicit-def dead $cr0
140 ; CHECK-NEXT: $x8 = LD -192, $x1
141 ; CHECK-NEXT: $x9 = LD -184, $x1
142 ; CHECK-NEXT: STQCX killed renamable $g8p4, renamable $x7, renamable $x4, implicit-def dead $cr0
143 ; CHECK-NEXT: $x8 = LD -176, $x1
144 ; CHECK-NEXT: $x9 = LD -168, $x1
145 ; CHECK-NEXT: STQCX killed renamable $g8p4, renamable $x7, renamable $x4, implicit-def dead $cr0
146 ; CHECK-NEXT: STQCX killed renamable $g8p13, killed renamable $x7, killed renamable $x4, implicit-def dead $cr0
147 ; CHECK-NEXT: $x8 = LD -160, $x1
148 ; CHECK-NEXT: $x9 = LD -152, $x1
149 ; CHECK-NEXT: STQCX killed renamable $g8p4, $x5, $x6, implicit-def dead $cr0
150 ; CHECK-NEXT: $x31 = LD -8, $x1 :: (load (s64) from %fixed-stack.0)
151 ; CHECK-NEXT: $x30 = LD -16, $x1 :: (load (s64) from %fixed-stack.1, align 16)
152 ; CHECK-NEXT: $x29 = LD -24, $x1 :: (load (s64) from %fixed-stack.2)
153 ; CHECK-NEXT: $x28 = LD -32, $x1 :: (load (s64) from %fixed-stack.3, align 16)
154 ; CHECK-NEXT: $x27 = LD -40, $x1 :: (load (s64) from %fixed-stack.4)
155 ; CHECK-NEXT: $x26 = LD -48, $x1 :: (load (s64) from %fixed-stack.5, align 16)
156 ; CHECK-NEXT: $x25 = LD -56, $x1 :: (load (s64) from %fixed-stack.6)
157 ; CHECK-NEXT: $x24 = LD -64, $x1 :: (load (s64) from %fixed-stack.7, align 16)
158 ; CHECK-NEXT: $x23 = LD -72, $x1 :: (load (s64) from %fixed-stack.8)
159 ; CHECK-NEXT: $x22 = LD -80, $x1 :: (load (s64) from %fixed-stack.9, align 16)
160 ; CHECK-NEXT: $x21 = LD -88, $x1 :: (load (s64) from %fixed-stack.10)
161 ; CHECK-NEXT: $x20 = LD -96, $x1 :: (load (s64) from %fixed-stack.11, align 16)
162 ; CHECK-NEXT: $x19 = LD -104, $x1 :: (load (s64) from %fixed-stack.12)
163 ; CHECK-NEXT: $x18 = LD -112, $x1 :: (load (s64) from %fixed-stack.13, align 16)
164 ; CHECK-NEXT: $x17 = LD -120, $x1 :: (load (s64) from %fixed-stack.14)
165 ; CHECK-NEXT: $x16 = LD -128, $x1 :: (load (s64) from %fixed-stack.15, align 16)
166 ; CHECK-NEXT: $x15 = LD -136, $x1 :: (load (s64) from %fixed-stack.16)
167 ; CHECK-NEXT: $x14 = LD -144, $x1 :: (load (s64) from %fixed-stack.17, align 16)
168 ; CHECK-NEXT: BLR8 implicit $lr8, implicit undef $rm, implicit $x3
169 %addr0:g8rc_nox0 = COPY $x3
170 %addr1:g8rc = COPY $x4
171 %0:g8prc = LQARX $x5, $x6
172 %1:g8prc = LQARX %addr0, %addr1
173 %2:g8prc = LQARX %addr0, %addr1
174 %3:g8prc = LQARX %addr0, %addr1
175 %4:g8prc = LQARX %addr0, %addr1
176 %5:g8prc = LQARX %addr0, %addr1
177 %6:g8prc = LQARX %addr0, %addr1
178 %7:g8prc = LQARX %addr0, %addr1
179 %8:g8prc = LQARX %addr0, %addr1
180 %9:g8prc = LQARX %addr0, %addr1
181 %10:g8prc = LQARX %addr0, %addr1
182 %11:g8prc = LQARX %addr0, %addr1
183 %12:g8prc = LQARX %addr0, %addr1
184 %13:g8prc = LQARX %addr0, %addr1
185 %14:g8prc = LQARX %addr0, %addr1
186 %15:g8prc = LQARX %addr0, %addr1
187 STQCX %15:g8prc, %addr0, %addr1, implicit-def $cr0
188 STQCX %14:g8prc, %addr0, %addr1, implicit-def $cr0
189 STQCX %13:g8prc, %addr0, %addr1, implicit-def $cr0
190 STQCX %12:g8prc, %addr0, %addr1, implicit-def $cr0
191 STQCX %11:g8prc, %addr0, %addr1, implicit-def $cr0
192 STQCX %10:g8prc, %addr0, %addr1, implicit-def $cr0
193 STQCX %9:g8prc, %addr0, %addr1, implicit-def $cr0
194 STQCX %8:g8prc, %addr0, %addr1, implicit-def $cr0
195 STQCX %7:g8prc, %addr0, %addr1, implicit-def $cr0
196 STQCX %6:g8prc, %addr0, %addr1, implicit-def $cr0
197 STQCX %5:g8prc, %addr0, %addr1, implicit-def $cr0
198 STQCX %4:g8prc, %addr0, %addr1, implicit-def $cr0
199 STQCX %3:g8prc, %addr0, %addr1, implicit-def $cr0
200 STQCX %2:g8prc, %addr0, %addr1, implicit-def $cr0
201 STQCX %1:g8prc, %addr0, %addr1, implicit-def $cr0
202 STQCX %0:g8prc, $x5, $x6, implicit-def $cr0
203 $x3 = COPY %1.sub_gp8_x1:g8prc
204 BLR8 implicit $lr8, implicit undef $rm, implicit $x3
210 tracksRegLiveness: true
214 ; CHECK-LABEL: name: copy_g8prc
215 ; CHECK: liveins: $g8p8
217 ; CHECK-NEXT: $x4 = OR8 $x16, $x16
218 ; CHECK-NEXT: $x5 = OR8 $x17, $x17
219 ; CHECK-NEXT: $x3 = OR8 $x5, $x5
220 ; CHECK-NEXT: BLR8 implicit $lr8, implicit undef $rm, implicit killed $x3, implicit $x4
221 %0:g8prc = COPY $g8p8
222 $x3 = COPY %0.sub_gp8_x1:g8prc
223 $x4 = COPY %0.sub_gp8_x0:g8prc
224 BLR8 implicit $lr8, implicit undef $rm, implicit $x3, implicit $x4