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
3 # RUN: llc -mtriple=aarch64-- -passes=early-ifcvt -stress-early-ifcvt %s -o - | FileCheck %s
7 tracksRegLiveness: true
9 - { id: 0, class: fpr32, preferred-register: '' }
10 - { id: 1, class: fpr32, preferred-register: '' }
11 - { id: 2, class: fpr32, preferred-register: '' }
12 - { id: 3, class: fpr32, preferred-register: '' }
13 - { id: 4, class: fpr32, preferred-register: '' }
14 - { id: 5, class: gpr32common, preferred-register: '' }
15 - { id: 6, class: gpr32, preferred-register: '' }
16 - { id: 7, class: fpr32, preferred-register: '' }
17 - { id: 8, class: fpr32, preferred-register: '' }
19 - { reg: '$s1', virtual-reg: '%4' }
20 - { reg: '$w0', virtual-reg: '%5' }
22 ; CHECK-LABEL: name: fmov0
24 ; CHECK: liveins: $s1, $w0
25 ; CHECK: [[COPY:%[0-9]+]]:gpr32common = COPY $w0
26 ; CHECK: [[COPY1:%[0-9]+]]:fpr32 = COPY $s1
27 ; CHECK: [[SUBSWri:%[0-9]+]]:gpr32 = SUBSWri [[COPY]], 1, 0, implicit-def $nzcv
28 ; CHECK: [[FMOVS0_:%[0-9]+]]:fpr32 = FMOVS0
29 ; CHECK: [[FMOVS0_1:%[0-9]+]]:fpr32 = FMOVS0
30 ; CHECK: [[COPY2:%[0-9]+]]:fpr32 = COPY [[FMOVS0_]]
31 ; CHECK: $s0 = COPY [[COPY2]]
32 ; CHECK: RET_ReallyLR implicit $s0
34 successors: %bb.1, %bb.2
37 %5:gpr32common = COPY $w0
39 %6:gpr32 = SUBSWri %5, 1, 0, implicit-def $nzcv
40 Bcc 1, %bb.2, implicit $nzcv
55 %2:fpr32 = PHI %1, %bb.2, %0, %bb.1
57 RET_ReallyLR implicit $s0
62 tracksRegLiveness: true
64 - { id: 0, class: fpr32, preferred-register: '' }
65 - { id: 1, class: fpr32, preferred-register: '' }
66 - { id: 2, class: fpr32, preferred-register: '' }
67 - { id: 3, class: fpr32, preferred-register: '' }
68 - { id: 4, class: fpr32, preferred-register: '' }
69 - { id: 5, class: gpr32common, preferred-register: '' }
70 - { id: 6, class: gpr32, preferred-register: '' }
71 - { id: 7, class: fpr32, preferred-register: '' }
72 - { id: 8, class: fpr32, preferred-register: '' }
74 - { reg: '$s1', virtual-reg: '%4' }
75 - { reg: '$w0', virtual-reg: '%5' }
77 ; CHECK-LABEL: name: fmov0_extrapred
79 ; CHECK: successors: %bb.4(0x80000000)
80 ; CHECK: liveins: $s1, $w0
81 ; CHECK: [[COPY:%[0-9]+]]:gpr32common = COPY $w0
82 ; CHECK: [[COPY1:%[0-9]+]]:fpr32 = COPY $s1
83 ; CHECK: [[SUBSWri:%[0-9]+]]:gpr32 = SUBSWri [[COPY]], 1, 0, implicit-def $nzcv
84 ; CHECK: [[FMOVS0_:%[0-9]+]]:fpr32 = FMOVS0
85 ; CHECK: [[FMOVS0_1:%[0-9]+]]:fpr32 = FMOVS0
88 ; CHECK: successors: %bb.4(0x80000000)
89 ; CHECK: [[DEF:%[0-9]+]]:fpr32 = IMPLICIT_DEF
92 ; CHECK: [[PHI:%[0-9]+]]:fpr32 = PHI [[FMOVS0_]], %bb.0, [[DEF]], %bb.1
93 ; CHECK: $s0 = COPY [[PHI]]
94 ; CHECK: RET_ReallyLR implicit $s0
96 successors: %bb.1, %bb.2
99 %5:gpr32common = COPY $w0
101 %6:gpr32 = SUBSWri %5, 1, 0, implicit-def $nzcv
102 Bcc 1, %bb.2, implicit $nzcv
108 ; Make sure we also handle the case when there are extra predecessors on
110 %3:fpr32 = IMPLICIT_DEF
125 %2:fpr32 = PHI %1, %bb.2, %0, %bb.1, %3, %bb.4
127 RET_ReallyLR implicit $s0
132 tracksRegLiveness: true
134 - { id: 0, class: fpr32, preferred-register: '' }
135 - { id: 1, class: fpr32, preferred-register: '' }
136 - { id: 2, class: fpr32, preferred-register: '' }
137 - { id: 3, class: fpr32, preferred-register: '' }
138 - { id: 4, class: fpr32, preferred-register: '' }
139 - { id: 5, class: gpr32common, preferred-register: '' }
140 - { id: 6, class: gpr32, preferred-register: '' }
141 - { id: 7, class: fpr32, preferred-register: '' }
142 - { id: 8, class: fpr32, preferred-register: '' }
143 - { id: 9, class: fpr32, preferred-register: '' }
144 - { id: 10, class: fpr32, preferred-register: '' }
146 - { reg: '$s1', virtual-reg: '%4' }
147 - { reg: '$w0', virtual-reg: '%5' }
149 ; CHECK-LABEL: name: copy_physreg
151 ; CHECK: liveins: $s1, $w0
152 ; CHECK: [[COPY:%[0-9]+]]:gpr32common = COPY $w0
153 ; CHECK: [[COPY1:%[0-9]+]]:fpr32 = COPY $s1
154 ; CHECK: [[SUBSWri:%[0-9]+]]:gpr32 = SUBSWri [[COPY]], 1, 0, implicit-def $nzcv
155 ; CHECK: [[DEF:%[0-9]+]]:fpr32 = IMPLICIT_DEF implicit-def $s1
156 ; CHECK: [[COPY2:%[0-9]+]]:fpr32 = COPY $s1
157 ; CHECK: [[DEF1:%[0-9]+]]:fpr32 = IMPLICIT_DEF implicit-def $s1
158 ; CHECK: [[COPY3:%[0-9]+]]:fpr32 = COPY $s1
159 ; CHECK: [[FCSELSrrr:%[0-9]+]]:fpr32 = FCSELSrrr [[COPY2]], [[COPY3]], 1, implicit $nzcv
160 ; CHECK: $s0 = COPY [[FCSELSrrr]]
161 ; CHECK: RET_ReallyLR implicit $s0
163 successors: %bb.1, %bb.2
166 %5:gpr32common = COPY $w0
168 %6:gpr32 = SUBSWri %5, 1, 0, implicit-def $nzcv
169 Bcc 1, %bb.2, implicit $nzcv
175 %9:fpr32 = IMPLICIT_DEF implicit-def $s1
182 %10:fpr32 = IMPLICIT_DEF implicit-def $s1
186 %2:fpr32 = PHI %1, %bb.2, %0, %bb.1
188 RET_ReallyLR implicit $s0
192 name: same_def_different_operand
193 tracksRegLiveness: true
195 - { id: 0, class: fpr32, preferred-register: '' }
196 - { id: 1, class: fpr32, preferred-register: '' }
197 - { id: 2, class: gpr64common, preferred-register: '' }
198 - { id: 3, class: fpr32, preferred-register: '' }
199 - { id: 4, class: fpr32, preferred-register: '' }
200 - { id: 5, class: gpr32common, preferred-register: '' }
201 - { id: 6, class: gpr32, preferred-register: '' }
202 - { id: 7, class: fpr32, preferred-register: '' }
203 - { id: 8, class: fpr32, preferred-register: '' }
204 - { id: 9, class: gpr64common, preferred-register: '' }
205 - { id: 10, class: gpr64, preferred-register: '' }
206 - { id: 11, class: gpr64common, preferred-register: '' }
208 - { reg: '$s1', virtual-reg: '%4' }
209 - { reg: '$w0', virtual-reg: '%5' }
210 - { reg: '$x2', virtual-reg: '%9' }
212 ; CHECK-LABEL: name: same_def_different_operand
214 ; CHECK: liveins: $s1, $w0, $x2
215 ; CHECK: [[COPY:%[0-9]+]]:gpr64common = COPY $x0
216 ; CHECK: early-clobber %11:gpr64common, %10:gpr64 = LDRXpre [[COPY]], 16
217 ; CHECK: [[COPY1:%[0-9]+]]:gpr32common = COPY $w0
218 ; CHECK: [[COPY2:%[0-9]+]]:fpr32 = COPY $s1
219 ; CHECK: [[SUBSWri:%[0-9]+]]:gpr32 = SUBSWri [[COPY1]], 1, 0, implicit-def $nzcv
220 ; CHECK: [[CSELXr:%[0-9]+]]:gpr64common = CSELXr %11, %10, 1, implicit $nzcv
221 ; CHECK: $x2 = COPY [[CSELXr]]
222 ; CHECK: RET_ReallyLR implicit $x2
224 successors: %bb.1, %bb.2
225 liveins: $s1, $w0, $x2
227 %9:gpr64common = COPY $x0
228 early-clobber %11:gpr64common, %10:gpr64 = LDRXpre %9:gpr64common, 16
230 %5:gpr32common = COPY $w0
232 %6:gpr32 = SUBSWri %5, 1, 0, implicit-def $nzcv
233 Bcc 1, %bb.2, implicit $nzcv
247 %2:gpr64common = PHI %11, %bb.2, %10, %bb.1
249 RET_ReallyLR implicit $x2