1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -mtriple=aarch64-- -run-pass=early-ifcvt -stress-early-ifcvt -verify-machineinstrs %s -o - | FileCheck %s
6 tracksRegLiveness: true
8 - { id: 0, class: fpr32, preferred-register: '' }
9 - { id: 1, class: fpr32, preferred-register: '' }
10 - { id: 2, class: fpr32, preferred-register: '' }
11 - { id: 3, class: fpr32, preferred-register: '' }
12 - { id: 4, class: fpr32, preferred-register: '' }
13 - { id: 5, class: gpr32common, preferred-register: '' }
14 - { id: 6, class: gpr32, preferred-register: '' }
15 - { id: 7, class: fpr32, preferred-register: '' }
16 - { id: 8, class: fpr32, preferred-register: '' }
18 - { reg: '$s1', virtual-reg: '%4' }
19 - { reg: '$w0', virtual-reg: '%5' }
21 ; CHECK-LABEL: name: fmov0
23 ; CHECK: liveins: $s1, $w0
24 ; CHECK: [[COPY:%[0-9]+]]:gpr32common = COPY $w0
25 ; CHECK: [[COPY1:%[0-9]+]]:fpr32 = COPY $s1
26 ; CHECK: [[SUBSWri:%[0-9]+]]:gpr32 = SUBSWri [[COPY]], 1, 0, implicit-def $nzcv
27 ; CHECK: [[FMOVS0_:%[0-9]+]]:fpr32 = FMOVS0
28 ; CHECK: [[FMOVS0_1:%[0-9]+]]:fpr32 = FMOVS0
29 ; CHECK: [[COPY2:%[0-9]+]]:fpr32 = COPY [[FMOVS0_]]
30 ; CHECK: $s0 = COPY [[COPY2]]
31 ; CHECK: RET_ReallyLR implicit $s0
33 successors: %bb.1, %bb.2
36 %5:gpr32common = COPY $w0
38 %6:gpr32 = SUBSWri %5, 1, 0, implicit-def $nzcv
39 Bcc 1, %bb.2, implicit $nzcv
54 %2:fpr32 = PHI %1, %bb.2, %0, %bb.1
56 RET_ReallyLR implicit $s0
61 tracksRegLiveness: true
63 - { id: 0, class: fpr32, preferred-register: '' }
64 - { id: 1, class: fpr32, preferred-register: '' }
65 - { id: 2, class: fpr32, preferred-register: '' }
66 - { id: 3, class: fpr32, preferred-register: '' }
67 - { id: 4, class: fpr32, preferred-register: '' }
68 - { id: 5, class: gpr32common, preferred-register: '' }
69 - { id: 6, class: gpr32, preferred-register: '' }
70 - { id: 7, class: fpr32, preferred-register: '' }
71 - { id: 8, class: fpr32, preferred-register: '' }
73 - { reg: '$s1', virtual-reg: '%4' }
74 - { reg: '$w0', virtual-reg: '%5' }
76 ; CHECK-LABEL: name: fmov0_extrapred
78 ; CHECK: successors: %bb.4(0x80000000)
79 ; CHECK: liveins: $s1, $w0
80 ; CHECK: [[COPY:%[0-9]+]]:gpr32common = COPY $w0
81 ; CHECK: [[COPY1:%[0-9]+]]:fpr32 = COPY $s1
82 ; CHECK: [[SUBSWri:%[0-9]+]]:gpr32 = SUBSWri [[COPY]], 1, 0, implicit-def $nzcv
83 ; CHECK: [[FMOVS0_:%[0-9]+]]:fpr32 = FMOVS0
84 ; CHECK: [[FMOVS0_1:%[0-9]+]]:fpr32 = FMOVS0
87 ; CHECK: successors: %bb.4(0x80000000)
88 ; CHECK: [[DEF:%[0-9]+]]:fpr32 = IMPLICIT_DEF
91 ; CHECK: [[PHI:%[0-9]+]]:fpr32 = PHI [[FMOVS0_]], %bb.0, [[DEF]], %bb.1
92 ; CHECK: $s0 = COPY [[PHI]]
93 ; CHECK: RET_ReallyLR implicit $s0
95 successors: %bb.1, %bb.2
98 %5:gpr32common = COPY $w0
100 %6:gpr32 = SUBSWri %5, 1, 0, implicit-def $nzcv
101 Bcc 1, %bb.2, implicit $nzcv
107 ; Make sure we also handle the case when there are extra predecessors on
109 %3:fpr32 = IMPLICIT_DEF
124 %2:fpr32 = PHI %1, %bb.2, %0, %bb.1, %3, %bb.4
126 RET_ReallyLR implicit $s0
131 tracksRegLiveness: true
133 - { id: 0, class: fpr32, preferred-register: '' }
134 - { id: 1, class: fpr32, preferred-register: '' }
135 - { id: 2, class: fpr32, preferred-register: '' }
136 - { id: 3, class: fpr32, preferred-register: '' }
137 - { id: 4, class: fpr32, preferred-register: '' }
138 - { id: 5, class: gpr32common, preferred-register: '' }
139 - { id: 6, class: gpr32, preferred-register: '' }
140 - { id: 7, class: fpr32, preferred-register: '' }
141 - { id: 8, class: fpr32, preferred-register: '' }
142 - { id: 9, class: fpr32, preferred-register: '' }
143 - { id: 10, class: fpr32, preferred-register: '' }
145 - { reg: '$s1', virtual-reg: '%4' }
146 - { reg: '$w0', virtual-reg: '%5' }
148 ; CHECK-LABEL: name: copy_physreg
150 ; CHECK: liveins: $s1, $w0
151 ; CHECK: [[COPY:%[0-9]+]]:gpr32common = COPY $w0
152 ; CHECK: [[COPY1:%[0-9]+]]:fpr32 = COPY $s1
153 ; CHECK: [[SUBSWri:%[0-9]+]]:gpr32 = SUBSWri [[COPY]], 1, 0, implicit-def $nzcv
154 ; CHECK: [[DEF:%[0-9]+]]:fpr32 = IMPLICIT_DEF implicit-def $s1
155 ; CHECK: [[COPY2:%[0-9]+]]:fpr32 = COPY $s1
156 ; CHECK: [[DEF1:%[0-9]+]]:fpr32 = IMPLICIT_DEF implicit-def $s1
157 ; CHECK: [[COPY3:%[0-9]+]]:fpr32 = COPY $s1
158 ; CHECK: [[FCSELSrrr:%[0-9]+]]:fpr32 = FCSELSrrr [[COPY2]], [[COPY3]], 1, implicit $nzcv
159 ; CHECK: $s0 = COPY [[FCSELSrrr]]
160 ; CHECK: RET_ReallyLR implicit $s0
162 successors: %bb.1, %bb.2
165 %5:gpr32common = COPY $w0
167 %6:gpr32 = SUBSWri %5, 1, 0, implicit-def $nzcv
168 Bcc 1, %bb.2, implicit $nzcv
174 %9:fpr32 = IMPLICIT_DEF implicit-def $s1
181 %10:fpr32 = IMPLICIT_DEF implicit-def $s1
185 %2:fpr32 = PHI %1, %bb.2, %0, %bb.1
187 RET_ReallyLR implicit $s0
191 name: same_def_different_operand
192 tracksRegLiveness: true
194 - { id: 0, class: fpr32, preferred-register: '' }
195 - { id: 1, class: fpr32, preferred-register: '' }
196 - { id: 2, class: gpr64common, preferred-register: '' }
197 - { id: 3, class: fpr32, preferred-register: '' }
198 - { id: 4, class: fpr32, preferred-register: '' }
199 - { id: 5, class: gpr32common, preferred-register: '' }
200 - { id: 6, class: gpr32, preferred-register: '' }
201 - { id: 7, class: fpr32, preferred-register: '' }
202 - { id: 8, class: fpr32, preferred-register: '' }
203 - { id: 9, class: gpr64common, preferred-register: '' }
204 - { id: 10, class: gpr64, preferred-register: '' }
205 - { id: 11, class: gpr64common, preferred-register: '' }
207 - { reg: '$s1', virtual-reg: '%4' }
208 - { reg: '$w0', virtual-reg: '%5' }
209 - { reg: '$x2', virtual-reg: '%9' }
211 ; CHECK-LABEL: name: same_def_different_operand
213 ; CHECK: liveins: $s1, $w0, $x2
214 ; CHECK: [[COPY:%[0-9]+]]:gpr64common = COPY $x0
215 ; CHECK: early-clobber %11:gpr64common, %10:gpr64 = LDRXpre [[COPY]], 16
216 ; CHECK: [[COPY1:%[0-9]+]]:gpr32common = COPY $w0
217 ; CHECK: [[COPY2:%[0-9]+]]:fpr32 = COPY $s1
218 ; CHECK: [[SUBSWri:%[0-9]+]]:gpr32 = SUBSWri [[COPY1]], 1, 0, implicit-def $nzcv
219 ; CHECK: [[CSELXr:%[0-9]+]]:gpr64common = CSELXr %11, %10, 1, implicit $nzcv
220 ; CHECK: $x2 = COPY [[CSELXr]]
221 ; CHECK: RET_ReallyLR implicit $x2
223 successors: %bb.1, %bb.2
224 liveins: $s1, $w0, $x2
226 %9:gpr64common = COPY $x0
227 early-clobber %11:gpr64common, %10:gpr64 = LDRXpre %9:gpr64common, 16
229 %5:gpr32common = COPY $w0
231 %6:gpr32 = SUBSWri %5, 1, 0, implicit-def $nzcv
232 Bcc 1, %bb.2, implicit $nzcv
246 %2:gpr64common = PHI %11, %bb.2, %10, %bb.1
248 RET_ReallyLR implicit $x2