1 # NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py
2 # RUN: llc -mtriple=thumbv8.1m.main -mattr=+mve.fp -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(ptr %pSrc, ptr %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 ptr [ %pDst, %entry ], [ %add.ptr4, %do.body ]
24 %pSrc.addr.0 = phi ptr [ %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 %7 = tail call <4 x float> @llvm.masked.load.v4f32.p0(ptr %pSrc.addr.0, i32 4, <4 x i1> %6, <4 x float> undef)
28 %8 = fmul <4 x float> %7, <float 1.000000e+00, float -1.000000e+00, float 1.000000e+00, float -1.000000e+00>
29 tail call void @llvm.masked.store.v4f32.p0(<4 x float> %8, ptr %pDst.addr.0, i32 4, <4 x i1> %6)
30 %add.ptr = getelementptr inbounds float, ptr %pSrc.addr.0, i32 4
31 %add.ptr4 = getelementptr inbounds float, ptr %pDst.addr.0, i32 4
32 %sub = add nsw i32 %blkCnt.0, -4
33 %9 = call i32 @llvm.loop.decrement.reg.i32.i32.i32(i32 %5, i32 1)
34 %10 = icmp ne i32 %9, 0
35 br i1 %10, label %do.body, label %do.end
37 do.end: ; preds = %do.body
40 declare <4 x i1> @llvm.arm.mve.vctp32(i32) #1
41 declare <4 x float> @llvm.masked.load.v4f32.p0(ptr, i32 immarg, <4 x i1>, <4 x float>)
42 declare void @llvm.masked.store.v4f32.p0(<4 x float>, ptr, i32 immarg, <4 x i1>)
43 declare i32 @llvm.start.loop.iterations.i32(i32)
44 declare i32 @llvm.loop.decrement.reg.i32.i32.i32(i32, i32)
48 name: it_block_2_stmts
50 exposesReturnsTwice: false
52 regBankSelected: false
55 tracksRegLiveness: true
59 - { reg: '$r0', virtual-reg: '' }
60 - { reg: '$r1', virtual-reg: '' }
61 - { reg: '$r2', virtual-reg: '' }
63 isFrameAddressTaken: false
64 isReturnAddressTaken: false
74 cvBytesOfCalleeSavedRegisters: 0
75 hasOpaqueSPAdjustment: false
77 hasMustTailInVarArgFunc: false
83 - { id: 0, name: '', type: spill-slot, offset: -4, size: 4, alignment: 4,
84 stack-id: default, callee-saved-register: '$lr', callee-saved-restored: false,
85 debug-info-variable: '', debug-info-expression: '', debug-info-location: '' }
86 - { id: 1, name: '', type: spill-slot, offset: -8, size: 4, alignment: 4,
87 stack-id: default, callee-saved-register: '$r7', callee-saved-restored: true,
88 debug-info-variable: '', debug-info-expression: '', debug-info-location: '' }
92 value: '<4 x float> <float 1.000000e+00, float -1.000000e+00, float 1.000000e+00, float -1.000000e+00>'
94 isTargetSpecific: false
95 machineFunctionInfo: {}
97 ; CHECK-LABEL: name: it_block_2_stmts
99 ; CHECK-NEXT: successors: %bb.1(0x80000000)
100 ; CHECK-NEXT: liveins: $lr, $r0, $r1, $r2, $r7
102 ; CHECK-NEXT: frame-setup tPUSH 14 /* CC::al */, $noreg, killed $r7, killed $lr, implicit-def $sp, implicit $sp
103 ; CHECK-NEXT: frame-setup CFI_INSTRUCTION def_cfa_offset 8
104 ; CHECK-NEXT: frame-setup CFI_INSTRUCTION offset $lr, -4
105 ; CHECK-NEXT: frame-setup CFI_INSTRUCTION offset $r7, -8
106 ; CHECK-NEXT: renamable $r3, dead $cpsr = tLSLri renamable $r2, 1, 14 /* CC::al */, $noreg
107 ; CHECK-NEXT: renamable $r12 = t2MOVi 4, 14 /* CC::al */, $noreg, $noreg
108 ; CHECK-NEXT: tCMPi8 renamable $r3, 4, 14 /* CC::al */, $noreg, implicit-def $cpsr
109 ; CHECK-NEXT: t2IT 11, 8, implicit-def $itstate
110 ; CHECK-NEXT: $r12 = t2LSLri renamable $r2, 1, 11 /* CC::lt */, $cpsr, $noreg, implicit killed renamable $r12, implicit $itstate
111 ; CHECK-NEXT: $r0 = t2ADDri killed renamable $r0, 42, 11 /* CC::lt */, killed $cpsr, $noreg, implicit killed renamable $r0, implicit killed $itstate
112 ; CHECK-NEXT: renamable $r2 = t2RSBrs killed renamable $r12, killed renamable $r2, 10, 14 /* CC::al */, $noreg, $noreg
113 ; CHECK-NEXT: dead renamable $r12 = t2ADDri killed renamable $r2, 3, 14 /* CC::al */, $noreg, $noreg
114 ; CHECK-NEXT: dead renamable $r2, dead $cpsr = tMOVi8 1, 14 /* CC::al */, $noreg
115 ; CHECK-NEXT: renamable $r2 = tLEApcrel %const.0, 14 /* CC::al */, $noreg
116 ; CHECK-NEXT: renamable $q0 = MVE_VLDRWU32 killed renamable $r2, 0, 0, $noreg, $noreg :: (load (s128) from constant-pool)
117 ; CHECK-NEXT: $lr = MVE_DLSTP_32 killed renamable $r3
119 ; CHECK-NEXT: bb.1.do.body (align 4):
120 ; CHECK-NEXT: successors: %bb.1(0x7c000000), %bb.2(0x04000000)
121 ; CHECK-NEXT: liveins: $lr, $q0, $r0, $r1
123 ; CHECK-NEXT: renamable $q1 = nnan ninf nsz MVE_VLDRWU32 renamable $r0, 0, 0, $noreg, $noreg
124 ; CHECK-NEXT: renamable $q1 = nnan ninf nsz MVE_VMULf32 killed renamable $q1, renamable $q0, 0, $noreg, $noreg, undef renamable $q1
125 ; CHECK-NEXT: MVE_VSTRWU32 killed renamable $q1, renamable $r1, 0, 0, killed $noreg, $noreg
126 ; CHECK-NEXT: renamable $r0, dead $cpsr = nuw tADDi8 killed renamable $r0, 16, 14 /* CC::al */, $noreg
127 ; CHECK-NEXT: renamable $r1, dead $cpsr = nuw tADDi8 killed renamable $r1, 16, 14 /* CC::al */, $noreg
128 ; CHECK-NEXT: $lr = MVE_LETP killed renamable $lr, %bb.1
130 ; CHECK-NEXT: bb.2.do.end:
131 ; CHECK-NEXT: tPOP_RET 14 /* CC::al */, $noreg, def $r7, def $pc
133 ; CHECK-NEXT: bb.3 (align 16):
134 ; CHECK-NEXT: CONSTPOOL_ENTRY 0, %const.0, 16
136 successors: %bb.1(0x80000000)
137 liveins: $r0, $r1, $r2, $r7, $lr
139 frame-setup tPUSH 14, $noreg, killed $r7, killed $lr, implicit-def $sp, implicit $sp
140 frame-setup CFI_INSTRUCTION def_cfa_offset 8
141 frame-setup CFI_INSTRUCTION offset $lr, -4
142 frame-setup CFI_INSTRUCTION offset $r7, -8
143 renamable $r3, dead $cpsr = tLSLri renamable $r2, 1, 14, $noreg
144 renamable $r12 = t2MOVi 4, 14, $noreg, $noreg
145 tCMPi8 renamable $r3, 4, 14, $noreg, implicit-def $cpsr
146 t2IT 11, 8, implicit-def $itstate
147 $r12 = t2LSLri renamable $r2, 1, 11, $cpsr, $noreg, implicit renamable $r12, implicit $itstate
148 $r0 = t2ADDri renamable $r0, 42, 11, killed $cpsr, $noreg, implicit killed renamable $r0, implicit killed $itstate
149 renamable $r2 = t2RSBrs killed renamable $r12, killed renamable $r2, 10, 14, $noreg, $noreg
150 renamable $r12 = t2ADDri killed renamable $r2, 3, 14, $noreg, $noreg
151 renamable $r2, dead $cpsr = tMOVi8 1, 14, $noreg
152 renamable $lr = nuw nsw t2ADDrs killed renamable $r2, killed renamable $r12, 19, 14, $noreg, $noreg
153 renamable $r2 = tLEApcrel %const.0, 14, $noreg
154 renamable $q0 = MVE_VLDRWU32 killed renamable $r2, 0, 0, $noreg, $noreg :: (load (s128) from constant-pool)
155 $lr = t2DoLoopStart renamable $lr
157 bb.1.do.body (align 4):
158 successors: %bb.1(0x7c000000), %bb.2(0x04000000)
159 liveins: $lr, $q0, $r0, $r1, $r3
161 renamable $vpr = MVE_VCTP32 renamable $r3, 0, $noreg, $noreg
162 MVE_VPST 2, implicit $vpr
163 renamable $q1 = nnan ninf nsz MVE_VLDRWU32 renamable $r0, 0, 1, renamable $vpr, $noreg
164 renamable $q1 = nnan ninf nsz MVE_VMULf32 killed renamable $q1, renamable $q0, 1, renamable $vpr, $noreg, undef renamable $q1
165 MVE_VSTRWU32 killed renamable $q1, renamable $r1, 0, 1, killed renamable $vpr, $noreg
166 renamable $r0, dead $cpsr = nuw tADDi8 killed renamable $r0, 16, 14, $noreg
167 renamable $lr = t2LoopDec killed renamable $lr, 1
168 renamable $r1, dead $cpsr = nuw tADDi8 killed renamable $r1, 16, 14, $noreg
169 renamable $r3, dead $cpsr = nsw tSUBi8 killed renamable $r3, 4, 14, $noreg
170 t2LoopEnd renamable $lr, %bb.1, implicit-def dead $cpsr
174 tPOP_RET 14, $noreg, def $r7, def $pc
177 CONSTPOOL_ENTRY 0, %const.0, 16