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**)
17 # CHECK-LABEL: name: f1
22 exposesReturnsTwice: false
24 regBankSelected: false
26 tracksRegLiveness: true
29 - { reg: '$a1', virtual-reg: '' }
31 isFrameAddressTaken: false
32 isReturnAddressTaken: false
42 hasOpaqueSPAdjustment: false
44 hasMustTailInVarArgFunc: false
49 - { id: 0, name: '', type: spill-slot, offset: -4, size: 4, alignment: 4,
50 stack-id: default, callee-saved-register: '$ra', callee-saved-restored: true,
51 debug-info-variable: '', debug-info-expression: '', debug-info-location: '' }
52 - { id: 1, name: '', type: spill-slot, offset: -8, size: 4, alignment: 4,
53 stack-id: default, callee-saved-register: '$s0', callee-saved-restored: true,
54 debug-info-variable: '', debug-info-expression: '', debug-info-location: '' }
58 liveins: $a1, $ra, $s0
61 CFI_INSTRUCTION def_cfa_offset 24
62 SW killed $ra, $sp, 20 :: (store (s32) into %stack.0)
63 SW killed $s0, $sp, 16 :: (store (s32) into %stack.1)
64 CFI_INSTRUCTION offset $ra_64, -4
65 CFI_INSTRUCTION offset $s0_64, -8
67 JAL @f, csr_o32, implicit-def dead $ra, implicit-def $sp, implicit-def dead $v0
68 $v0 = MOVE16_MM killed $s0
69 $s0 = LW $sp, 16 :: (load (s32) from %stack.1)
70 $ra = LW $sp, 20 :: (load (s32) from %stack.0)
72 PseudoReturn undef $ra, implicit killed $v0
76 # CHECK-LABEL: name: f2
81 exposesReturnsTwice: false
83 regBankSelected: false
85 tracksRegLiveness: true
88 - { reg: '$a1', virtual-reg: '' }
90 isFrameAddressTaken: false
91 isReturnAddressTaken: false
101 hasOpaqueSPAdjustment: false
103 hasMustTailInVarArgFunc: false
108 - { id: 0, name: '', type: spill-slot, offset: -4, size: 4, alignment: 4,
109 stack-id: default, callee-saved-register: '$ra', callee-saved-restored: true,
110 debug-info-variable: '', debug-info-expression: '', debug-info-location: '' }
111 - { id: 1, name: '', type: spill-slot, offset: -8, size: 4, alignment: 4,
112 stack-id: default, callee-saved-register: '$s0', callee-saved-restored: true,
113 debug-info-variable: '', debug-info-expression: '', debug-info-location: '' }
117 liveins: $a1, $ra, $s0
120 CFI_INSTRUCTION def_cfa_offset 24
121 SW_MM killed $ra, $sp, 20 :: (store (s32) into %stack.0)
122 SW_MM killed $s0, $sp, 16 :: (store (s32) into %stack.1)
123 CFI_INSTRUCTION offset $ra_64, -4
124 CFI_INSTRUCTION offset $s0_64, -8
126 JAL @f, csr_o32, implicit-def dead $ra, implicit-def $sp, implicit-def dead $v0
127 $v0 = MOVE16_MM killed $s0
128 $s0 = LW_MM $sp, 16 :: (load (s32) from %stack.1)
129 $ra = LW_MM $sp, 20 :: (load (s32) from %stack.0)
131 PseudoReturn undef $ra, implicit killed $v0
135 # CHECK-LABEL: name: f3
140 exposesReturnsTwice: false
142 regBankSelected: false
144 tracksRegLiveness: true
147 - { reg: '$a1', virtual-reg: '' }
149 isFrameAddressTaken: false
150 isReturnAddressTaken: false
160 hasOpaqueSPAdjustment: false
162 hasMustTailInVarArgFunc: false
167 - { id: 0, name: '', type: spill-slot, offset: -4, size: 4, alignment: 4,
168 stack-id: default, callee-saved-register: '$ra', callee-saved-restored: true,
169 debug-info-variable: '', debug-info-expression: '', debug-info-location: '' }
170 - { id: 1, name: '', type: spill-slot, offset: -8, size: 4, alignment: 4,
171 stack-id: default, callee-saved-register: '$s0', callee-saved-restored: true,
172 debug-info-variable: '', debug-info-expression: '', debug-info-location: '' }
176 liveins: $a1, $ra, $s0
179 CFI_INSTRUCTION def_cfa_offset 24
180 SW_MM killed $ra, $sp, 20 :: (store (s32) into %stack.0)
181 SW killed $s0, $sp, 16 :: (store (s32) into %stack.1)
182 CFI_INSTRUCTION offset $ra_64, -4
183 CFI_INSTRUCTION offset $s0_64, -8
185 JAL @f, csr_o32, implicit-def dead $ra, implicit-def $sp, implicit-def dead $v0
186 $v0 = MOVE16_MM killed $s0
187 $s0 = LW_MM $sp, 16 :: (load (s32) from %stack.1)
188 $ra = LW $sp, 20 :: (load (s32) from %stack.0)
190 PseudoReturn undef $ra, implicit killed $v0
194 # CHECK-LABEL: name: f4
199 exposesReturnsTwice: false
201 regBankSelected: false
203 tracksRegLiveness: true
206 - { reg: '$a1', virtual-reg: '' }
208 isFrameAddressTaken: false
209 isReturnAddressTaken: false
219 hasOpaqueSPAdjustment: false
221 hasMustTailInVarArgFunc: false
226 - { id: 0, name: '', type: spill-slot, offset: -4, size: 4, alignment: 4,
227 stack-id: default, callee-saved-register: '$ra', callee-saved-restored: true,
228 debug-info-variable: '', debug-info-expression: '', debug-info-location: '' }
229 - { id: 1, name: '', type: spill-slot, offset: -8, size: 4, alignment: 4,
230 stack-id: default, callee-saved-register: '$s0', callee-saved-restored: true,
231 debug-info-variable: '', debug-info-expression: '', debug-info-location: '' }
235 liveins: $a1, $ra, $s0
238 CFI_INSTRUCTION def_cfa_offset 24
239 SW killed $ra, $sp, 20 :: (store (s32) into %stack.0)
240 SW_MM killed $s0, $sp, 16 :: (store (s32) into %stack.1)
241 CFI_INSTRUCTION offset $ra_64, -4
242 CFI_INSTRUCTION offset $s0_64, -8
244 JAL @f, csr_o32, implicit-def dead $ra, implicit-def $sp, implicit-def dead $v0
245 $v0 = MOVE16_MM killed $s0
246 $s0 = LW $sp, 16 :: (load (s32) from %stack.1)
247 $ra = LW_MM $sp, 20 :: (load (s32) from %stack.0)
249 PseudoReturn undef $ra, implicit killed $v0