1 # RUN: llc -mtriple=mipsel-unknown-linux-gnu -mattr=+micromips -mcpu=mips32r2 \
2 # RUN: -verify-machineinstrs -run-pass micromips-reduce-size \
3 # RUN: %s -o - | FileCheck %s
6 define void @f1(i32* %adr, i32 %val) { ret void }
7 define void @f2(i32* %adr, i32 %val) { ret void }
8 define void @f3(i32* %adr, i32 %val) { ret void }
9 define void @f4(i32* %adr, i32 %val) { ret void }
13 ; Function Attrs: nounwind
14 declare void @llvm.stackprotector(i8*, i8**)
18 # CHECK-LABEL: name: f1
23 exposesReturnsTwice: false
25 regBankSelected: false
27 tracksRegLiveness: true
30 - { reg: '$a0', virtual-reg: '' }
31 - { reg: '$a1', virtual-reg: '' }
33 isFrameAddressTaken: false
34 isReturnAddressTaken: false
44 hasOpaqueSPAdjustment: false
46 hasMustTailInVarArgFunc: false
51 - { id: 0, name: '', type: spill-slot, offset: -4, size: 4, alignment: 4,
52 stack-id: default, callee-saved-register: '$ra', callee-saved-restored: true,
53 debug-info-variable: '', debug-info-expression: '', debug-info-location: '' }
54 - { id: 1, name: '', type: spill-slot, offset: -8, size: 4, alignment: 4,
55 stack-id: default, callee-saved-register: '$s1', callee-saved-restored: true,
56 debug-info-variable: '', debug-info-expression: '', debug-info-location: '' }
57 - { id: 2, name: '', type: spill-slot, offset: -12, size: 4, alignment: 4,
58 stack-id: default, callee-saved-register: '$s0', callee-saved-restored: true,
59 debug-info-variable: '', debug-info-expression: '', debug-info-location: '' }
63 liveins: $a0, $a1, $ra, $s1, $s0
66 CFI_INSTRUCTION def_cfa_offset 32
67 SW killed $ra, $sp, 28 :: (store 4 into %stack.0)
68 SW killed $s1, $sp, 24 :: (store 4 into %stack.1)
69 SW killed $s0, $sp, 20 :: (store 4 into %stack.2)
70 CFI_INSTRUCTION offset $ra_64, -4
71 CFI_INSTRUCTION offset $s1_64, -8
72 CFI_INSTRUCTION offset $s0_64, -12
75 JAL @f, csr_o32, implicit-def dead $ra, implicit-def $sp, implicit-def dead $v0
76 SW16_MM killed renamable $s1, killed renamable $s0, 0 :: (store 4 into %ir.adr)
78 $s0 = LW $sp, 20 :: (load 4 from %stack.2)
79 $s1 = LW $sp, 24 :: (load 4 from %stack.1)
80 $ra = LW $sp, 28 :: (load 4 from %stack.0)
82 PseudoReturn undef $ra, implicit killed $v0
86 # CHECK-LABEL: name: f2
91 exposesReturnsTwice: false
93 regBankSelected: false
95 tracksRegLiveness: true
98 - { reg: '$a0', virtual-reg: '' }
99 - { reg: '$a1', virtual-reg: '' }
101 isFrameAddressTaken: false
102 isReturnAddressTaken: false
112 hasOpaqueSPAdjustment: false
114 hasMustTailInVarArgFunc: false
119 - { id: 0, name: '', type: spill-slot, offset: -4, size: 4, alignment: 4,
120 stack-id: default, callee-saved-register: '$ra', callee-saved-restored: true,
121 debug-info-variable: '', debug-info-expression: '', debug-info-location: '' }
122 - { id: 1, name: '', type: spill-slot, offset: -8, size: 4, alignment: 4,
123 stack-id: default, callee-saved-register: '$s1', callee-saved-restored: true,
124 debug-info-variable: '', debug-info-expression: '', debug-info-location: '' }
125 - { id: 2, name: '', type: spill-slot, offset: -12, size: 4, alignment: 4,
126 stack-id: default, callee-saved-register: '$s0', callee-saved-restored: true,
127 debug-info-variable: '', debug-info-expression: '', debug-info-location: '' }
131 liveins: $a0, $a1, $ra, $s1, $s0
134 CFI_INSTRUCTION def_cfa_offset 32
135 SW killed $ra, $sp, 28 :: (store 4 into %stack.0)
136 SW_MM killed $s1, $sp, 24 :: (store 4 into %stack.1)
137 SW_MM killed $s0, $sp, 20 :: (store 4 into %stack.2)
138 CFI_INSTRUCTION offset $ra_64, -4
139 CFI_INSTRUCTION offset $s1_64, -8
140 CFI_INSTRUCTION offset $s0_64, -12
143 JAL @f, csr_o32, implicit-def dead $ra, implicit-def $sp, implicit-def dead $v0
144 SW16_MM killed renamable $s1, killed renamable $s0, 0 :: (store 4 into %ir.adr)
146 $s0 = LW_MM $sp, 20 :: (load 4 from %stack.2)
147 $s1 = LW_MM $sp, 24 :: (load 4 from %stack.1)
148 $ra = LW $sp, 28 :: (load 4 from %stack.0)
150 PseudoReturn undef $ra, implicit killed $v0
154 # CHECK-LABEL: name: f3
159 exposesReturnsTwice: false
161 regBankSelected: false
163 tracksRegLiveness: true
166 - { reg: '$a0', virtual-reg: '' }
167 - { reg: '$a1', virtual-reg: '' }
169 isFrameAddressTaken: false
170 isReturnAddressTaken: false
180 hasOpaqueSPAdjustment: false
182 hasMustTailInVarArgFunc: false
187 - { id: 0, name: '', type: spill-slot, offset: -4, size: 4, alignment: 4,
188 stack-id: default, callee-saved-register: '$ra', callee-saved-restored: true,
189 debug-info-variable: '', debug-info-expression: '', debug-info-location: '' }
190 - { id: 1, name: '', type: spill-slot, offset: -8, size: 4, alignment: 4,
191 stack-id: default, callee-saved-register: '$s1', callee-saved-restored: true,
192 debug-info-variable: '', debug-info-expression: '', debug-info-location: '' }
193 - { id: 2, name: '', type: spill-slot, offset: -12, size: 4, alignment: 4,
194 stack-id: default, callee-saved-register: '$s0', callee-saved-restored: true,
195 debug-info-variable: '', debug-info-expression: '', debug-info-location: '' }
199 liveins: $a0, $a1, $ra, $s1, $s0
202 CFI_INSTRUCTION def_cfa_offset 32
203 SW killed $ra, $sp, 28 :: (store 4 into %stack.0)
204 SW_MM killed $s1, $sp, 24 :: (store 4 into %stack.1)
205 SW killed $s0, $sp, 20 :: (store 4 into %stack.2)
206 CFI_INSTRUCTION offset $ra_64, -4
207 CFI_INSTRUCTION offset $s1_64, -8
208 CFI_INSTRUCTION offset $s0_64, -12
211 JAL @f, csr_o32, implicit-def dead $ra, implicit-def $sp, implicit-def dead $v0
212 SW16_MM killed renamable $s1, killed renamable $s0, 0 :: (store 4 into %ir.adr)
214 $s0 = LW_MM $sp, 20 :: (load 4 from %stack.2)
215 $s1 = LW $sp, 24 :: (load 4 from %stack.1)
216 $ra = LW $sp, 28 :: (load 4 from %stack.0)
218 PseudoReturn undef $ra, implicit killed $v0
222 # CHECK-LABEL: name: f4
227 exposesReturnsTwice: false
229 regBankSelected: false
231 tracksRegLiveness: true
234 - { reg: '$a0', virtual-reg: '' }
235 - { reg: '$a1', virtual-reg: '' }
237 isFrameAddressTaken: false
238 isReturnAddressTaken: false
248 hasOpaqueSPAdjustment: false
250 hasMustTailInVarArgFunc: false
255 - { id: 0, name: '', type: spill-slot, offset: -4, size: 4, alignment: 4,
256 stack-id: default, callee-saved-register: '$ra', callee-saved-restored: true,
257 debug-info-variable: '', debug-info-expression: '', debug-info-location: '' }
258 - { id: 1, name: '', type: spill-slot, offset: -8, size: 4, alignment: 4,
259 stack-id: default, callee-saved-register: '$s1', callee-saved-restored: true,
260 debug-info-variable: '', debug-info-expression: '', debug-info-location: '' }
261 - { id: 2, name: '', type: spill-slot, offset: -12, size: 4, alignment: 4,
262 stack-id: default, callee-saved-register: '$s0', callee-saved-restored: true,
263 debug-info-variable: '', debug-info-expression: '', debug-info-location: '' }
267 liveins: $a0, $a1, $ra, $s1, $s0
270 CFI_INSTRUCTION def_cfa_offset 32
271 SW killed $ra, $sp, 28 :: (store 4 into %stack.0)
272 SW killed $s1, $sp, 24 :: (store 4 into %stack.1)
273 SW_MM killed $s0, $sp, 20 :: (store 4 into %stack.2)
274 CFI_INSTRUCTION offset $ra_64, -4
275 CFI_INSTRUCTION offset $s1_64, -8
276 CFI_INSTRUCTION offset $s0_64, -12
279 JAL @f, csr_o32, implicit-def dead $ra, implicit-def $sp, implicit-def dead $v0
280 SW16_MM killed renamable $s1, killed renamable $s0, 0 :: (store 4 into %ir.adr)
282 $s0 = LW $sp, 20 :: (load 4 from %stack.2)
283 $s1 = LW_MM $sp, 24 :: (load 4 from %stack.1)
284 $ra = LW $sp, 28 :: (load 4 from %stack.0)
286 PseudoReturn undef $ra, implicit killed $v0