1 # RUN: llc -mtriple=thumbv7-- -run-pass=prologepilog \
2 # RUN: -run-pass=machine-outliner %s -o - | FileCheck %s
5 define void @CheckAddrModeT2_i12() { ret void }
6 define void @CheckAddrModeT2_i8() { ret void }
7 define void @CheckAddrModeT2_i8s4() { ret void }
8 define void @CheckAddrModeT2_ldrex() { ret void }
9 define void @CheckAddrModeT1_s() { ret void }
10 define void @foo() { ret void }
15 name: CheckAddrModeT2_i12
16 tracksRegLiveness: true
21 ;CHECK-LABEL: name: CheckAddrModeT2_i12
22 ;CHECK: $r0 = tMOVr killed $r1, 14 /* CC::al */, $noreg
23 ;CHECK-NEXT: tBL 14 /* CC::al */, $noreg, @OUTLINED_FUNCTION_[[I12:[0-9]+]]
24 ;CHECK-NEXT: $r0 = t2LDRi12 $sp, 4088, 14 /* CC::al */, $noreg
25 $r0 = tMOVr killed $r1, 14, $noreg
26 tBL 14, $noreg, @foo, implicit-def dead $lr, implicit $sp
27 $r0 = t2LDRi12 $sp, 0, 14, $noreg
28 $r0 = t2LDRi12 $sp, 4, 14, $noreg
29 $r0 = t2LDRi12 $sp, 4086, 14, $noreg
30 $r0 = t2LDRi12 $sp, 4088, 14, $noreg
31 tBL 14, $noreg, @foo, implicit-def dead $lr, implicit $sp
32 $r0 = t2LDRi12 $sp, 0, 14, $noreg
33 $r0 = t2LDRi12 $sp, 4, 14, $noreg
34 $r0 = t2LDRi12 $sp, 4086, 14, $noreg
35 $r0 = t2LDRi12 $sp, 4088, 14, $noreg
36 tBL 14, $noreg, @foo, implicit-def dead $lr, implicit $sp
37 $r0 = t2LDRi12 $sp, 0, 14, $noreg
38 $r0 = t2LDRi12 $sp, 4, 14, $noreg
39 $r0 = t2LDRi12 $sp, 4086, 14, $noreg
40 $r0 = t2LDRi12 $sp, 4088, 14, $noreg
45 name: CheckAddrModeT2_i8
46 tracksRegLiveness: true
51 ;CHECK-LABEL: name: CheckAddrModeT2_i8
52 ;CHECK: $r0 = tMOVr $r1, 14 /* CC::al */, $noreg
53 ;CHECK-NEXT: tBL 14 /* CC::al */, $noreg, @OUTLINED_FUNCTION_[[I8:[0-9]+]]
54 ;CHECK-NEXT: t2STRHT $r0, $sp, 248, 14 /* CC::al */, $noreg
55 $r0 = tMOVr $r1, 14, $noreg
56 tBL 14, $noreg, @foo, implicit-def dead $lr, implicit $sp
57 t2STRHT $r0, $sp, 0, 14, $noreg
58 t2STRHT $r0, $sp, 4, 14, $noreg
59 t2STRHT $r0, $sp, 247, 14, $noreg
60 t2STRHT $r0, $sp, 248, 14, $noreg
61 tBL 14, $noreg, @foo, implicit-def dead $lr, implicit $sp
62 t2STRHT $r0, $sp, 0, 14, $noreg
63 t2STRHT $r0, $sp, 4, 14, $noreg
64 t2STRHT $r0, $sp, 247, 14, $noreg
65 t2STRHT $r0, $sp, 248, 14, $noreg
66 tBL 14, $noreg, @foo, implicit-def dead $lr, implicit $sp
67 t2STRHT $r0, $sp, 0, 14, $noreg
68 t2STRHT $r0, $sp, 4, 14, $noreg
69 t2STRHT $r0, $sp, 247, 14, $noreg
70 t2STRHT $r0, $sp, 248, 14, $noreg
75 name: CheckAddrModeT2_i8s4
76 tracksRegLiveness: true
81 ;CHECK-LABEL: name: CheckAddrModeT2_i8s4
82 ;CHECK: $r0 = tMOVr $r1, 14 /* CC::al */, $noreg
83 ;CHECK-NEXT: tBL 14 /* CC::al */, $noreg, @OUTLINED_FUNCTION_[[I8S4:[0-9]+]]
84 ;CHECK-NEXT: t2STRDi8 $r0, $r1, $sp, 1020, 14 /* CC::al */, $noreg
85 $r0 = tMOVr $r1, 14, $noreg
86 tBL 14, $noreg, @foo, implicit-def dead $lr, implicit $sp
87 t2STRDi8 $r0, $r1, $sp, 0, 14, $noreg
88 t2STRDi8 $r0, $r1, $sp, 8, 14, $noreg
89 t2STRDi8 $r0, $r1, $sp, 1012, 14, $noreg
90 t2STRDi8 $r0, $r1, $sp, 1020, 14, $noreg
91 tBL 14, $noreg, @foo, implicit-def dead $lr, implicit $sp
92 t2STRDi8 $r0, $r1, $sp, 0, 14, $noreg
93 t2STRDi8 $r0, $r1, $sp, 8, 14, $noreg
94 t2STRDi8 $r0, $r1, $sp, 1012, 14, $noreg
95 t2STRDi8 $r0, $r1, $sp, 1020, 14, $noreg
96 tBL 14, $noreg, @foo, implicit-def dead $lr, implicit $sp
97 t2STRDi8 $r0, $r1, $sp, 0, 14, $noreg
98 t2STRDi8 $r0, $r1, $sp, 8, 14, $noreg
99 t2STRDi8 $r0, $r1, $sp, 1012, 14, $noreg
100 t2STRDi8 $r0, $r1, $sp, 1020, 14, $noreg
105 name: CheckAddrModeT2_ldrex
106 tracksRegLiveness: true
111 ;CHECK-LABEL: name: CheckAddrModeT2_ldrex
112 ;CHECK: $r0 = tMOVr $r1, 14 /* CC::al */, $noreg
113 ;CHECK-NEXT: tBL 14 /* CC::al */, $noreg, @OUTLINED_FUNCTION_[[LDREX:[0-9]+]]
114 ;CHECK-NEXT: $r1 = t2LDREX $sp, 254, 14 /* CC::al */, $noreg
115 $r0 = tMOVr $r1, 14, $noreg
116 tBL 14, $noreg, @foo, implicit-def dead $lr, implicit $sp
117 $r1 = t2LDREX $sp, 0, 14, $noreg
118 $r1 = t2LDREX $sp, 8, 14, $noreg
119 $r1 = t2LDREX $sp, 253, 14, $noreg
120 $r1 = t2LDREX $sp, 254, 14, $noreg
121 tBL 14, $noreg, @foo, implicit-def dead $lr, implicit $sp
122 $r1 = t2LDREX $sp, 0, 14, $noreg
123 $r1 = t2LDREX $sp, 8, 14, $noreg
124 $r1 = t2LDREX $sp, 253, 14, $noreg
125 $r1 = t2LDREX $sp, 254, 14, $noreg
126 tBL 14, $noreg, @foo, implicit-def dead $lr, implicit $sp
127 $r1 = t2LDREX $sp, 0, 14, $noreg
128 $r1 = t2LDREX $sp, 8, 14, $noreg
129 $r1 = t2LDREX $sp, 253, 14, $noreg
130 $r1 = t2LDREX $sp, 254, 14, $noreg
131 tBL 14, $noreg, @foo, implicit-def dead $lr, implicit $sp
132 $r1 = t2LDREX $sp, 0, 14, $noreg
133 $r1 = t2LDREX $sp, 8, 14, $noreg
134 $r1 = t2LDREX $sp, 253, 14, $noreg
135 $r1 = t2LDREX $sp, 254, 14, $noreg
140 name: CheckAddrModeT1_s
141 tracksRegLiveness: true
146 ;CHECK-LABEL: name: CheckAddrModeT1_s
147 ;CHECK: $r0 = tMOVr $r1, 14 /* CC::al */, $noreg
148 ;CHECK-NEXT: tBL 14 /* CC::al */, $noreg, @OUTLINED_FUNCTION_[[T1_S:[0-9]+]]
149 ;CHECK-NEXT: tSTRspi $r0, $sp, 254, 14 /* CC::al */, $noreg
150 $r0 = tMOVr $r1, 14, $noreg
151 tBL 14, $noreg, @foo, implicit-def dead $lr, implicit $sp
152 tSTRspi $r0, $sp, 0, 14, $noreg
153 tSTRspi $r0, $sp, 4, 14, $noreg
154 tSTRspi $r0, $sp, 253, 14, $noreg
155 tSTRspi $r0, $sp, 254, 14, $noreg
156 tBL 14, $noreg, @foo, implicit-def dead $lr, implicit $sp
157 tSTRspi $r0, $sp, 0, 14, $noreg
158 tSTRspi $r0, $sp, 4, 14, $noreg
159 tSTRspi $r0, $sp, 253, 14, $noreg
160 tSTRspi $r0, $sp, 254, 14, $noreg
161 tBL 14, $noreg, @foo, implicit-def dead $lr, implicit $sp
162 tSTRspi $r0, $sp, 0, 14, $noreg
163 tSTRspi $r0, $sp, 4, 14, $noreg
164 tSTRspi $r0, $sp, 253, 14, $noreg
165 tSTRspi $r0, $sp, 254, 14, $noreg
166 tBL 14, $noreg, @foo, implicit-def dead $lr, implicit $sp
167 tSTRspi $r0, $sp, 0, 14, $noreg
168 tSTRspi $r0, $sp, 4, 14, $noreg
169 tSTRspi $r0, $sp, 253, 14, $noreg
170 tSTRspi $r0, $sp, 254, 14, $noreg
176 tracksRegLiveness: true
183 ;CHECK: name: OUTLINED_FUNCTION_[[LDREX]]
184 ;CHECK: early-clobber $sp = frame-setup t2STR_PRE killed $lr, $sp, -8, 14 /* CC::al */, $noreg
185 ;CHECK-NEXT: frame-setup CFI_INSTRUCTION def_cfa_offset 8
186 ;CHECK-NEXT: frame-setup CFI_INSTRUCTION offset $lr, -8
187 ;CHECK-NEXT: tBL 14 /* CC::al */, $noreg, @foo, implicit-def dead $lr, implicit $sp
188 ;CHECK-NEXT: $r1 = t2LDREX $sp, 2, 14 /* CC::al */, $noreg
189 ;CHECK-NEXT: $r1 = t2LDREX $sp, 10, 14 /* CC::al */, $noreg
190 ;CHECK-NEXT: $r1 = t2LDREX $sp, 255, 14 /* CC::al */, $noreg
191 ;CHECK-NEXT: $lr, $sp = frame-destroy t2LDR_POST $sp, 8, 14 /* CC::al */, $noreg
193 ;CHECK: name: OUTLINED_FUNCTION_[[I8]]
194 ;CHECK: early-clobber $sp = frame-setup t2STR_PRE killed $lr, $sp, -8, 14 /* CC::al */, $noreg
195 ;CHECK-NEXT: frame-setup CFI_INSTRUCTION def_cfa_offset 8
196 ;CHECK-NEXT: frame-setup CFI_INSTRUCTION offset $lr, -8
197 ;CHECK-NEXT: tBL 14 /* CC::al */, $noreg, @foo, implicit-def dead $lr, implicit $sp
198 ;CHECK-NEXT: t2STRHT $r0, $sp, 8, 14 /* CC::al */, $noreg
199 ;CHECK-NEXT: t2STRHT $r0, $sp, 12, 14 /* CC::al */, $noreg
200 ;CHECK-NEXT: t2STRHT $r0, $sp, 255, 14 /* CC::al */, $noreg
201 ;CHECK-NEXT: $lr, $sp = frame-destroy t2LDR_POST $sp, 8, 14 /* CC::al */, $noreg
203 ;CHECK: name: OUTLINED_FUNCTION_[[I8S4]]
204 ;CHECK: early-clobber $sp = frame-setup t2STR_PRE killed $lr, $sp, -8, 14 /* CC::al */, $noreg
205 ;CHECK-NEXT: frame-setup CFI_INSTRUCTION def_cfa_offset 8
206 ;CHECK-NEXT: frame-setup CFI_INSTRUCTION offset $lr, -8
207 ;CHECK-NEXT: tBL 14 /* CC::al */, $noreg, @foo, implicit-def dead $lr, implicit $sp
208 ;CHECK-NEXT: t2STRDi8 $r0, $r1, $sp, 8, 14 /* CC::al */, $noreg
209 ;CHECK-NEXT: t2STRDi8 $r0, $r1, $sp, 16, 14 /* CC::al */, $noreg
210 ;CHECK-NEXT: t2STRDi8 $r0, $r1, $sp, 1020, 14 /* CC::al */, $noreg
211 ;CHECK-NEXT: $lr, $sp = frame-destroy t2LDR_POST $sp, 8, 14 /* CC::al */, $noreg
213 ;CHECK: name: OUTLINED_FUNCTION_[[I12]]
214 ;CHECK: early-clobber $sp = frame-setup t2STR_PRE killed $lr, $sp, -8, 14 /* CC::al */, $noreg
215 ;CHECK-NEXT: frame-setup CFI_INSTRUCTION def_cfa_offset 8
216 ;CHECK-NEXT: frame-setup CFI_INSTRUCTION offset $lr, -8
217 ;CHECK-NEXT: tBL 14 /* CC::al */, $noreg, @foo, implicit-def dead $lr, implicit $sp
218 ;CHECK-NEXT: $r0 = t2LDRi12 $sp, 8, 14 /* CC::al */, $noreg
219 ;CHECK-NEXT: $r0 = t2LDRi12 $sp, 12, 14 /* CC::al */, $noreg
220 ;CHECK-NEXT: $r0 = t2LDRi12 $sp, 4094, 14 /* CC::al */, $noreg
221 ;CHECK-NEXT: $lr, $sp = frame-destroy t2LDR_POST $sp, 8, 14 /* CC::al */, $noreg
223 ;CHECK: name: OUTLINED_FUNCTION_[[T1_S]]
224 ;CHECK: early-clobber $sp = frame-setup t2STR_PRE killed $lr, $sp, -8, 14 /* CC::al */, $noreg
225 ;CHECK-NEXT: frame-setup CFI_INSTRUCTION def_cfa_offset 8
226 ;CHECK-NEXT: frame-setup CFI_INSTRUCTION offset $lr, -8
227 ;CHECK-NEXT: tBL 14 /* CC::al */, $noreg, @foo, implicit-def dead $lr, implicit $sp
228 ;CHECK-NEXT: tSTRspi $r0, $sp, 2, 14 /* CC::al */, $noreg
229 ;CHECK-NEXT: tSTRspi $r0, $sp, 6, 14 /* CC::al */, $noreg
230 ;CHECK-NEXT: tSTRspi $r0, $sp, 255, 14 /* CC::al */, $noreg
231 ;CHECK-NEXT: $lr, $sp = frame-destroy t2LDR_POST $sp, 8, 14 /* CC::al */, $noreg