ifcvt-cbz.mir
6.93 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
# RUN: llc -mtriple=thumbv7m-none-eabi -run-pass=if-converter -o - %s | FileCheck %s
--- |
define i32 @f1(i32 %x) #0 { ret i32 %x }
define i32 @f2(i32 %x) #0 { ret i32 %x }
define i32 @f3(i32 %x) #0 { ret i32 %x }
declare i32 @fn(i32 %x) #0
attributes #0 = { minsize nounwind optsize }
...
---
name: f1
tracksRegLiveness: true
liveins:
- { reg: '$r0', virtual-reg: '' }
stack:
- { id: 0, name: '', type: spill-slot, offset: -4, size: 4, alignment: 4,
stack-id: default, callee-saved-register: '$lr', callee-saved-restored: true,
debug-info-variable: '', debug-info-expression: '', debug-info-location: '' }
- { id: 1, name: '', type: spill-slot, offset: -8, size: 4, alignment: 4,
stack-id: default, callee-saved-register: '$r7', callee-saved-restored: true,
debug-info-variable: '', debug-info-expression: '', debug-info-location: '' }
body: |
; CHECK-LABEL: name: f1
; CHECK: bb.0:
; CHECK: liveins: $r0, $lr, $r7
; CHECK: t2CMPri killed renamable $r0, 1, 14, $noreg, implicit-def $cpsr
; CHECK: tBX_RET 1, killed $cpsr
; CHECK: $sp = frame-setup t2STMDB_UPD $sp, 14, $noreg, killed $r7, killed $lr
; CHECK: frame-setup CFI_INSTRUCTION def_cfa_offset 8
; CHECK: frame-setup CFI_INSTRUCTION offset $lr, -4
; CHECK: frame-setup CFI_INSTRUCTION offset $r7, -8
; CHECK: $r0 = t2MOVi 0, 14, $noreg, $noreg
; CHECK: tBL 14, $noreg, @fn, csr_aapcs, implicit-def dead $lr, implicit $sp, implicit $r0, implicit-def $sp, implicit-def dead $r0
; CHECK: $sp = t2LDMIA_UPD $sp, 14, $noreg, def $r7, def $lr
; CHECK: tBX_RET 14, $noreg
bb.0:
successors: %bb.1(0x40000000), %bb.2(0x40000000)
liveins: $r0, $lr, $r7
t2CMPri killed renamable $r0, 1, 14, $noreg, implicit-def $cpsr
t2Bcc %bb.2, 1, killed $cpsr
bb.1:
liveins: $r7, $lr
$sp = frame-setup t2STMDB_UPD $sp, 14, $noreg, killed $r7, killed $lr
frame-setup CFI_INSTRUCTION def_cfa_offset 8
frame-setup CFI_INSTRUCTION offset $lr, -4
frame-setup CFI_INSTRUCTION offset $r7, -8
$r0 = t2MOVi 0, 14, $noreg, $noreg
tBL 14, $noreg, @fn, csr_aapcs, implicit-def dead $lr, implicit $sp, implicit $r0, implicit-def $sp, implicit-def dead $r0
$sp = t2LDMIA_UPD $sp, 14, $noreg, def $r7, def $lr
tBX_RET 14, $noreg
bb.2:
liveins: $lr, $r7
tBX_RET 14, $noreg
...
---
name: f2
tracksRegLiveness: true
liveins:
- { reg: '$r0', virtual-reg: '' }
stack:
- { id: 0, name: '', type: spill-slot, offset: -4, size: 4, alignment: 4,
stack-id: default, callee-saved-register: '$lr', callee-saved-restored: true,
debug-info-variable: '', debug-info-expression: '', debug-info-location: '' }
- { id: 1, name: '', type: spill-slot, offset: -8, size: 4, alignment: 4,
stack-id: default, callee-saved-register: '$r7', callee-saved-restored: true,
debug-info-variable: '', debug-info-expression: '', debug-info-location: '' }
body: |
; CHECK-LABEL: name: f2
; CHECK: bb.0:
; CHECK: successors: %bb.1(0x40000000), %bb.2(0x40000000)
; CHECK: liveins: $r0, $lr, $r7
; CHECK: t2CMPri killed renamable $r0, 0, 14, $noreg, implicit-def $cpsr
; CHECK: t2Bcc %bb.2, 1, killed $cpsr
; CHECK: bb.1:
; CHECK: liveins: $r7, $lr
; CHECK: $sp = frame-setup t2STMDB_UPD $sp, 14, $noreg, killed $r7, killed $lr
; CHECK: frame-setup CFI_INSTRUCTION def_cfa_offset 8
; CHECK: frame-setup CFI_INSTRUCTION offset $lr, -4
; CHECK: frame-setup CFI_INSTRUCTION offset $r7, -8
; CHECK: $r0 = t2MOVi 0, 14, $noreg, $noreg
; CHECK: tBL 14, $noreg, @fn, csr_aapcs, implicit-def dead $lr, implicit $sp, implicit $r0, implicit-def $sp, implicit-def dead $r0
; CHECK: $sp = t2LDMIA_UPD $sp, 14, $noreg, def $r7, def $lr
; CHECK: tBX_RET 14, $noreg
; CHECK: bb.2:
; CHECK: liveins: $lr, $r7
; CHECK: tBX_RET 14, $noreg
bb.0:
successors: %bb.1(0x40000000), %bb.2(0x40000000)
liveins: $r0, $lr, $r7
t2CMPri killed renamable $r0, 0, 14, $noreg, implicit-def $cpsr
t2Bcc %bb.2, 1, killed $cpsr
bb.1:
liveins: $r7, $lr
$sp = frame-setup t2STMDB_UPD $sp, 14, $noreg, killed $r7, killed $lr
frame-setup CFI_INSTRUCTION def_cfa_offset 8
frame-setup CFI_INSTRUCTION offset $lr, -4
frame-setup CFI_INSTRUCTION offset $r7, -8
$r0 = t2MOVi 0, 14, $noreg, $noreg
tBL 14, $noreg, @fn, csr_aapcs, implicit-def dead $lr, implicit $sp, implicit $r0, implicit-def $sp, implicit-def dead $r0
$sp = t2LDMIA_UPD $sp, 14, $noreg, def $r7, def $lr
tBX_RET 14, $noreg
bb.2:
liveins: $lr, $r7
tBX_RET 14, $noreg
...
---
name: f3
tracksRegLiveness: true
liveins:
- { reg: '$r0', virtual-reg: '' }
stack:
- { id: 0, name: '', type: spill-slot, offset: -4, size: 4, alignment: 4,
stack-id: default, callee-saved-register: '$lr', callee-saved-restored: true,
debug-info-variable: '', debug-info-expression: '', debug-info-location: '' }
- { id: 1, name: '', type: spill-slot, offset: -8, size: 4, alignment: 4,
stack-id: default, callee-saved-register: '$r7', callee-saved-restored: true,
debug-info-variable: '', debug-info-expression: '', debug-info-location: '' }
body: |
; CHECK-LABEL: name: f3
; CHECK: bb.0:
; CHECK: successors: %bb.1(0x40000000), %bb.2(0x40000000)
; CHECK: liveins: $r0, $lr, $r7
; CHECK: t2CMPri killed renamable $r0, 0, 14, $noreg, implicit-def $cpsr
; CHECK: $r1 = t2MOVi 0, 14, $noreg, $noreg
; CHECK: t2Bcc %bb.2, 1, killed $cpsr
; CHECK: bb.1:
; CHECK: liveins: $r7, $lr
; CHECK: $sp = frame-setup t2STMDB_UPD $sp, 14, $noreg, killed $r7, killed $lr
; CHECK: frame-setup CFI_INSTRUCTION def_cfa_offset 8
; CHECK: frame-setup CFI_INSTRUCTION offset $lr, -4
; CHECK: frame-setup CFI_INSTRUCTION offset $r7, -8
; CHECK: $r0 = t2MOVi 0, 14, $noreg, $noreg
; CHECK: tBL 14, $noreg, @fn, csr_aapcs, implicit-def dead $lr, implicit $sp, implicit $r0, implicit-def $sp, implicit-def dead $r0
; CHECK: $sp = t2LDMIA_UPD $sp, 14, $noreg, def $r7, def $lr
; CHECK: tBX_RET 14, $noreg
; CHECK: bb.2:
; CHECK: liveins: $lr, $r7
; CHECK: tBX_RET 14, $noreg
bb.0:
successors: %bb.1(0x40000000), %bb.2(0x40000000)
liveins: $r0, $lr, $r7
t2CMPri killed renamable $r0, 0, 14, $noreg, implicit-def $cpsr
$r1 = t2MOVi 0, 14, $noreg, $noreg
t2Bcc %bb.2, 1, killed $cpsr
bb.1:
liveins: $r7, $lr
$sp = frame-setup t2STMDB_UPD $sp, 14, $noreg, killed $r7, killed $lr
frame-setup CFI_INSTRUCTION def_cfa_offset 8
frame-setup CFI_INSTRUCTION offset $lr, -4
frame-setup CFI_INSTRUCTION offset $r7, -8
$r0 = t2MOVi 0, 14, $noreg, $noreg
tBL 14, $noreg, @fn, csr_aapcs, implicit-def dead $lr, implicit $sp, implicit $r0, implicit-def $sp, implicit-def dead $r0
$sp = t2LDMIA_UPD $sp, 14, $noreg, def $r7, def $lr
tBX_RET 14, $noreg
bb.2:
liveins: $lr, $r7
tBX_RET 14, $noreg
...