1 # RUN: llc -mtriple=armv7-- -run-pass=prologepilog -run-pass=machine-outliner \
2 # RUN: -verify-machineinstrs %s -o - | FileCheck %s
5 define void @CheckAddrMode_i12() { ret void }
6 define void @CheckAddrMode3() { ret void }
7 define void @CheckAddrMode5() { ret void }
8 define void @CheckAddrMode5FP16() { ret void }
9 define void @foo() { ret void }
14 name: CheckAddrMode_i12
15 tracksRegLiveness: true
19 ; CHECK-LABEL: name: CheckAddrMode_i12
20 ; CHECK: $r1 = MOVr killed $r0, 14 /* CC::al */, $noreg, $noreg
21 ; CHECK-NEXT: BL @OUTLINED_FUNCTION_[[I12:[0-9]+]]
22 ; CHECK-NEXT: $r6 = LDRi12 $sp, 4088, 14 /* CC::al */, $noreg
23 $r1 = MOVr killed $r0, 14, $noreg, $noreg
24 BL @foo, implicit-def dead $lr, implicit $sp
25 $r1 = LDRi12 $sp, 0, 14, $noreg
26 $r2 = LDRi12 $sp, 8, 14, $noreg
27 $r5 = LDRi12 $sp, 4086, 14, $noreg
28 $r6 = LDRi12 $sp, 4088, 14, $noreg
29 BL @foo, implicit-def dead $lr, implicit $sp
30 $r1 = LDRi12 $sp, 0, 14, $noreg
31 $r2 = LDRi12 $sp, 8, 14, $noreg
32 $r5 = LDRi12 $sp, 4086, 14, $noreg
33 $r6 = LDRi12 $sp, 4088, 14, $noreg
34 BL @foo, implicit-def dead $lr, implicit $sp
35 $r1 = LDRi12 $sp, 0, 14, $noreg
36 $r2 = LDRi12 $sp, 8, 14, $noreg
37 $r5 = LDRi12 $sp, 4086, 14, $noreg
38 $r6 = LDRi12 $sp, 4088, 14, $noreg
44 tracksRegLiveness: true
48 ; CHECK-LABEL: name: CheckAddrMode3
49 ; CHECK: $r0 = MOVr killed $r1, 14 /* CC::al */, $noreg, $noreg
50 ; CHECK-NEXT: BL @OUTLINED_FUNCTION_[[I3:[0-9]+]]
51 ; CHECK-NEXT: $r6 = LDRSH $sp, $noreg, 248, 14 /* CC::al */, $noreg
52 $r0 = MOVr killed $r1, 14, $noreg, $noreg
53 BL @foo, implicit-def dead $lr, implicit $sp
54 $r1 = LDRSH $sp, $noreg, 0, 14, $noreg
55 $r2 = LDRSH $sp, $noreg, 8, 14, $noreg
56 $r5 = LDRSH $sp, $noreg, 247, 14, $noreg
57 $r6 = LDRSH $sp, $noreg, 248, 14, $noreg
58 BL @foo, implicit-def dead $lr, implicit $sp
59 $r1 = LDRSH $sp, $noreg, 0, 14, $noreg
60 $r2 = LDRSH $sp, $noreg, 8, 14, $noreg
61 $r5 = LDRSH $sp, $noreg, 247, 14, $noreg
62 $r6 = LDRSH $sp, $noreg, 248, 14, $noreg
63 BL @foo, implicit-def dead $lr, implicit $sp
64 $r1 = LDRSH $sp, $noreg, 0, 14, $noreg
65 $r2 = LDRSH $sp, $noreg, 8, 14, $noreg
66 $r5 = LDRSH $sp, $noreg, 247, 14, $noreg
67 $r6 = LDRSH $sp, $noreg, 248, 14, $noreg
73 tracksRegLiveness: true
77 ; CHECK-LABEL: name: CheckAddrMode5
78 ; CHECK: $r0 = MOVr killed $r2, 14 /* CC::al */, $noreg, $noreg
79 ; CHECK-NEXT: BL @OUTLINED_FUNCTION_[[I5:[0-9]+]]
80 ; CHECK-NEXT: $d5 = VLDRD $sp, 254, 14 /* CC::al */, $noreg
81 $r0 = MOVr killed $r2, 14, $noreg, $noreg
82 BL @foo, implicit-def dead $lr, implicit $sp
83 $d0 = VLDRD $sp, 0, 14, $noreg
84 $d1 = VLDRD $sp, 8, 14, $noreg
85 $d4 = VLDRD $sp, 253, 14, $noreg
86 $d5 = VLDRD $sp, 254, 14, $noreg
87 BL @foo, implicit-def dead $lr, implicit $sp
88 $d0 = VLDRD $sp, 0, 14, $noreg
89 $d1 = VLDRD $sp, 8, 14, $noreg
90 $d4 = VLDRD $sp, 253, 14, $noreg
91 $d5 = VLDRD $sp, 254, 14, $noreg
92 BL @foo, implicit-def dead $lr, implicit $sp
93 $d0 = VLDRD $sp, 0, 14, $noreg
94 $d1 = VLDRD $sp, 8, 14, $noreg
95 $d4 = VLDRD $sp, 253, 14, $noreg
96 $d5 = VLDRD $sp, 254, 14, $noreg
97 BL @foo, implicit-def dead $lr, implicit $sp
98 $d0 = VLDRD $sp, 0, 14, $noreg
99 $d1 = VLDRD $sp, 8, 14, $noreg
100 $d4 = VLDRD $sp, 253, 14, $noreg
101 $d5 = VLDRD $sp, 254, 14, $noreg
106 name: CheckAddrMode5FP16
107 tracksRegLiveness: true
111 ; CHECK-LABEL: name: CheckAddrMode5FP16
112 ; CHECK: $r0 = MOVr killed $r3, 14 /* CC::al */, $noreg, $noreg
113 ; CHECK-NEXT: BL @OUTLINED_FUNCTION_[[I5FP16:[0-9]+]]
114 ; CHECK-NEXT: $s6 = VLDRH $sp, 252, 14, $noreg
115 $r0 = MOVr killed $r3, 14, $noreg, $noreg
116 BL @foo, implicit-def dead $lr, implicit $sp
117 $s1 = VLDRH $sp, 0, 14, $noreg
118 $s2 = VLDRH $sp, 8, 14, $noreg
119 $s5 = VLDRH $sp, 240, 14, $noreg
120 $s6 = VLDRH $sp, 252, 14, $noreg
121 BL @foo, implicit-def dead $lr, implicit $sp
122 $s1 = VLDRH $sp, 0, 14, $noreg
123 $s2 = VLDRH $sp, 8, 14, $noreg
124 $s5 = VLDRH $sp, 240, 14, $noreg
125 $s6 = VLDRH $sp, 252, 14, $noreg
126 BL @foo, implicit-def dead $lr, implicit $sp
127 $s1 = VLDRH $sp, 0, 14, $noreg
128 $s2 = VLDRH $sp, 8, 14, $noreg
129 $s5 = VLDRH $sp, 240, 14, $noreg
130 $s6 = VLDRH $sp, 252, 14, $noreg
131 BL @foo, implicit-def dead $lr, implicit $sp
132 $s1 = VLDRH $sp, 0, 14, $noreg
133 $s2 = VLDRH $sp, 8, 14, $noreg
134 $s5 = VLDRH $sp, 240, 14, $noreg
135 $s6 = VLDRH $sp, 252, 14, $noreg
141 tracksRegLiveness: true
148 ;CHECK: name: OUTLINED_FUNCTION_[[I5]]
149 ;CHECK: early-clobber $sp = frame-setup STR_PRE_IMM killed $lr, $sp, -8, 14 /* CC::al */, $noreg
150 ;CHECK-NEXT: frame-setup CFI_INSTRUCTION def_cfa_offset 8
151 ;CHECK-NEXT: frame-setup CFI_INSTRUCTION offset $lr, -8
152 ;CHECK-NEXT: BL @foo, implicit-def dead $lr, implicit $sp
153 ;CHECK-NEXT: $d0 = VLDRD $sp, 2, 14 /* CC::al */, $noreg
154 ;CHECK-NEXT: $d1 = VLDRD $sp, 10, 14 /* CC::al */, $noreg
155 ;CHECK-NEXT: $d4 = VLDRD $sp, 255, 14 /* CC::al */, $noreg
156 ;CHECK-NEXT: $lr, $sp = frame-destroy LDR_POST_IMM $sp, $noreg, 8, 14 /* CC::al */, $noreg
158 ;CHECK: name: OUTLINED_FUNCTION_[[I5FP16]]
159 ;CHECK: early-clobber $sp = frame-setup STR_PRE_IMM killed $lr, $sp, -8, 14 /* CC::al */, $noreg
160 ;CHECK-NEXT: frame-setup CFI_INSTRUCTION def_cfa_offset 8
161 ;CHECK-NEXT: frame-setup CFI_INSTRUCTION offset $lr, -8
162 ;CHECK-NEXT: BL @foo, implicit-def dead $lr, implicit $sp
163 ;CHECK-NEXT: $s1 = VLDRH $sp, 4, 14, $noreg
164 ;CHECK-NEXT: $s2 = VLDRH $sp, 12, 14, $noreg
165 ;CHECK-NEXT: $s5 = VLDRH $sp, 244, 14, $noreg
166 ;CHECK-NEXT: $lr, $sp = frame-destroy LDR_POST_IMM $sp, $noreg, 8, 14 /* CC::al */, $noreg
168 ;CHECK: name: OUTLINED_FUNCTION_[[I12]]
169 ;CHECK: early-clobber $sp = frame-setup STR_PRE_IMM killed $lr, $sp, -8, 14 /* CC::al */, $noreg
170 ;CHECK-NEXT: frame-setup CFI_INSTRUCTION def_cfa_offset 8
171 ;CHECK-NEXT: frame-setup CFI_INSTRUCTION offset $lr, -8
172 ;CHECK-NEXT: BL @foo, implicit-def dead $lr, implicit $sp
173 ;CHECK-NEXT: $r1 = LDRi12 $sp, 8, 14 /* CC::al */, $noreg
174 ;CHECK-NEXT: $r2 = LDRi12 $sp, 16, 14 /* CC::al */, $noreg
175 ;CHECK-NEXT: $r5 = LDRi12 $sp, 4094, 14 /* CC::al */, $noreg
176 ;CHECK-NEXT: $lr, $sp = frame-destroy LDR_POST_IMM $sp, $noreg, 8, 14 /* CC::al */, $noreg
178 ;CHECK: name: OUTLINED_FUNCTION_[[I3]]
179 ;CHECK: early-clobber $sp = frame-setup STR_PRE_IMM killed $lr, $sp, -8, 14 /* CC::al */, $noreg
180 ;CHECK-NEXT: frame-setup CFI_INSTRUCTION def_cfa_offset 8
181 ;CHECK-NEXT: frame-setup CFI_INSTRUCTION offset $lr, -8
182 ;CHECK-NEXT: BL @foo, implicit-def dead $lr, implicit $sp
183 ;CHECK-NEXT: $r1 = LDRSH $sp, $noreg, 8, 14 /* CC::al */, $noreg
184 ;CHECK-NEXT: $r2 = LDRSH $sp, $noreg, 16, 14 /* CC::al */, $noreg
185 ;CHECK-NEXT: $r5 = LDRSH $sp, $noreg, 255, 14 /* CC::al */, $noreg
186 ;CHECK-NEXT: $lr, $sp = frame-destroy LDR_POST_IMM $sp, $noreg, 8, 14 /* CC::al */, $noreg