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