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 - --verify-machineinstrs | FileCheck %s
4 # IT-block with 2 statements, with the last instruction not connected to the
5 # use-def chain of the iteration counter; make sure we don't remove the
6 # IT block and any of its instructions.
9 define hidden arm_aapcs_vfpcc void @it_block_2_stmts(float* %pSrc, float* %pDst, i32 %blockSize) local_unnamed_addr #0 {
11 %mul = shl i32 %blockSize, 1
13 %1 = icmp slt i32 %mul, 4
14 %smin = select i1 %1, i32 %mul, i32 4
15 %2 = sub i32 %0, %smin
17 %4 = add nuw nsw i32 %3, 1
18 %start = call i32 @llvm.start.loop.iterations.i32(i32 %4)
21 do.body: ; preds = %do.body, %entry
22 %blkCnt.0 = phi i32 [ %mul, %entry ], [ %sub, %do.body ]
23 %pDst.addr.0 = phi float* [ %pDst, %entry ], [ %add.ptr4, %do.body ]
24 %pSrc.addr.0 = phi float* [ %pSrc, %entry ], [ %add.ptr, %do.body ]
25 %5 = phi i32 [ %start, %entry ], [ %9, %do.body ]
26 %6 = tail call <4 x i1> @llvm.arm.mve.vctp32(i32 %blkCnt.0)
27 %input_cast = bitcast float* %pSrc.addr.0 to <4 x float>*
28 %7 = tail call <4 x float> @llvm.masked.load.v4f32.p0v4f32(<4 x float>* %input_cast, i32 4, <4 x i1> %6, <4 x float> undef)
29 %8 = fmul <4 x float> %7, <float 1.000000e+00, float -1.000000e+00, float 1.000000e+00, float -1.000000e+00>
30 %output_cast = bitcast float* %pDst.addr.0 to <4 x float>*
31 tail call void @llvm.masked.store.v4f32.p0v4f32(<4 x float> %8, <4 x float>* %output_cast, i32 4, <4 x i1> %6)
32 %add.ptr = getelementptr inbounds float, float* %pSrc.addr.0, i32 4
33 %add.ptr4 = getelementptr inbounds float, float* %pDst.addr.0, i32 4
34 %sub = add nsw i32 %blkCnt.0, -4
35 %9 = call i32 @llvm.loop.decrement.reg.i32.i32.i32(i32 %5, i32 1)
36 %10 = icmp ne i32 %9, 0
37 br i1 %10, label %do.body, label %do.end
39 do.end: ; preds = %do.body
42 declare <4 x i1> @llvm.arm.mve.vctp32(i32) #1
43 declare <4 x float> @llvm.masked.load.v4f32.p0v4f32(<4 x float>*, i32 immarg, <4 x i1>, <4 x float>)
44 declare void @llvm.masked.store.v4f32.p0v4f32(<4 x float>, <4 x float>*, i32 immarg, <4 x i1>)
45 declare i32 @llvm.start.loop.iterations.i32(i32)
46 declare i32 @llvm.loop.decrement.reg.i32.i32.i32(i32, i32)
50 name: it_block_2_stmts
52 exposesReturnsTwice: false
54 regBankSelected: false
57 tracksRegLiveness: true
61 - { reg: '$r0', virtual-reg: '' }
62 - { reg: '$r1', virtual-reg: '' }
63 - { reg: '$r2', virtual-reg: '' }
65 isFrameAddressTaken: false
66 isReturnAddressTaken: false
76 cvBytesOfCalleeSavedRegisters: 0
77 hasOpaqueSPAdjustment: false
79 hasMustTailInVarArgFunc: false
85 - { id: 0, name: '', type: spill-slot, offset: -4, size: 4, alignment: 4,
86 stack-id: default, callee-saved-register: '$lr', callee-saved-restored: false,
87 debug-info-variable: '', debug-info-expression: '', debug-info-location: '' }
88 - { id: 1, name: '', type: spill-slot, offset: -8, size: 4, alignment: 4,
89 stack-id: default, callee-saved-register: '$r7', callee-saved-restored: true,
90 debug-info-variable: '', debug-info-expression: '', debug-info-location: '' }
94 value: '<4 x float> <float 1.000000e+00, float -1.000000e+00, float 1.000000e+00, float -1.000000e+00>'
96 isTargetSpecific: false
97 machineFunctionInfo: {}
99 ; CHECK-LABEL: name: it_block_2_stmts
101 ; CHECK: successors: %bb.1(0x80000000)
102 ; CHECK: liveins: $lr, $r0, $r1, $r2, $r7
103 ; CHECK: frame-setup tPUSH 14 /* CC::al */, $noreg, killed $r7, killed $lr, implicit-def $sp, implicit $sp
104 ; CHECK: frame-setup CFI_INSTRUCTION def_cfa_offset 8
105 ; CHECK: frame-setup CFI_INSTRUCTION offset $lr, -4
106 ; CHECK: frame-setup CFI_INSTRUCTION offset $r7, -8
107 ; CHECK: renamable $r3, dead $cpsr = tLSLri renamable $r2, 1, 14 /* CC::al */, $noreg
108 ; CHECK: renamable $r12 = t2MOVi 4, 14 /* CC::al */, $noreg, $noreg
109 ; CHECK: tCMPi8 renamable $r3, 4, 14 /* CC::al */, $noreg, implicit-def $cpsr
110 ; CHECK: t2IT 11, 8, implicit-def $itstate
111 ; CHECK: $r12 = t2LSLri renamable $r2, 1, 11 /* CC::lt */, $cpsr, $noreg, implicit killed renamable $r12, implicit $itstate
112 ; CHECK: $r0 = t2ADDri killed renamable $r0, 42, 11 /* CC::lt */, killed $cpsr, $noreg, implicit killed renamable $r0, implicit killed $itstate
113 ; CHECK: renamable $r2 = t2RSBrs killed renamable $r12, killed renamable $r2, 10, 14 /* CC::al */, $noreg, $noreg
114 ; CHECK: dead renamable $r12 = t2ADDri killed renamable $r2, 3, 14 /* CC::al */, $noreg, $noreg
115 ; CHECK: dead renamable $r2, dead $cpsr = tMOVi8 1, 14 /* CC::al */, $noreg
116 ; CHECK: renamable $r2 = tLEApcrel %const.0, 14 /* CC::al */, $noreg
117 ; CHECK: renamable $q0 = MVE_VLDRWU32 killed renamable $r2, 0, 0, $noreg :: (load (s128) from constant-pool)
118 ; CHECK: $lr = MVE_DLSTP_32 killed renamable $r3
119 ; CHECK: bb.1.do.body (align 4):
120 ; CHECK: successors: %bb.1(0x7c000000), %bb.2(0x04000000)
121 ; CHECK: liveins: $lr, $q0, $r0, $r1
122 ; CHECK: renamable $q1 = nnan ninf nsz MVE_VLDRWU32 renamable $r0, 0, 0, $noreg
123 ; CHECK: renamable $q1 = nnan ninf nsz MVE_VMULf32 killed renamable $q1, renamable $q0, 0, $noreg, undef renamable $q1
124 ; CHECK: MVE_VSTRWU32 killed renamable $q1, renamable $r1, 0, 0, killed $noreg
125 ; CHECK: renamable $r0, dead $cpsr = nuw tADDi8 killed renamable $r0, 16, 14 /* CC::al */, $noreg
126 ; CHECK: renamable $r1, dead $cpsr = nuw tADDi8 killed renamable $r1, 16, 14 /* CC::al */, $noreg
127 ; CHECK: $lr = MVE_LETP killed renamable $lr, %bb.1
128 ; CHECK: bb.2.do.end:
129 ; CHECK: tPOP_RET 14 /* CC::al */, $noreg, def $r7, def $pc
130 ; CHECK: bb.3 (align 16):
131 ; CHECK: CONSTPOOL_ENTRY 0, %const.0, 16
133 successors: %bb.1(0x80000000)
134 liveins: $r0, $r1, $r2, $r7, $lr
136 frame-setup tPUSH 14, $noreg, killed $r7, killed $lr, implicit-def $sp, implicit $sp
137 frame-setup CFI_INSTRUCTION def_cfa_offset 8
138 frame-setup CFI_INSTRUCTION offset $lr, -4
139 frame-setup CFI_INSTRUCTION offset $r7, -8
140 renamable $r3, dead $cpsr = tLSLri renamable $r2, 1, 14, $noreg
141 renamable $r12 = t2MOVi 4, 14, $noreg, $noreg
142 tCMPi8 renamable $r3, 4, 14, $noreg, implicit-def $cpsr
143 t2IT 11, 8, implicit-def $itstate
144 $r12 = t2LSLri renamable $r2, 1, 11, $cpsr, $noreg, implicit renamable $r12, implicit $itstate
145 $r0 = t2ADDri renamable $r0, 42, 11, killed $cpsr, $noreg, implicit killed renamable $r0, implicit killed $itstate
146 renamable $r2 = t2RSBrs killed renamable $r12, killed renamable $r2, 10, 14, $noreg, $noreg
147 renamable $r12 = t2ADDri killed renamable $r2, 3, 14, $noreg, $noreg
148 renamable $r2, dead $cpsr = tMOVi8 1, 14, $noreg
149 renamable $lr = nuw nsw t2ADDrs killed renamable $r2, killed renamable $r12, 19, 14, $noreg, $noreg
150 renamable $r2 = tLEApcrel %const.0, 14, $noreg
151 renamable $q0 = MVE_VLDRWU32 killed renamable $r2, 0, 0, $noreg :: (load (s128) from constant-pool)
152 $lr = t2DoLoopStart renamable $lr
154 bb.1.do.body (align 4):
155 successors: %bb.1(0x7c000000), %bb.2(0x04000000)
156 liveins: $lr, $q0, $r0, $r1, $r3
158 renamable $vpr = MVE_VCTP32 renamable $r3, 0, $noreg
159 MVE_VPST 2, implicit $vpr
160 renamable $q1 = nnan ninf nsz MVE_VLDRWU32 renamable $r0, 0, 1, renamable $vpr
161 renamable $q1 = nnan ninf nsz MVE_VMULf32 killed renamable $q1, renamable $q0, 1, renamable $vpr, undef renamable $q1
162 MVE_VSTRWU32 killed renamable $q1, renamable $r1, 0, 1, killed renamable $vpr
163 renamable $r0, dead $cpsr = nuw tADDi8 killed renamable $r0, 16, 14, $noreg
164 renamable $lr = t2LoopDec killed renamable $lr, 1
165 renamable $r1, dead $cpsr = nuw tADDi8 killed renamable $r1, 16, 14, $noreg
166 renamable $r3, dead $cpsr = nsw tSUBi8 killed renamable $r3, 4, 14, $noreg
167 t2LoopEnd renamable $lr, %bb.1, implicit-def dead $cpsr
171 tPOP_RET 14, $noreg, def $r7, def $pc
174 CONSTPOOL_ENTRY 0, %const.0, 16