1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -simplify-mir -verify-machineinstrs -mcpu=ppc -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: $x4, $x5
15 ; CHECK-NEXT: early-clobber renamable $g8p3 = LQ 128, $x4
16 ; CHECK-NEXT: $x5 = OR8 $x7, $x7
17 ; CHECK-NEXT: STQ killed renamable $g8p3, 160, $x5
18 ; CHECK-NEXT: BLR8 implicit $lr8, implicit undef $rm, implicit $x5
19 %0:g8prc = LQ 128, $x4
20 $x5 = COPY %0.sub_gp8_x1:g8prc
22 BLR8 implicit $lr8, implicit undef $rm, implicit $x5
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, $x2
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: STD killed $x2, -152, $x1 :: (store (s64) into %stack.4)
97 ; CHECK-NEXT: $x7 = OR8 $x3, $x3
98 ; CHECK-NEXT: renamable $g8p4 = LQARX $x5, $x6
99 ; CHECK-NEXT: STD killed $x8, -176, $x1
100 ; CHECK-NEXT: STD killed $x9, -168, $x1
101 ; CHECK-NEXT: renamable $g8p1 = LQARX $x3, renamable $x4
102 ; CHECK-NEXT: renamable $g8p4 = LQARX renamable $x7, renamable $x4
103 ; CHECK-NEXT: STD killed $x8, -192, $x1
104 ; CHECK-NEXT: STD killed $x9, -184, $x1
105 ; CHECK-NEXT: renamable $g8p4 = LQARX renamable $x7, renamable $x4
106 ; CHECK-NEXT: STD killed $x8, -208, $x1
107 ; CHECK-NEXT: STD killed $x9, -200, $x1
108 ; CHECK-NEXT: renamable $g8p4 = LQARX renamable $x7, renamable $x4
109 ; CHECK-NEXT: STD killed $x8, -224, $x1
110 ; CHECK-NEXT: STD killed $x9, -216, $x1
111 ; CHECK-NEXT: renamable $g8p12 = LQARX renamable $x7, renamable $x4
112 ; CHECK-NEXT: renamable $g8p11 = LQARX renamable $x7, renamable $x4
113 ; CHECK-NEXT: renamable $g8p10 = LQARX renamable $x7, renamable $x4
114 ; CHECK-NEXT: renamable $g8p9 = LQARX renamable $x7, renamable $x4
115 ; CHECK-NEXT: renamable $g8p8 = LQARX renamable $x7, renamable $x4
116 ; CHECK-NEXT: renamable $g8p7 = LQARX renamable $x7, renamable $x4
117 ; CHECK-NEXT: renamable $g8p15 = LQARX renamable $x7, renamable $x4
118 ; CHECK-NEXT: renamable $g8p13 = LQARX renamable $x7, renamable $x4
119 ; CHECK-NEXT: renamable $g8p14 = LQARX renamable $x7, renamable $x4
120 ; CHECK-NEXT: renamable $g8p5 = LQARX renamable $x7, renamable $x4
121 ; CHECK-NEXT: renamable $g8p4 = LQARX renamable $x7, renamable $x4
122 ; CHECK-NEXT: STQCX killed renamable $g8p4, renamable $x7, renamable $x4, implicit-def dead $cr0
123 ; CHECK-NEXT: STQCX killed renamable $g8p5, renamable $x7, renamable $x4, implicit-def dead $cr0
124 ; CHECK-NEXT: STQCX killed renamable $g8p14, renamable $x7, renamable $x4, implicit-def dead $cr0
125 ; CHECK-NEXT: STQCX killed renamable $g8p13, renamable $x7, renamable $x4, implicit-def dead $cr0
126 ; CHECK-NEXT: STQCX killed renamable $g8p15, renamable $x7, renamable $x4, implicit-def dead $cr0
127 ; CHECK-NEXT: STQCX killed renamable $g8p7, renamable $x7, renamable $x4, implicit-def dead $cr0
128 ; CHECK-NEXT: STQCX killed renamable $g8p8, renamable $x7, renamable $x4, implicit-def dead $cr0
129 ; CHECK-NEXT: STQCX killed renamable $g8p9, renamable $x7, renamable $x4, implicit-def dead $cr0
130 ; CHECK-NEXT: STQCX killed renamable $g8p10, renamable $x7, renamable $x4, implicit-def dead $cr0
131 ; CHECK-NEXT: STQCX killed renamable $g8p11, renamable $x7, renamable $x4, implicit-def dead $cr0
132 ; CHECK-NEXT: STQCX killed renamable $g8p12, renamable $x7, renamable $x4, implicit-def dead $cr0
133 ; CHECK-NEXT: $x8 = LD -224, $x1
134 ; CHECK-NEXT: $x9 = LD -216, $x1
135 ; CHECK-NEXT: STQCX killed renamable $g8p4, renamable $x7, renamable $x4, implicit-def dead $cr0
136 ; CHECK-NEXT: $x8 = LD -208, $x1
137 ; CHECK-NEXT: $x9 = LD -200, $x1
138 ; CHECK-NEXT: STQCX killed renamable $g8p4, renamable $x7, renamable $x4, implicit-def dead $cr0
139 ; CHECK-NEXT: $x8 = LD -192, $x1
140 ; CHECK-NEXT: $x9 = LD -184, $x1
141 ; CHECK-NEXT: STQCX killed renamable $g8p4, renamable $x7, renamable $x4, implicit-def dead $cr0
142 ; CHECK-NEXT: STQCX renamable $g8p1, killed renamable $x7, killed 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, $x5, $x6, implicit-def dead $cr0
146 ; CHECK-NEXT: $x2 = LD -152, $x1 :: (load (s64) from %stack.4)
147 ; CHECK-NEXT: $x31 = LD -8, $x1 :: (load (s64) from %fixed-stack.0)
148 ; CHECK-NEXT: $x30 = LD -16, $x1 :: (load (s64) from %fixed-stack.1, align 16)
149 ; CHECK-NEXT: $x29 = LD -24, $x1 :: (load (s64) from %fixed-stack.2)
150 ; CHECK-NEXT: $x28 = LD -32, $x1 :: (load (s64) from %fixed-stack.3, align 16)
151 ; CHECK-NEXT: $x27 = LD -40, $x1 :: (load (s64) from %fixed-stack.4)
152 ; CHECK-NEXT: $x26 = LD -48, $x1 :: (load (s64) from %fixed-stack.5, align 16)
153 ; CHECK-NEXT: $x25 = LD -56, $x1 :: (load (s64) from %fixed-stack.6)
154 ; CHECK-NEXT: $x24 = LD -64, $x1 :: (load (s64) from %fixed-stack.7, align 16)
155 ; CHECK-NEXT: $x23 = LD -72, $x1 :: (load (s64) from %fixed-stack.8)
156 ; CHECK-NEXT: $x22 = LD -80, $x1 :: (load (s64) from %fixed-stack.9, align 16)
157 ; CHECK-NEXT: $x21 = LD -88, $x1 :: (load (s64) from %fixed-stack.10)
158 ; CHECK-NEXT: $x20 = LD -96, $x1 :: (load (s64) from %fixed-stack.11, align 16)
159 ; CHECK-NEXT: $x19 = LD -104, $x1 :: (load (s64) from %fixed-stack.12)
160 ; CHECK-NEXT: $x18 = LD -112, $x1 :: (load (s64) from %fixed-stack.13, align 16)
161 ; CHECK-NEXT: $x17 = LD -120, $x1 :: (load (s64) from %fixed-stack.14)
162 ; CHECK-NEXT: $x16 = LD -128, $x1 :: (load (s64) from %fixed-stack.15, align 16)
163 ; CHECK-NEXT: $x15 = LD -136, $x1 :: (load (s64) from %fixed-stack.16)
164 ; CHECK-NEXT: $x14 = LD -144, $x1 :: (load (s64) from %fixed-stack.17, align 16)
165 ; CHECK-NEXT: BLR8 implicit $lr8, implicit undef $rm, implicit $x3
166 %addr0:g8rc_nox0 = COPY $x3
167 %addr1:g8rc = COPY $x4
168 %0:g8prc = LQARX $x5, $x6
169 %1:g8prc = LQARX %addr0, %addr1
170 %2:g8prc = LQARX %addr0, %addr1
171 %3:g8prc = LQARX %addr0, %addr1
172 %4:g8prc = LQARX %addr0, %addr1
173 %5:g8prc = LQARX %addr0, %addr1
174 %6:g8prc = LQARX %addr0, %addr1
175 %7:g8prc = LQARX %addr0, %addr1
176 %8:g8prc = LQARX %addr0, %addr1
177 %9:g8prc = LQARX %addr0, %addr1
178 %10:g8prc = LQARX %addr0, %addr1
179 %11:g8prc = LQARX %addr0, %addr1
180 %12:g8prc = LQARX %addr0, %addr1
181 %13:g8prc = LQARX %addr0, %addr1
182 %14:g8prc = LQARX %addr0, %addr1
183 %15:g8prc = LQARX %addr0, %addr1
184 STQCX %15:g8prc, %addr0, %addr1, implicit-def $cr0
185 STQCX %14:g8prc, %addr0, %addr1, implicit-def $cr0
186 STQCX %13:g8prc, %addr0, %addr1, implicit-def $cr0
187 STQCX %12:g8prc, %addr0, %addr1, implicit-def $cr0
188 STQCX %11:g8prc, %addr0, %addr1, implicit-def $cr0
189 STQCX %10:g8prc, %addr0, %addr1, implicit-def $cr0
190 STQCX %9:g8prc, %addr0, %addr1, implicit-def $cr0
191 STQCX %8:g8prc, %addr0, %addr1, implicit-def $cr0
192 STQCX %7:g8prc, %addr0, %addr1, implicit-def $cr0
193 STQCX %6:g8prc, %addr0, %addr1, implicit-def $cr0
194 STQCX %5:g8prc, %addr0, %addr1, implicit-def $cr0
195 STQCX %4:g8prc, %addr0, %addr1, implicit-def $cr0
196 STQCX %3:g8prc, %addr0, %addr1, implicit-def $cr0
197 STQCX %2:g8prc, %addr0, %addr1, implicit-def $cr0
198 STQCX %1:g8prc, %addr0, %addr1, implicit-def $cr0
199 STQCX %0:g8prc, $x5, $x6, implicit-def $cr0
200 $x3 = COPY %1.sub_gp8_x1:g8prc
201 BLR8 implicit $lr8, implicit undef $rm, implicit $x3
207 tracksRegLiveness: true
211 ; CHECK-LABEL: name: copy_g8prc
212 ; CHECK: liveins: $g8p8
214 ; CHECK-NEXT: $x4 = OR8 $x16, $x16
215 ; CHECK-NEXT: $x5 = OR8 $x17, $x17
216 ; CHECK-NEXT: BLR8 implicit $lr8, implicit undef $rm, implicit $x5, implicit $x4
217 %0:g8prc = COPY $g8p8
218 $x5 = COPY %0.sub_gp8_x1:g8prc
219 $x4 = COPY %0.sub_gp8_x0:g8prc
220 BLR8 implicit $lr8, implicit undef $rm, implicit $x5, implicit $x4