1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -mtriple=thumbv8.1m.main -mattr=+mve -run-pass=arm-low-overhead-loops %s -o - | FileCheck %s
4 define hidden void @vector_spill_in_loop() {
9 define hidden void @vector_spill_load_outside() {
15 name: vector_spill_in_loop
16 tracksRegLiveness: true
18 - { id: 0, name: '', type: spill-slot, offset: -120, size: 16, alignment: 8,
19 stack-id: default, callee-saved-register: '', callee-saved-restored: true,
20 debug-info-variable: '', debug-info-expression: '', debug-info-location: '' }
22 ; CHECK-LABEL: name: vector_spill_in_loop
24 ; CHECK: successors: %bb.1(0x80000000)
25 ; CHECK: liveins: $q0, $r1, $r2, $r3, $r4, $r5, $r7, $r8, $r10, $r11, $r12
26 ; CHECK: $r6 = tMOVr $r2, 14 /* CC::al */, $noreg
27 ; CHECK: $r0 = tMOVr $r12, 14 /* CC::al */, $noreg
28 ; CHECK: $lr = MVE_DLSTP_16 renamable $r3
30 ; CHECK: successors: %bb.1(0x7c000000), %bb.2(0x04000000)
31 ; CHECK: liveins: $lr, $q0, $r0, $r1, $r2, $r3, $r4, $r5, $r6, $r7, $r8, $r10, $r11, $r12
32 ; CHECK: renamable $r0, renamable $q6 = MVE_VLDRHU16_post killed renamable $r0, 16, 0, $noreg
33 ; CHECK: renamable $q3 = MVE_VLDRHU16 renamable $r6, 0, 0, $noreg
34 ; CHECK: renamable $q5 = MVE_VSHR_immu16 killed renamable $q3, 11, 0, $noreg, undef renamable $q5
35 ; CHECK: MVE_VSTRWU32 killed renamable $q5, $sp, 80, 0, $noreg :: (store (s128) into %stack.0, align 8)
36 ; CHECK: dead renamable $q7 = MVE_VLDRWU32 $sp, 80, 0, $noreg :: (load (s128) from %stack.0, align 8)
37 ; CHECK: dead renamable $vpr = MVE_VCMPi16r killed renamable $q6, renamable $r8, 1, 0, killed $noreg
38 ; CHECK: $lr = MVE_LETP killed renamable $lr, %bb.1
40 successors: %bb.1(0x80000000)
41 liveins: $q0, $r1, $r2, $r3, $r4, $r5, $r7, $r8, $r10, $r11, $r12
43 $r6 = tMOVr $r2, 14 /* CC::al */, $noreg
44 $r0 = tMOVr $r12, 14 /* CC::al */, $noreg
45 $r9 = tMOVr $r3, 14 /* CC::al */, $noreg
46 renamable $lr = t2DoLoopStartTP renamable $r1, renamable $r3
49 successors: %bb.1(0x7c000000), %bb.2(0x04000000)
50 liveins: $lr, $q0, $r0, $r1, $r2, $r3, $r4, $r5, $r6, $r7, $r8, $r9, $r10, $r11, $r12
52 renamable $vpr = MVE_VCTP16 renamable $r9, 0, $noreg
53 MVE_VPST 8, implicit $vpr
54 renamable $r0, renamable $q6 = MVE_VLDRHU16_post killed renamable $r0, 16, 1, renamable $vpr
55 renamable $q3 = MVE_VLDRHU16 renamable $r6, 0, 1, renamable $vpr
56 MVE_VPST 2, implicit $vpr
57 renamable $q5 = MVE_VSHR_immu16 renamable $q3, 11, 1, renamable $vpr, undef renamable $q5
58 renamable $r9 = nsw t2SUBri killed renamable $r9, 8, 14 /* CC::al */, $noreg, $noreg
59 MVE_VSTRWU32 killed renamable $q5, $sp, 80, 0, $noreg :: (store (s128) into %stack.0, align 8)
60 MVE_VPST 8, implicit $vpr
61 renamable $q7 = MVE_VLDRWU32 $sp, 80, 0, $noreg :: (load (s128) from %stack.0, align 8)
62 MVE_VPST 1, implicit $vpr
63 renamable $vpr = MVE_VCMPi16r killed renamable $q6, renamable $r8, 1, 1, killed renamable $vpr
64 renamable $lr = t2LoopEndDec killed renamable $lr, %bb.1, implicit-def dead $cpsr
65 tB %bb.2, 14 /* CC::al */, $noreg
68 successors: %bb.3(0x04000000), %bb.0(0x7c000000)
69 liveins: $q0, $r1, $r2, $r3, $r4, $r5, $r7, $r8, $r10, $r11, $r12
71 renamable $r0 = tLDRspi $sp, 1, 14 /* CC::al */, $noreg
72 renamable $r10 = nuw t2ADDri killed renamable $r10, 1, 14 /* CC::al */, $noreg, $noreg
73 renamable $r12 = t2ADDrs killed renamable $r12, killed renamable $r0, 10, 14 /* CC::al */, $noreg, $noreg
74 renamable $r0 = tLDRspi $sp, 3, 14 /* CC::al */, $noreg
75 renamable $r2 = t2ADDrs killed renamable $r2, killed renamable $r0, 10, 14 /* CC::al */, $noreg, $noreg
76 renamable $r0 = tLDRspi $sp, 2, 14 /* CC::al */, $noreg
77 tCMPhir renamable $r10, killed renamable $r0, 14 /* CC::al */, $noreg, implicit-def $cpsr
78 tBcc %bb.0, 1 /* CC::ne */, killed $cpsr
81 $sp = frame-destroy tADDspi $sp, 24, 14 /* CC::al */, $noreg
82 $sp = frame-destroy VLDMDIA_UPD $sp, 14 /* CC::al */, $noreg, def $d8, def $d9, def $d10, def $d11, def $d12, def $d13, def $d14, def $d15
83 $sp = frame-destroy tADDspi $sp, 1, 14 /* CC::al */, $noreg
84 $sp = frame-destroy t2LDMIA_RET $sp, 14 /* CC::al */, $noreg, def $r4, def $r5, def $r6, def $r7, def $r8, def $r9, def $r10, def $r11, def $pc
87 name: vector_spill_load_outside
89 - { id: 0, name: '', type: spill-slot, offset: -120, size: 16, alignment: 8,
90 stack-id: default, callee-saved-register: '', callee-saved-restored: true,
91 debug-info-variable: '', debug-info-expression: '', debug-info-location: '' }
92 tracksRegLiveness: true
94 ; CHECK-LABEL: name: vector_spill_load_outside
96 ; CHECK: successors: %bb.1(0x80000000)
97 ; CHECK: liveins: $q0, $r1, $r2, $r3, $r4, $r5, $r7, $r8, $r10, $r11, $r12
98 ; CHECK: $r6 = tMOVr $r2, 14 /* CC::al */, $noreg
99 ; CHECK: $r0 = tMOVr $r12, 14 /* CC::al */, $noreg
100 ; CHECK: $r9 = tMOVr $r3, 14 /* CC::al */, $noreg
101 ; CHECK: $lr = t2DLS renamable $r1
103 ; CHECK: successors: %bb.1(0x7c000000), %bb.2(0x04000000)
104 ; CHECK: liveins: $lr, $q0, $r0, $r1, $r2, $r3, $r4, $r5, $r6, $r7, $r8, $r9, $r10, $r11, $r12
105 ; CHECK: renamable $vpr = MVE_VCTP16 renamable $r9, 0, $noreg
106 ; CHECK: MVE_VPST 8, implicit $vpr
107 ; CHECK: renamable $r0, renamable $q6 = MVE_VLDRHU16_post killed renamable $r0, 16, 1, renamable $vpr
108 ; CHECK: renamable $q3 = MVE_VLDRHU16 renamable $r6, 0, 1, renamable $vpr
109 ; CHECK: MVE_VPST 2, implicit $vpr
110 ; CHECK: renamable $q5 = MVE_VSHR_immu16 killed renamable $q3, 11, 1, renamable $vpr, undef renamable $q5
111 ; CHECK: renamable $r9 = nsw t2SUBri killed renamable $r9, 8, 14 /* CC::al */, $noreg, $noreg
112 ; CHECK: MVE_VSTRWU32 killed renamable $q5, $sp, 80, 0, $noreg :: (store (s128) into %stack.0, align 8)
113 ; CHECK: MVE_VPST 8, implicit $vpr
114 ; CHECK: dead renamable $q7 = MVE_VLDRWU32 $sp, 80, 0, $noreg :: (load (s128) from %stack.0, align 8)
115 ; CHECK: MVE_VPST 1, implicit $vpr
116 ; CHECK: dead renamable $vpr = MVE_VCMPi16r killed renamable $q6, renamable $r8, 1, 1, killed renamable $vpr
117 ; CHECK: $lr = t2LEUpdate killed renamable $lr, %bb.1
119 successors: %bb.1(0x80000000)
120 liveins: $q0, $r1, $r2, $r3, $r4, $r5, $r7, $r8, $r10, $r11, $r12
122 $r6 = tMOVr $r2, 14 /* CC::al */, $noreg
123 $r0 = tMOVr $r12, 14 /* CC::al */, $noreg
124 $r9 = tMOVr $r3, 14 /* CC::al */, $noreg
125 renamable $lr = t2DoLoopStartTP renamable $r1, renamable $r3
128 successors: %bb.1(0x7c000000), %bb.2(0x04000000)
129 liveins: $lr, $q0, $r0, $r1, $r2, $r3, $r4, $r5, $r6, $r7, $r8, $r9, $r10, $r11, $r12
131 renamable $vpr = MVE_VCTP16 renamable $r9, 0, $noreg
132 MVE_VPST 8, implicit $vpr
133 renamable $r0, renamable $q6 = MVE_VLDRHU16_post killed renamable $r0, 16, 1, renamable $vpr
134 renamable $q3 = MVE_VLDRHU16 renamable $r6, 0, 1, renamable $vpr
135 MVE_VPST 2, implicit $vpr
136 renamable $q5 = MVE_VSHR_immu16 renamable $q3, 11, 1, renamable $vpr, undef renamable $q5
137 renamable $r9 = nsw t2SUBri killed renamable $r9, 8, 14 /* CC::al */, $noreg, $noreg
138 MVE_VSTRWU32 killed renamable $q5, $sp, 80, 0, $noreg :: (store (s128) into %stack.0, align 8)
139 MVE_VPST 8, implicit $vpr
140 renamable $q7 = MVE_VLDRWU32 $sp, 80, 0, $noreg :: (load (s128) from %stack.0, align 8)
141 MVE_VPST 1, implicit $vpr
142 renamable $vpr = MVE_VCMPi16r killed renamable $q6, renamable $r8, 1, 1, killed renamable $vpr
143 renamable $lr = t2LoopEndDec killed renamable $lr, %bb.1, implicit-def dead $cpsr
144 tB %bb.2, 14 /* CC::al */, $noreg
147 successors: %bb.3(0x04000000), %bb.0(0x7c000000)
148 liveins: $q0, $r1, $r2, $r3, $r4, $r5, $r7, $r8, $r10, $r11, $r12
150 renamable $q7 = MVE_VLDRWU32 $sp, 80, 0, $noreg :: (load (s128) from %stack.0, align 8)
151 renamable $r0 = tLDRspi $sp, 1, 14 /* CC::al */, $noreg
152 renamable $r10 = nuw t2ADDri killed renamable $r10, 1, 14 /* CC::al */, $noreg, $noreg
153 renamable $r12 = t2ADDrs killed renamable $r12, killed renamable $r0, 10, 14 /* CC::al */, $noreg, $noreg
154 renamable $r0 = tLDRspi $sp, 3, 14 /* CC::al */, $noreg
155 renamable $r2 = t2ADDrs killed renamable $r2, killed renamable $r0, 10, 14 /* CC::al */, $noreg, $noreg
156 renamable $r0 = tLDRspi $sp, 2, 14 /* CC::al */, $noreg
157 tCMPhir renamable $r10, killed renamable $r0, 14 /* CC::al */, $noreg, implicit-def $cpsr
158 tBcc %bb.0, 1 /* CC::ne */, killed $cpsr
161 $sp = frame-destroy tADDspi $sp, 24, 14 /* CC::al */, $noreg
162 $sp = frame-destroy VLDMDIA_UPD $sp, 14 /* CC::al */, $noreg, def $d8, def $d9, def $d10, def $d11, def $d12, def $d13, def $d14, def $d15
163 $sp = frame-destroy tADDspi $sp, 1, 14 /* CC::al */, $noreg
164 $sp = frame-destroy t2LDMIA_RET $sp, 14 /* CC::al */, $noreg, def $r4, def $r5, def $r6, def $r7, def $r8, def $r9, def $r10, def $r11, def $pc