xref: /llvm-project/llvm/test/CodeGen/ARM/codesize-ifcvt.mir (revision 60442f0d442723a487528bdd8b48b24657a025e8)
1# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2# RUN: llc -mtriple=thumbv7 -run-pass=if-converter %s -o - | FileCheck %s --check-prefix=CHECK-V7
3# RUN: llc -mtriple=thumbv8 -run-pass=if-converter %s -o - | FileCheck %s --check-prefix=CHECK-V8
4--- |
5  define void @test_nosize() {
6    %c0 = icmp sgt i64 0, 0
7    br i1 %c0, label %b1, label %b6
8
9  b1:                                               ; preds = %0
10    br i1 undef, label %b3, label %b2
11
12  b2:                                               ; preds = %b1
13    %v0 = tail call i32 @extfunc()
14    br label %b5
15
16  b3:                                               ; preds = %b1
17    %v1 = load i32, ptr undef, align 4
18    %v2 = and i32 %v1, 256
19    br label %b5
20
21  b5:                                               ; preds = %b3, %b2
22    %v3 = phi i32 [ %v2, %b3 ], [ %v0, %b2 ]
23    %c1 = icmp eq i32 %v3, 0
24    br i1 %c1, label %b8, label %b7
25
26  b6:                                               ; preds = %0
27    %1 = tail call i32 @extfunc()
28    ret void
29
30  b7:                                               ; preds = %b5
31    %2 = tail call i32 @extfunc()
32    ret void
33
34  b8:                                               ; preds = %b5
35    ret void
36  }
37
38  ; Function Attrs: optsize
39  define void @test_optsize() #0 {
40    %c0 = icmp sgt i64 0, 0
41    br i1 %c0, label %b1, label %b6
42
43  b1:                                               ; preds = %0
44    br i1 undef, label %b3, label %b2
45
46  b2:                                               ; preds = %b1
47    %v0 = tail call i32 @extfunc()
48    br label %b5
49
50  b3:                                               ; preds = %b1
51    %v1 = load i32, ptr undef, align 4
52    %v2 = and i32 %v1, 256
53    br label %b5
54
55  b5:                                               ; preds = %b3, %b2
56    %v3 = phi i32 [ %v2, %b3 ], [ %v0, %b2 ]
57    %c1 = icmp eq i32 %v3, 0
58    br i1 %c1, label %b8, label %b7
59
60  b6:                                               ; preds = %0
61    %1 = tail call i32 @extfunc()
62    ret void
63
64  b7:                                               ; preds = %b5
65    %2 = tail call i32 @extfunc()
66    ret void
67
68  b8:                                               ; preds = %b5
69    ret void
70  }
71
72  ; Function Attrs: minsize
73  define void @test_minsize() #1 {
74    %c0 = icmp sgt i64 0, 0
75    br i1 %c0, label %b1, label %b6
76
77  b1:                                               ; preds = %0
78    br i1 undef, label %b3, label %b2
79
80  b2:                                               ; preds = %b1
81    %v0 = tail call i32 @extfunc()
82    br label %b5
83
84  b3:                                               ; preds = %b1
85    %v1 = load i32, ptr undef, align 4
86    %v2 = and i32 %v1, 256
87    br label %b5
88
89  b5:                                               ; preds = %b3, %b2
90    %v3 = phi i32 [ %v2, %b3 ], [ %v0, %b2 ]
91    %c1 = icmp eq i32 %v3, 0
92    br i1 %c1, label %b8, label %b7
93
94  b6:                                               ; preds = %0
95    %1 = tail call i32 @extfunc()
96    ret void
97
98  b7:                                               ; preds = %b5
99    %2 = tail call i32 @extfunc()
100    ret void
101
102  b8:                                               ; preds = %b5
103    ret void
104  }
105
106  declare i32 @extfunc()
107
108  ; Function Attrs: nounwind
109  declare void @llvm.stackprotector(ptr, ptr) #2
110
111  attributes #0 = { optsize }
112  attributes #1 = { minsize }
113  attributes #2 = { nounwind }
114
115...
116---
117name:            test_nosize
118alignment:       2
119exposesReturnsTwice: false
120legalized:       false
121regBankSelected: false
122selected:        false
123failedISel:      false
124tracksRegLiveness: true
125hasWinCFI:       false
126registers:       []
127liveins:         []
128frameInfo:
129  isFrameAddressTaken: false
130  isReturnAddressTaken: false
131  hasStackMap:     false
132  hasPatchPoint:   false
133  stackSize:       8
134  offsetAdjustment: 0
135  maxAlignment:    4
136  adjustsStack:    true
137  hasCalls:        true
138  stackProtector:  ''
139  maxCallFrameSize: 0
140  cvBytesOfCalleeSavedRegisters: 0
141  hasOpaqueSPAdjustment: false
142  hasVAStart:      false
143  hasMustTailInVarArgFunc: false
144  localFrameSize:  0
145  savePoint:       ''
146  restorePoint:    ''
147fixedStack:      []
148stack:
149  - { id: 0, name: '', type: spill-slot, offset: -4, size: 4, alignment: 4,
150      stack-id: default, callee-saved-register: '$lr', callee-saved-restored: true,
151      debug-info-variable: '', debug-info-expression: '', debug-info-location: '' }
152  - { id: 1, name: '', type: spill-slot, offset: -8, size: 4, alignment: 4,
153      stack-id: default, callee-saved-register: '$r7', callee-saved-restored: true,
154      debug-info-variable: '', debug-info-expression: '', debug-info-location: '' }
155callSites:       []
156constants:       []
157machineFunctionInfo: {}
158body:             |
159  ; CHECK-V7-LABEL: name: test_nosize
160  ; CHECK-V7: bb.0 (%ir-block.0):
161  ; CHECK-V7:   successors: %bb.1(0x80000000)
162  ; CHECK-V7:   liveins: $lr, $r7
163  ; CHECK-V7:   renamable $r0 = t2MOVi 1, 14 /* CC::al */, $noreg, $noreg
164  ; CHECK-V7:   t2CMPri killed renamable $r0, 0, 14 /* CC::al */, $noreg, implicit-def $cpsr
165  ; CHECK-V7:   tTAILJMPdND @extfunc, 1 /* CC::ne */, killed $cpsr, implicit $sp, implicit $sp
166  ; CHECK-V7: bb.1.b1:
167  ; CHECK-V7:   successors: %bb.3(0x40000000), %bb.2(0x40000000)
168  ; CHECK-V7:   liveins: $r7, $lr
169  ; CHECK-V7:   $sp = frame-setup t2STMDB_UPD $sp, 14 /* CC::al */, $noreg, killed $r7, killed $lr
170  ; CHECK-V7:   frame-setup CFI_INSTRUCTION def_cfa_offset 8
171  ; CHECK-V7:   frame-setup CFI_INSTRUCTION offset $lr, -4
172  ; CHECK-V7:   frame-setup CFI_INSTRUCTION offset $r7, -8
173  ; CHECK-V7:   renamable $r0 = t2MOVi 0, 14 /* CC::al */, $noreg, $noreg
174  ; CHECK-V7:   t2CMPri killed renamable $r0, 0, 14 /* CC::al */, $noreg, implicit-def $cpsr
175  ; CHECK-V7:   t2Bcc %bb.3, 1 /* CC::ne */, killed $cpsr
176  ; CHECK-V7: bb.2.b2:
177  ; CHECK-V7:   successors: %bb.4(0x80000000)
178  ; CHECK-V7:   tBL 14 /* CC::al */, $noreg, @extfunc, csr_aapcs, implicit-def dead $lr, implicit $sp, implicit-def $sp, implicit-def $r0
179  ; CHECK-V7:   t2B %bb.4, 14 /* CC::al */, $noreg
180  ; CHECK-V7: bb.3.b3:
181  ; CHECK-V7:   successors: %bb.4(0x80000000)
182  ; CHECK-V7:   renamable $r0 = t2LDRi12 undef renamable $r0, 0, 14 /* CC::al */, $noreg :: (load (s32) from `ptr undef`)
183  ; CHECK-V7:   renamable $r0 = t2ANDri killed renamable $r0, 256, 14 /* CC::al */, $noreg, $noreg
184  ; CHECK-V7: bb.4.b5:
185  ; CHECK-V7:   successors: %bb.5(0x50000000)
186  ; CHECK-V7:   liveins: $r0
187  ; CHECK-V7:   t2CMPri killed renamable $r0, 0, 14 /* CC::al */, $noreg, implicit-def $cpsr
188  ; CHECK-V7:   $sp = t2LDMIA_UPD $sp, 14 /* CC::al */, $noreg, def $r7, def $lr
189  ; CHECK-V7:   tBX_RET 0 /* CC::eq */, killed $cpsr
190  ; CHECK-V7: bb.5.b7:
191  ; CHECK-V7:   liveins: $lr, $r7
192  ; CHECK-V7:   tTAILJMPdND @extfunc, 14 /* CC::al */, $noreg, implicit $sp, implicit $sp
193  ; CHECK-V8-LABEL: name: test_nosize
194  ; CHECK-V8: bb.0 (%ir-block.0):
195  ; CHECK-V8:   successors: %bb.1(0x80000000)
196  ; CHECK-V8:   liveins: $lr, $r7
197  ; CHECK-V8:   renamable $r0 = t2MOVi 1, 14 /* CC::al */, $noreg, $noreg
198  ; CHECK-V8:   t2CMPri killed renamable $r0, 0, 14 /* CC::al */, $noreg, implicit-def $cpsr
199  ; CHECK-V8:   tTAILJMPdND @extfunc, 1 /* CC::ne */, killed $cpsr, implicit $sp, implicit $sp
200  ; CHECK-V8: bb.1.b1:
201  ; CHECK-V8:   successors: %bb.3(0x40000000), %bb.2(0x40000000)
202  ; CHECK-V8:   liveins: $r7, $lr
203  ; CHECK-V8:   $sp = frame-setup t2STMDB_UPD $sp, 14 /* CC::al */, $noreg, killed $r7, killed $lr
204  ; CHECK-V8:   frame-setup CFI_INSTRUCTION def_cfa_offset 8
205  ; CHECK-V8:   frame-setup CFI_INSTRUCTION offset $lr, -4
206  ; CHECK-V8:   frame-setup CFI_INSTRUCTION offset $r7, -8
207  ; CHECK-V8:   renamable $r0 = t2MOVi 0, 14 /* CC::al */, $noreg, $noreg
208  ; CHECK-V8:   t2CMPri killed renamable $r0, 0, 14 /* CC::al */, $noreg, implicit-def $cpsr
209  ; CHECK-V8:   t2Bcc %bb.3, 1 /* CC::ne */, killed $cpsr
210  ; CHECK-V8: bb.2.b2:
211  ; CHECK-V8:   successors: %bb.4(0x80000000)
212  ; CHECK-V8:   tBL 14 /* CC::al */, $noreg, @extfunc, csr_aapcs, implicit-def dead $lr, implicit $sp, implicit-def $sp, implicit-def $r0
213  ; CHECK-V8:   t2B %bb.4, 14 /* CC::al */, $noreg
214  ; CHECK-V8: bb.3.b3:
215  ; CHECK-V8:   successors: %bb.4(0x80000000)
216  ; CHECK-V8:   renamable $r0 = t2LDRi12 undef renamable $r0, 0, 14 /* CC::al */, $noreg :: (load (s32) from `ptr undef`)
217  ; CHECK-V8:   renamable $r0 = t2ANDri killed renamable $r0, 256, 14 /* CC::al */, $noreg, $noreg
218  ; CHECK-V8: bb.4.b5:
219  ; CHECK-V8:   successors: %bb.5(0x50000000)
220  ; CHECK-V8:   liveins: $r0
221  ; CHECK-V8:   t2CMPri killed renamable $r0, 0, 14 /* CC::al */, $noreg, implicit-def $cpsr
222  ; CHECK-V8:   $sp = t2LDMIA_UPD $sp, 14 /* CC::al */, $noreg, def $r7, def $lr
223  ; CHECK-V8:   tBX_RET 0 /* CC::eq */, killed $cpsr
224  ; CHECK-V8: bb.5.b7:
225  ; CHECK-V8:   liveins: $lr, $r7
226  ; CHECK-V8:   tTAILJMPdND @extfunc, 14 /* CC::al */, $noreg, implicit $sp, implicit $sp
227  bb.0 (%ir-block.0):
228    successors: %bb.1(0x50000000), %bb.6(0x30000000)
229    liveins: $lr, $r7
230
231    renamable $r0 = t2MOVi 1, 14, $noreg, $noreg
232    t2CMPri killed renamable $r0, 0, 14, $noreg, implicit-def $cpsr
233    t2Bcc %bb.6, 1, killed $cpsr
234
235  bb.1.b1:
236    successors: %bb.3(0x40000000), %bb.2(0x40000000)
237    liveins: $r7, $lr
238
239    $sp = frame-setup t2STMDB_UPD $sp, 14, $noreg, killed $r7, killed $lr
240    frame-setup CFI_INSTRUCTION def_cfa_offset 8
241    frame-setup CFI_INSTRUCTION offset $lr, -4
242    frame-setup CFI_INSTRUCTION offset $r7, -8
243    renamable $r0 = t2MOVi 0, 14, $noreg, $noreg
244    t2CMPri killed renamable $r0, 0, 14, $noreg, implicit-def $cpsr
245    t2Bcc %bb.3, 1, killed $cpsr
246
247  bb.2.b2:
248    successors: %bb.4(0x80000000)
249
250    tBL 14, $noreg, @extfunc, csr_aapcs, implicit-def dead $lr, implicit $sp, implicit-def $sp, implicit-def $r0
251    t2B %bb.4, 14, $noreg
252
253  bb.3.b3:
254    successors: %bb.4(0x80000000)
255
256    renamable $r0 = t2LDRi12 undef renamable $r0, 0, 14, $noreg :: (load (s32) from `ptr undef`)
257    renamable $r0 = t2ANDri killed renamable $r0, 256, 14, $noreg, $noreg
258
259  bb.4.b5:
260    successors: %bb.5(0x30000000), %bb.6(0x50000000)
261    liveins: $r0
262
263    t2CMPri killed renamable $r0, 0, 14, $noreg, implicit-def $cpsr
264    $sp = t2LDMIA_UPD $sp, 14, $noreg, def $r7, def $lr
265    t2Bcc %bb.6, 1, killed $cpsr
266
267  bb.5.b8:
268    liveins: $lr, $r7
269
270    tBX_RET 14, $noreg
271
272  bb.6.b7:
273    liveins: $lr, $r7
274
275    tTAILJMPdND @extfunc, 14, $noreg, implicit $sp, implicit $sp
276
277...
278---
279name:            test_optsize
280alignment:       2
281exposesReturnsTwice: false
282legalized:       false
283regBankSelected: false
284selected:        false
285failedISel:      false
286tracksRegLiveness: true
287hasWinCFI:       false
288registers:       []
289liveins:         []
290frameInfo:
291  isFrameAddressTaken: false
292  isReturnAddressTaken: false
293  hasStackMap:     false
294  hasPatchPoint:   false
295  stackSize:       8
296  offsetAdjustment: 0
297  maxAlignment:    4
298  adjustsStack:    true
299  hasCalls:        true
300  stackProtector:  ''
301  maxCallFrameSize: 0
302  cvBytesOfCalleeSavedRegisters: 0
303  hasOpaqueSPAdjustment: false
304  hasVAStart:      false
305  hasMustTailInVarArgFunc: false
306  localFrameSize:  0
307  savePoint:       ''
308  restorePoint:    ''
309fixedStack:      []
310stack:
311  - { id: 0, name: '', type: spill-slot, offset: -4, size: 4, alignment: 4,
312      stack-id: default, callee-saved-register: '$lr', callee-saved-restored: true,
313      debug-info-variable: '', debug-info-expression: '', debug-info-location: '' }
314  - { id: 1, name: '', type: spill-slot, offset: -8, size: 4, alignment: 4,
315      stack-id: default, callee-saved-register: '$r7', callee-saved-restored: true,
316      debug-info-variable: '', debug-info-expression: '', debug-info-location: '' }
317callSites:       []
318constants:       []
319machineFunctionInfo: {}
320body:             |
321  ; CHECK-V7-LABEL: name: test_optsize
322  ; CHECK-V7: bb.0 (%ir-block.0):
323  ; CHECK-V7:   successors: %bb.1(0x50000000), %bb.6(0x30000000)
324  ; CHECK-V7:   liveins: $lr, $r7
325  ; CHECK-V7:   renamable $r0 = t2MOVi 1, 14 /* CC::al */, $noreg, $noreg
326  ; CHECK-V7:   t2CMPri killed renamable $r0, 0, 14 /* CC::al */, $noreg, implicit-def $cpsr
327  ; CHECK-V7:   t2Bcc %bb.6, 1 /* CC::ne */, killed $cpsr
328  ; CHECK-V7: bb.1.b1:
329  ; CHECK-V7:   successors: %bb.3(0x40000000), %bb.2(0x40000000)
330  ; CHECK-V7:   liveins: $r7, $lr
331  ; CHECK-V7:   $sp = frame-setup t2STMDB_UPD $sp, 14 /* CC::al */, $noreg, killed $r7, killed $lr
332  ; CHECK-V7:   frame-setup CFI_INSTRUCTION def_cfa_offset 8
333  ; CHECK-V7:   frame-setup CFI_INSTRUCTION offset $lr, -4
334  ; CHECK-V7:   frame-setup CFI_INSTRUCTION offset $r7, -8
335  ; CHECK-V7:   renamable $r0 = t2MOVi 0, 14 /* CC::al */, $noreg, $noreg
336  ; CHECK-V7:   t2CMPri killed renamable $r0, 0, 14 /* CC::al */, $noreg, implicit-def $cpsr
337  ; CHECK-V7:   t2Bcc %bb.3, 1 /* CC::ne */, killed $cpsr
338  ; CHECK-V7: bb.2.b2:
339  ; CHECK-V7:   successors: %bb.4(0x80000000)
340  ; CHECK-V7:   tBL 14 /* CC::al */, $noreg, @extfunc, csr_aapcs, implicit-def dead $lr, implicit $sp, implicit-def $sp, implicit-def $r0
341  ; CHECK-V7:   t2B %bb.4, 14 /* CC::al */, $noreg
342  ; CHECK-V7: bb.3.b3:
343  ; CHECK-V7:   successors: %bb.4(0x80000000)
344  ; CHECK-V7:   renamable $r0 = t2LDRi12 undef renamable $r0, 0, 14 /* CC::al */, $noreg :: (load (s32) from `ptr undef`)
345  ; CHECK-V7:   renamable $r0 = t2ANDri killed renamable $r0, 256, 14 /* CC::al */, $noreg, $noreg
346  ; CHECK-V7: bb.4.b5:
347  ; CHECK-V7:   successors: %bb.5(0x30000000), %bb.6(0x50000000)
348  ; CHECK-V7:   liveins: $r0
349  ; CHECK-V7:   t2CMPri killed renamable $r0, 0, 14 /* CC::al */, $noreg, implicit-def $cpsr
350  ; CHECK-V7:   $sp = t2LDMIA_UPD $sp, 14 /* CC::al */, $noreg, def $r7, def $lr
351  ; CHECK-V7:   t2Bcc %bb.6, 1 /* CC::ne */, killed $cpsr
352  ; CHECK-V7: bb.5.b8:
353  ; CHECK-V7:   liveins: $lr, $r7
354  ; CHECK-V7:   tBX_RET 14 /* CC::al */, $noreg
355  ; CHECK-V7: bb.6.b7:
356  ; CHECK-V7:   liveins: $lr, $r7
357  ; CHECK-V7:   tTAILJMPdND @extfunc, 14 /* CC::al */, $noreg, implicit $sp, implicit $sp
358  ; CHECK-V8-LABEL: name: test_optsize
359  ; CHECK-V8: bb.0 (%ir-block.0):
360  ; CHECK-V8:   successors: %bb.1(0x50000000), %bb.6(0x30000000)
361  ; CHECK-V8:   liveins: $lr, $r7
362  ; CHECK-V8:   renamable $r0 = t2MOVi 1, 14 /* CC::al */, $noreg, $noreg
363  ; CHECK-V8:   t2CMPri killed renamable $r0, 0, 14 /* CC::al */, $noreg, implicit-def $cpsr
364  ; CHECK-V8:   t2Bcc %bb.6, 1 /* CC::ne */, killed $cpsr
365  ; CHECK-V8: bb.1.b1:
366  ; CHECK-V8:   successors: %bb.3(0x40000000), %bb.2(0x40000000)
367  ; CHECK-V8:   liveins: $r7, $lr
368  ; CHECK-V8:   $sp = frame-setup t2STMDB_UPD $sp, 14 /* CC::al */, $noreg, killed $r7, killed $lr
369  ; CHECK-V8:   frame-setup CFI_INSTRUCTION def_cfa_offset 8
370  ; CHECK-V8:   frame-setup CFI_INSTRUCTION offset $lr, -4
371  ; CHECK-V8:   frame-setup CFI_INSTRUCTION offset $r7, -8
372  ; CHECK-V8:   renamable $r0 = t2MOVi 0, 14 /* CC::al */, $noreg, $noreg
373  ; CHECK-V8:   t2CMPri killed renamable $r0, 0, 14 /* CC::al */, $noreg, implicit-def $cpsr
374  ; CHECK-V8:   t2Bcc %bb.3, 1 /* CC::ne */, killed $cpsr
375  ; CHECK-V8: bb.2.b2:
376  ; CHECK-V8:   successors: %bb.4(0x80000000)
377  ; CHECK-V8:   tBL 14 /* CC::al */, $noreg, @extfunc, csr_aapcs, implicit-def dead $lr, implicit $sp, implicit-def $sp, implicit-def $r0
378  ; CHECK-V8:   t2B %bb.4, 14 /* CC::al */, $noreg
379  ; CHECK-V8: bb.3.b3:
380  ; CHECK-V8:   successors: %bb.4(0x80000000)
381  ; CHECK-V8:   renamable $r0 = t2LDRi12 undef renamable $r0, 0, 14 /* CC::al */, $noreg :: (load (s32) from `ptr undef`)
382  ; CHECK-V8:   renamable $r0 = t2ANDri killed renamable $r0, 256, 14 /* CC::al */, $noreg, $noreg
383  ; CHECK-V8: bb.4.b5:
384  ; CHECK-V8:   successors: %bb.5(0x30000000), %bb.6(0x50000000)
385  ; CHECK-V8:   liveins: $r0
386  ; CHECK-V8:   t2CMPri killed renamable $r0, 0, 14 /* CC::al */, $noreg, implicit-def $cpsr
387  ; CHECK-V8:   $sp = t2LDMIA_UPD $sp, 14 /* CC::al */, $noreg, def $r7, def $lr
388  ; CHECK-V8:   t2Bcc %bb.6, 1 /* CC::ne */, killed $cpsr
389  ; CHECK-V8: bb.5.b8:
390  ; CHECK-V8:   liveins: $lr, $r7
391  ; CHECK-V8:   tBX_RET 14 /* CC::al */, $noreg
392  ; CHECK-V8: bb.6.b7:
393  ; CHECK-V8:   liveins: $lr, $r7
394  ; CHECK-V8:   tTAILJMPdND @extfunc, 14 /* CC::al */, $noreg, implicit $sp, implicit $sp
395  bb.0 (%ir-block.0):
396    successors: %bb.1(0x50000000), %bb.6(0x30000000)
397    liveins: $lr, $r7
398
399    renamable $r0 = t2MOVi 1, 14, $noreg, $noreg
400    t2CMPri killed renamable $r0, 0, 14, $noreg, implicit-def $cpsr
401    t2Bcc %bb.6, 1, killed $cpsr
402
403  bb.1.b1:
404    successors: %bb.3(0x40000000), %bb.2(0x40000000)
405    liveins: $r7, $lr
406
407    $sp = frame-setup t2STMDB_UPD $sp, 14, $noreg, killed $r7, killed $lr
408    frame-setup CFI_INSTRUCTION def_cfa_offset 8
409    frame-setup CFI_INSTRUCTION offset $lr, -4
410    frame-setup CFI_INSTRUCTION offset $r7, -8
411    renamable $r0 = t2MOVi 0, 14, $noreg, $noreg
412    t2CMPri killed renamable $r0, 0, 14, $noreg, implicit-def $cpsr
413    t2Bcc %bb.3, 1, killed $cpsr
414
415  bb.2.b2:
416    successors: %bb.4(0x80000000)
417
418    tBL 14, $noreg, @extfunc, csr_aapcs, implicit-def dead $lr, implicit $sp, implicit-def $sp, implicit-def $r0
419    t2B %bb.4, 14, $noreg
420
421  bb.3.b3:
422    successors: %bb.4(0x80000000)
423
424    renamable $r0 = t2LDRi12 undef renamable $r0, 0, 14, $noreg :: (load (s32) from `ptr undef`)
425    renamable $r0 = t2ANDri killed renamable $r0, 256, 14, $noreg, $noreg
426
427  bb.4.b5:
428    successors: %bb.5(0x30000000), %bb.6(0x50000000)
429    liveins: $r0
430
431    t2CMPri killed renamable $r0, 0, 14, $noreg, implicit-def $cpsr
432    $sp = t2LDMIA_UPD $sp, 14, $noreg, def $r7, def $lr
433    t2Bcc %bb.6, 1, killed $cpsr
434
435  bb.5.b8:
436    liveins: $lr, $r7
437
438    tBX_RET 14, $noreg
439
440  bb.6.b7:
441    liveins: $lr, $r7
442
443    tTAILJMPdND @extfunc, 14, $noreg, implicit $sp, implicit $sp
444
445...
446---
447name:            test_minsize
448alignment:       2
449exposesReturnsTwice: false
450legalized:       false
451regBankSelected: false
452selected:        false
453failedISel:      false
454tracksRegLiveness: true
455hasWinCFI:       false
456registers:       []
457liveins:         []
458frameInfo:
459  isFrameAddressTaken: false
460  isReturnAddressTaken: false
461  hasStackMap:     false
462  hasPatchPoint:   false
463  stackSize:       8
464  offsetAdjustment: 0
465  maxAlignment:    4
466  adjustsStack:    true
467  hasCalls:        true
468  stackProtector:  ''
469  maxCallFrameSize: 0
470  cvBytesOfCalleeSavedRegisters: 0
471  hasOpaqueSPAdjustment: false
472  hasVAStart:      false
473  hasMustTailInVarArgFunc: false
474  localFrameSize:  0
475  savePoint:       ''
476  restorePoint:    ''
477fixedStack:      []
478stack:
479  - { id: 0, name: '', type: spill-slot, offset: -4, size: 4, alignment: 4,
480      stack-id: default, callee-saved-register: '$lr', callee-saved-restored: true,
481      debug-info-variable: '', debug-info-expression: '', debug-info-location: '' }
482  - { id: 1, name: '', type: spill-slot, offset: -8, size: 4, alignment: 4,
483      stack-id: default, callee-saved-register: '$r7', callee-saved-restored: true,
484      debug-info-variable: '', debug-info-expression: '', debug-info-location: '' }
485callSites:       []
486constants:       []
487machineFunctionInfo: {}
488body:             |
489  ; CHECK-V7-LABEL: name: test_minsize
490  ; CHECK-V7: bb.0 (%ir-block.0):
491  ; CHECK-V7:   successors: %bb.1(0x50000000), %bb.6(0x30000000)
492  ; CHECK-V7:   liveins: $lr, $r7
493  ; CHECK-V7:   renamable $r0 = t2MOVi 1, 14 /* CC::al */, $noreg, $noreg
494  ; CHECK-V7:   t2CMPri killed renamable $r0, 0, 14 /* CC::al */, $noreg, implicit-def $cpsr
495  ; CHECK-V7:   t2Bcc %bb.6, 1 /* CC::ne */, killed $cpsr
496  ; CHECK-V7: bb.1.b1:
497  ; CHECK-V7:   successors: %bb.3(0x40000000), %bb.2(0x40000000)
498  ; CHECK-V7:   liveins: $r7, $lr
499  ; CHECK-V7:   $sp = frame-setup t2STMDB_UPD $sp, 14 /* CC::al */, $noreg, killed $r7, killed $lr
500  ; CHECK-V7:   frame-setup CFI_INSTRUCTION def_cfa_offset 8
501  ; CHECK-V7:   frame-setup CFI_INSTRUCTION offset $lr, -4
502  ; CHECK-V7:   frame-setup CFI_INSTRUCTION offset $r7, -8
503  ; CHECK-V7:   renamable $r0 = t2MOVi 0, 14 /* CC::al */, $noreg, $noreg
504  ; CHECK-V7:   t2CMPri killed renamable $r0, 0, 14 /* CC::al */, $noreg, implicit-def $cpsr
505  ; CHECK-V7:   t2Bcc %bb.3, 1 /* CC::ne */, killed $cpsr
506  ; CHECK-V7: bb.2.b2:
507  ; CHECK-V7:   successors: %bb.4(0x80000000)
508  ; CHECK-V7:   tBL 14 /* CC::al */, $noreg, @extfunc, csr_aapcs, implicit-def dead $lr, implicit $sp, implicit-def $sp, implicit-def $r0
509  ; CHECK-V7:   t2B %bb.4, 14 /* CC::al */, $noreg
510  ; CHECK-V7: bb.3.b3:
511  ; CHECK-V7:   successors: %bb.4(0x80000000)
512  ; CHECK-V7:   renamable $r0 = t2LDRi12 undef renamable $r0, 0, 14 /* CC::al */, $noreg :: (load (s32) from `ptr undef`)
513  ; CHECK-V7:   renamable $r0 = t2ANDri killed renamable $r0, 256, 14 /* CC::al */, $noreg, $noreg
514  ; CHECK-V7: bb.4.b5:
515  ; CHECK-V7:   successors: %bb.5(0x30000000), %bb.6(0x50000000)
516  ; CHECK-V7:   liveins: $r0
517  ; CHECK-V7:   t2CMPri killed renamable $r0, 0, 14 /* CC::al */, $noreg, implicit-def $cpsr
518  ; CHECK-V7:   $sp = t2LDMIA_UPD $sp, 14 /* CC::al */, $noreg, def $r7, def $lr
519  ; CHECK-V7:   t2Bcc %bb.6, 1 /* CC::ne */, killed $cpsr
520  ; CHECK-V7: bb.5.b8:
521  ; CHECK-V7:   liveins: $lr, $r7
522  ; CHECK-V7:   tBX_RET 14 /* CC::al */, $noreg
523  ; CHECK-V7: bb.6.b7:
524  ; CHECK-V7:   liveins: $lr, $r7
525  ; CHECK-V7:   tTAILJMPdND @extfunc, 14 /* CC::al */, $noreg, implicit $sp, implicit $sp
526  ; CHECK-V8-LABEL: name: test_minsize
527  ; CHECK-V8: bb.0 (%ir-block.0):
528  ; CHECK-V8:   successors: %bb.1(0x50000000), %bb.6(0x30000000)
529  ; CHECK-V8:   liveins: $lr, $r7
530  ; CHECK-V8:   renamable $r0 = t2MOVi 1, 14 /* CC::al */, $noreg, $noreg
531  ; CHECK-V8:   t2CMPri killed renamable $r0, 0, 14 /* CC::al */, $noreg, implicit-def $cpsr
532  ; CHECK-V8:   t2Bcc %bb.6, 1 /* CC::ne */, killed $cpsr
533  ; CHECK-V8: bb.1.b1:
534  ; CHECK-V8:   successors: %bb.3(0x40000000), %bb.2(0x40000000)
535  ; CHECK-V8:   liveins: $r7, $lr
536  ; CHECK-V8:   $sp = frame-setup t2STMDB_UPD $sp, 14 /* CC::al */, $noreg, killed $r7, killed $lr
537  ; CHECK-V8:   frame-setup CFI_INSTRUCTION def_cfa_offset 8
538  ; CHECK-V8:   frame-setup CFI_INSTRUCTION offset $lr, -4
539  ; CHECK-V8:   frame-setup CFI_INSTRUCTION offset $r7, -8
540  ; CHECK-V8:   renamable $r0 = t2MOVi 0, 14 /* CC::al */, $noreg, $noreg
541  ; CHECK-V8:   t2CMPri killed renamable $r0, 0, 14 /* CC::al */, $noreg, implicit-def $cpsr
542  ; CHECK-V8:   t2Bcc %bb.3, 1 /* CC::ne */, killed $cpsr
543  ; CHECK-V8: bb.2.b2:
544  ; CHECK-V8:   successors: %bb.4(0x80000000)
545  ; CHECK-V8:   tBL 14 /* CC::al */, $noreg, @extfunc, csr_aapcs, implicit-def dead $lr, implicit $sp, implicit-def $sp, implicit-def $r0
546  ; CHECK-V8:   t2B %bb.4, 14 /* CC::al */, $noreg
547  ; CHECK-V8: bb.3.b3:
548  ; CHECK-V8:   successors: %bb.4(0x80000000)
549  ; CHECK-V8:   renamable $r0 = t2LDRi12 undef renamable $r0, 0, 14 /* CC::al */, $noreg :: (load (s32) from `ptr undef`)
550  ; CHECK-V8:   renamable $r0 = t2ANDri killed renamable $r0, 256, 14 /* CC::al */, $noreg, $noreg
551  ; CHECK-V8: bb.4.b5:
552  ; CHECK-V8:   successors: %bb.5(0x30000000), %bb.6(0x50000000)
553  ; CHECK-V8:   liveins: $r0
554  ; CHECK-V8:   t2CMPri killed renamable $r0, 0, 14 /* CC::al */, $noreg, implicit-def $cpsr
555  ; CHECK-V8:   $sp = t2LDMIA_UPD $sp, 14 /* CC::al */, $noreg, def $r7, def $lr
556  ; CHECK-V8:   t2Bcc %bb.6, 1 /* CC::ne */, killed $cpsr
557  ; CHECK-V8: bb.5.b8:
558  ; CHECK-V8:   liveins: $lr, $r7
559  ; CHECK-V8:   tBX_RET 14 /* CC::al */, $noreg
560  ; CHECK-V8: bb.6.b7:
561  ; CHECK-V8:   liveins: $lr, $r7
562  ; CHECK-V8:   tTAILJMPdND @extfunc, 14 /* CC::al */, $noreg, implicit $sp, implicit $sp
563  bb.0 (%ir-block.0):
564    successors: %bb.1(0x50000000), %bb.6(0x30000000)
565    liveins: $lr, $r7
566
567    renamable $r0 = t2MOVi 1, 14, $noreg, $noreg
568    t2CMPri killed renamable $r0, 0, 14, $noreg, implicit-def $cpsr
569    t2Bcc %bb.6, 1, killed $cpsr
570
571  bb.1.b1:
572    successors: %bb.3(0x40000000), %bb.2(0x40000000)
573    liveins: $r7, $lr
574
575    $sp = frame-setup t2STMDB_UPD $sp, 14, $noreg, killed $r7, killed $lr
576    frame-setup CFI_INSTRUCTION def_cfa_offset 8
577    frame-setup CFI_INSTRUCTION offset $lr, -4
578    frame-setup CFI_INSTRUCTION offset $r7, -8
579    renamable $r0 = t2MOVi 0, 14, $noreg, $noreg
580    t2CMPri killed renamable $r0, 0, 14, $noreg, implicit-def $cpsr
581    t2Bcc %bb.3, 1, killed $cpsr
582
583  bb.2.b2:
584    successors: %bb.4(0x80000000)
585
586    tBL 14, $noreg, @extfunc, csr_aapcs, implicit-def dead $lr, implicit $sp, implicit-def $sp, implicit-def $r0
587    t2B %bb.4, 14, $noreg
588
589  bb.3.b3:
590    successors: %bb.4(0x80000000)
591
592    renamable $r0 = t2LDRi12 undef renamable $r0, 0, 14, $noreg :: (load (s32) from `ptr undef`)
593    renamable $r0 = t2ANDri killed renamable $r0, 256, 14, $noreg, $noreg
594
595  bb.4.b5:
596    successors: %bb.5(0x30000000), %bb.6(0x50000000)
597    liveins: $r0
598
599    t2CMPri killed renamable $r0, 0, 14, $noreg, implicit-def $cpsr
600    $sp = t2LDMIA_UPD $sp, 14, $noreg, def $r7, def $lr
601    t2Bcc %bb.6, 1, killed $cpsr
602
603  bb.5.b8:
604    liveins: $lr, $r7
605
606    tBX_RET 14, $noreg
607
608  bb.6.b7:
609    liveins: $lr, $r7
610
611    tTAILJMPdND @extfunc, 14, $noreg, implicit $sp, implicit $sp
612
613...
614