1 # RUN: llc -mtriple=thumbv8.1m.main %s -run-pass=arm-low-overhead-loops --verify-machineinstrs -o - | FileCheck %s
5 # CHECK-NOT: t2LEUpdate
8 define i32 @mov_between_dec_end(i32 %n) #0 {
10 %cmp6 = icmp eq i32 %n, 0
11 br i1 %cmp6, label %while.end, label %while.body.preheader
13 while.body.preheader: ; preds = %entry
14 call void @llvm.set.loop.iterations.i32(i32 %n)
17 while.body: ; preds = %while.body, %while.body.preheader
18 %res.07 = phi i32 [ %add, %while.body ], [ 0, %while.body.preheader ]
19 %0 = phi i32 [ %n, %while.body.preheader ], [ %1, %while.body ]
20 %1 = call i32 @llvm.loop.decrement.reg.i32.i32.i32(i32 %0, i32 1)
22 %2 = icmp ne i32 %1, 0
23 br i1 %2, label %while.body, label %while.end
25 while.end: ; preds = %while.body, %entry
26 %res.0.lcssa = phi i32 [ 0, %entry ], [ %add, %while.body ]
30 ; Function Attrs: noduplicate nounwind
31 declare void @llvm.set.loop.iterations.i32(i32) #1
33 ; Function Attrs: noduplicate nounwind
34 declare i32 @llvm.loop.decrement.reg.i32.i32.i32(i32, i32) #1
36 attributes #0 = { "target-features"="+mve.fp" }
37 attributes #1 = { noduplicate nounwind }
38 attributes #2 = { nounwind }
42 name: mov_between_dec_end
44 exposesReturnsTwice: false
46 regBankSelected: false
49 tracksRegLiveness: false
53 - { reg: '$r0', virtual-reg: '' }
55 isFrameAddressTaken: false
56 isReturnAddressTaken: false
66 cvBytesOfCalleeSavedRegisters: 0
67 hasOpaqueSPAdjustment: false
69 hasMustTailInVarArgFunc: false
75 - { id: 0, name: '', type: spill-slot, offset: -4, size: 4, alignment: 4,
76 stack-id: default, callee-saved-register: '$lr', callee-saved-restored: false,
77 debug-info-variable: '', debug-info-expression: '', debug-info-location: '' }
78 - { id: 1, name: '', type: spill-slot, offset: -8, size: 4, alignment: 4,
79 stack-id: default, callee-saved-register: '$r7', callee-saved-restored: true,
80 debug-info-variable: '', debug-info-expression: '', debug-info-location: '' }
81 - { id: 2, name: '', type: spill-slot, offset: -12, size: 4, alignment: 4,
82 stack-id: default, callee-saved-register: '$r5', callee-saved-restored: true,
83 debug-info-variable: '', debug-info-expression: '', debug-info-location: '' }
84 - { id: 3, name: '', type: spill-slot, offset: -16, size: 4, alignment: 4,
85 stack-id: default, callee-saved-register: '$r4', callee-saved-restored: true,
86 debug-info-variable: '', debug-info-expression: '', debug-info-location: '' }
89 machineFunctionInfo: {}
92 successors: %bb.4(0x30000000), %bb.1(0x50000000)
94 frame-setup tPUSH 14, $noreg, killed $r4, killed $r5, killed $r7, killed $lr, implicit-def $sp, implicit $sp
95 frame-setup CFI_INSTRUCTION def_cfa_offset 16
96 frame-setup CFI_INSTRUCTION offset $lr, -4
97 frame-setup CFI_INSTRUCTION offset $r7, -8
98 frame-setup CFI_INSTRUCTION offset $r5, -12
99 frame-setup CFI_INSTRUCTION offset $r4, -16
102 bb.1.while.body.preheader:
103 successors: %bb.2(0x80000000)
105 $lr = tMOVr $r0, 14, $noreg
106 renamable $r4, dead $cpsr = tMOVi8 0, 14, $noreg
107 t2DoLoopStart killed $r0
110 successors: %bb.2(0x7c000000), %bb.3(0x04000000)
112 $r4 = tMOVr $lr, 14, $noreg
113 renamable $lr = t2LoopDec killed renamable $lr, 1
114 $lr = tMOVr $r4, 14, $noreg
115 t2LoopEnd renamable $lr, %bb.2, implicit-def dead $cpsr
119 $r0 = tMOVr killed $r4, 14, $noreg
120 tPOP_RET 14, $noreg, def $r4, def $r5, def $r7, def $pc, implicit killed $r0
123 renamable $r4, dead $cpsr = tMOVi8 0, 14, $noreg
124 $r0 = tMOVr killed $r4, 14, $noreg
125 tPOP_RET 14, $noreg, def $r4, def $r5, def $r7, def $pc, implicit killed $r0