blob: a43f564951e93d2599f2ea4ab610aa637f61b7e8 [file] [log] [blame]
David Green9cf920e2020-03-20 08:25:19 +00001; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
David Greeneecba952020-04-22 16:33:11 +01002; RUN: llc -mtriple=thumbv8.1m.main-none-none-eabi -mattr=+mve.fp -verify-machineinstrs %s -o - | FileCheck %s
David Green9cf920e2020-03-20 08:25:19 +00003
4define arm_aapcs_vfpcc void @test_fadd(float* noalias nocapture readonly %A, float %B, float* noalias nocapture %C, i32 %n) {
5; CHECK-LABEL: test_fadd:
6; CHECK: @ %bb.0: @ %entry
7; CHECK-NEXT: cmp r2, #1
8; CHECK-NEXT: it lt
9; CHECK-NEXT: bxlt lr
Sam Parkera3e41d42020-08-27 07:09:25 +010010; CHECK-NEXT: .LBB0_1: @ %vector.ph
David Green9cf920e2020-03-20 08:25:19 +000011; CHECK-NEXT: vmov r3, s0
Sam Parkera3e41d42020-08-27 07:09:25 +010012; CHECK-NEXT: .LBB0_2: @ %vector.body
David Green9cf920e2020-03-20 08:25:19 +000013; CHECK-NEXT: @ =>This Inner Loop Header: Depth=1
David Green37b9cc82020-03-25 11:35:53 +000014; CHECK-NEXT: vldrw.u32 q0, [r0], #16
David Green9cf920e2020-03-20 08:25:19 +000015; CHECK-NEXT: subs r2, #4
David Green37b9cc82020-03-25 11:35:53 +000016; CHECK-NEXT: vadd.f32 q0, q0, r3
17; CHECK-NEXT: vstrb.8 q0, [r1], #16
Sam Parkera3e41d42020-08-27 07:09:25 +010018; CHECK-NEXT: bne .LBB0_2
19; CHECK-NEXT: @ %bb.3: @ %for.cond.cleanup
David Green9cf920e2020-03-20 08:25:19 +000020; CHECK-NEXT: bx lr
21entry:
22 %0 = and i32 %n, 7
23 %cmp = icmp eq i32 %0, 0
24 tail call void @llvm.assume(i1 %cmp)
25 %cmp18 = icmp sgt i32 %n, 0
26 br i1 %cmp18, label %vector.ph, label %for.cond.cleanup
27
28vector.ph: ; preds = %entry
29 %broadcast.splatinsert10 = insertelement <4 x float> undef, float %B, i32 0
30 %broadcast.splat11 = shufflevector <4 x float> %broadcast.splatinsert10, <4 x float> undef, <4 x i32> zeroinitializer
31 br label %vector.body
32
33vector.body: ; preds = %vector.body, %vector.ph
34 %index = phi i32 [ 0, %vector.ph ], [ %index.next, %vector.body ]
35 %1 = getelementptr inbounds float, float* %A, i32 %index
36 %2 = bitcast float* %1 to <4 x float>*
37 %wide.load = load <4 x float>, <4 x float>* %2, align 4
38 %3 = fadd fast <4 x float> %wide.load, %broadcast.splat11
39 %4 = getelementptr inbounds float, float* %C, i32 %index
40 %5 = bitcast float* %4 to <4 x float>*
41 store <4 x float> %3, <4 x float>* %5, align 4
42 %index.next = add i32 %index, 4
43 %6 = icmp eq i32 %index.next, %n
44 br i1 %6, label %for.cond.cleanup, label %vector.body
45
46for.cond.cleanup: ; preds = %vector.body, %entry
47 ret void
48}
49
50define arm_aapcs_vfpcc void @test_fadd_r(float* noalias nocapture readonly %A, float %B, float* noalias nocapture %C, i32 %n) {
51; CHECK-LABEL: test_fadd_r:
52; CHECK: @ %bb.0: @ %entry
53; CHECK-NEXT: cmp r2, #1
54; CHECK-NEXT: it lt
55; CHECK-NEXT: bxlt lr
Sam Parkera3e41d42020-08-27 07:09:25 +010056; CHECK-NEXT: .LBB1_1: @ %vector.ph
David Green9cf920e2020-03-20 08:25:19 +000057; CHECK-NEXT: vmov r3, s0
Sam Parkera3e41d42020-08-27 07:09:25 +010058; CHECK-NEXT: .LBB1_2: @ %vector.body
David Green9cf920e2020-03-20 08:25:19 +000059; CHECK-NEXT: @ =>This Inner Loop Header: Depth=1
David Green37b9cc82020-03-25 11:35:53 +000060; CHECK-NEXT: vldrw.u32 q0, [r0], #16
David Green9cf920e2020-03-20 08:25:19 +000061; CHECK-NEXT: subs r2, #4
David Green37b9cc82020-03-25 11:35:53 +000062; CHECK-NEXT: vadd.f32 q0, q0, r3
63; CHECK-NEXT: vstrb.8 q0, [r1], #16
Sam Parkera3e41d42020-08-27 07:09:25 +010064; CHECK-NEXT: bne .LBB1_2
65; CHECK-NEXT: @ %bb.3: @ %for.cond.cleanup
David Green9cf920e2020-03-20 08:25:19 +000066; CHECK-NEXT: bx lr
67entry:
68 %0 = and i32 %n, 7
69 %cmp = icmp eq i32 %0, 0
70 tail call void @llvm.assume(i1 %cmp)
71 %cmp18 = icmp sgt i32 %n, 0
72 br i1 %cmp18, label %vector.ph, label %for.cond.cleanup
73
74vector.ph: ; preds = %entry
75 %broadcast.splatinsert10 = insertelement <4 x float> undef, float %B, i32 0
76 %broadcast.splat11 = shufflevector <4 x float> %broadcast.splatinsert10, <4 x float> undef, <4 x i32> zeroinitializer
77 br label %vector.body
78
79vector.body: ; preds = %vector.body, %vector.ph
80 %index = phi i32 [ 0, %vector.ph ], [ %index.next, %vector.body ]
81 %1 = getelementptr inbounds float, float* %A, i32 %index
82 %2 = bitcast float* %1 to <4 x float>*
83 %wide.load = load <4 x float>, <4 x float>* %2, align 4
84 %3 = fadd fast <4 x float> %broadcast.splat11, %wide.load
85 %4 = getelementptr inbounds float, float* %C, i32 %index
86 %5 = bitcast float* %4 to <4 x float>*
87 store <4 x float> %3, <4 x float>* %5, align 4
88 %index.next = add i32 %index, 4
89 %6 = icmp eq i32 %index.next, %n
90 br i1 %6, label %for.cond.cleanup, label %vector.body
91
92for.cond.cleanup: ; preds = %vector.body, %entry
93 ret void
94}
95
96define arm_aapcs_vfpcc void @test_fmul(float* noalias nocapture readonly %A, float %B, float* noalias nocapture %C, i32 %n) {
97; CHECK-LABEL: test_fmul:
98; CHECK: @ %bb.0: @ %entry
99; CHECK-NEXT: cmp r2, #1
100; CHECK-NEXT: it lt
101; CHECK-NEXT: bxlt lr
Sam Parkera3e41d42020-08-27 07:09:25 +0100102; CHECK-NEXT: .LBB2_1: @ %vector.ph
David Green9cf920e2020-03-20 08:25:19 +0000103; CHECK-NEXT: vmov r3, s0
Sam Parkera3e41d42020-08-27 07:09:25 +0100104; CHECK-NEXT: .LBB2_2: @ %vector.body
David Green9cf920e2020-03-20 08:25:19 +0000105; CHECK-NEXT: @ =>This Inner Loop Header: Depth=1
David Green37b9cc82020-03-25 11:35:53 +0000106; CHECK-NEXT: vldrw.u32 q0, [r0], #16
David Green9cf920e2020-03-20 08:25:19 +0000107; CHECK-NEXT: subs r2, #4
David Green37b9cc82020-03-25 11:35:53 +0000108; CHECK-NEXT: vmul.f32 q0, q0, r3
109; CHECK-NEXT: vstrb.8 q0, [r1], #16
Sam Parkera3e41d42020-08-27 07:09:25 +0100110; CHECK-NEXT: bne .LBB2_2
111; CHECK-NEXT: @ %bb.3: @ %for.cond.cleanup
David Green9cf920e2020-03-20 08:25:19 +0000112; CHECK-NEXT: bx lr
113entry:
114 %0 = and i32 %n, 7
115 %cmp = icmp eq i32 %0, 0
116 tail call void @llvm.assume(i1 %cmp)
117 %cmp18 = icmp sgt i32 %n, 0
118 br i1 %cmp18, label %vector.ph, label %for.cond.cleanup
119
120vector.ph: ; preds = %entry
121 %broadcast.splatinsert10 = insertelement <4 x float> undef, float %B, i32 0
122 %broadcast.splat11 = shufflevector <4 x float> %broadcast.splatinsert10, <4 x float> undef, <4 x i32> zeroinitializer
123 br label %vector.body
124
125vector.body: ; preds = %vector.body, %vector.ph
126 %index = phi i32 [ 0, %vector.ph ], [ %index.next, %vector.body ]
127 %1 = getelementptr inbounds float, float* %A, i32 %index
128 %2 = bitcast float* %1 to <4 x float>*
129 %wide.load = load <4 x float>, <4 x float>* %2, align 4
130 %3 = fmul fast <4 x float> %wide.load, %broadcast.splat11
131 %4 = getelementptr inbounds float, float* %C, i32 %index
132 %5 = bitcast float* %4 to <4 x float>*
133 store <4 x float> %3, <4 x float>* %5, align 4
134 %index.next = add i32 %index, 4
135 %6 = icmp eq i32 %index.next, %n
136 br i1 %6, label %for.cond.cleanup, label %vector.body
137
138for.cond.cleanup: ; preds = %vector.body, %entry
139 ret void
140}
141
142define arm_aapcs_vfpcc void @test_fmul_r(float* noalias nocapture readonly %A, float %B, float* noalias nocapture %C, i32 %n) {
143; CHECK-LABEL: test_fmul_r:
144; CHECK: @ %bb.0: @ %entry
145; CHECK-NEXT: cmp r2, #1
146; CHECK-NEXT: it lt
147; CHECK-NEXT: bxlt lr
Sam Parkera3e41d42020-08-27 07:09:25 +0100148; CHECK-NEXT: .LBB3_1: @ %vector.ph
David Green9cf920e2020-03-20 08:25:19 +0000149; CHECK-NEXT: vmov r3, s0
Sam Parkera3e41d42020-08-27 07:09:25 +0100150; CHECK-NEXT: .LBB3_2: @ %vector.body
David Green9cf920e2020-03-20 08:25:19 +0000151; CHECK-NEXT: @ =>This Inner Loop Header: Depth=1
David Green37b9cc82020-03-25 11:35:53 +0000152; CHECK-NEXT: vldrw.u32 q0, [r0], #16
David Green9cf920e2020-03-20 08:25:19 +0000153; CHECK-NEXT: subs r2, #4
David Green37b9cc82020-03-25 11:35:53 +0000154; CHECK-NEXT: vmul.f32 q0, q0, r3
155; CHECK-NEXT: vstrb.8 q0, [r1], #16
Sam Parkera3e41d42020-08-27 07:09:25 +0100156; CHECK-NEXT: bne .LBB3_2
157; CHECK-NEXT: @ %bb.3: @ %for.cond.cleanup
David Green9cf920e2020-03-20 08:25:19 +0000158; CHECK-NEXT: bx lr
159entry:
160 %0 = and i32 %n, 7
161 %cmp = icmp eq i32 %0, 0
162 tail call void @llvm.assume(i1 %cmp)
163 %cmp18 = icmp sgt i32 %n, 0
164 br i1 %cmp18, label %vector.ph, label %for.cond.cleanup
165
166vector.ph: ; preds = %entry
167 %broadcast.splatinsert10 = insertelement <4 x float> undef, float %B, i32 0
168 %broadcast.splat11 = shufflevector <4 x float> %broadcast.splatinsert10, <4 x float> undef, <4 x i32> zeroinitializer
169 br label %vector.body
170
171vector.body: ; preds = %vector.body, %vector.ph
172 %index = phi i32 [ 0, %vector.ph ], [ %index.next, %vector.body ]
173 %1 = getelementptr inbounds float, float* %A, i32 %index
174 %2 = bitcast float* %1 to <4 x float>*
175 %wide.load = load <4 x float>, <4 x float>* %2, align 4
176 %3 = fmul fast <4 x float> %broadcast.splat11, %wide.load
177 %4 = getelementptr inbounds float, float* %C, i32 %index
178 %5 = bitcast float* %4 to <4 x float>*
179 store <4 x float> %3, <4 x float>* %5, align 4
180 %index.next = add i32 %index, 4
181 %6 = icmp eq i32 %index.next, %n
182 br i1 %6, label %for.cond.cleanup, label %vector.body
183
184for.cond.cleanup: ; preds = %vector.body, %entry
185 ret void
186}
187
188define arm_aapcs_vfpcc void @test_fsub(float* noalias nocapture readonly %A, float %B, float* noalias nocapture %C, i32 %n) {
189; CHECK-LABEL: test_fsub:
190; CHECK: @ %bb.0: @ %entry
191; CHECK-NEXT: cmp r2, #1
192; CHECK-NEXT: it lt
193; CHECK-NEXT: bxlt lr
Sam Parkera3e41d42020-08-27 07:09:25 +0100194; CHECK-NEXT: .LBB4_1: @ %vector.ph
David Green9cf920e2020-03-20 08:25:19 +0000195; CHECK-NEXT: vmov r3, s0
Sam Parkera3e41d42020-08-27 07:09:25 +0100196; CHECK-NEXT: .LBB4_2: @ %vector.body
David Green9cf920e2020-03-20 08:25:19 +0000197; CHECK-NEXT: @ =>This Inner Loop Header: Depth=1
David Green37b9cc82020-03-25 11:35:53 +0000198; CHECK-NEXT: vldrw.u32 q0, [r0], #16
David Green9cf920e2020-03-20 08:25:19 +0000199; CHECK-NEXT: subs r2, #4
David Green37b9cc82020-03-25 11:35:53 +0000200; CHECK-NEXT: vsub.f32 q0, q0, r3
201; CHECK-NEXT: vstrb.8 q0, [r1], #16
Sam Parkera3e41d42020-08-27 07:09:25 +0100202; CHECK-NEXT: bne .LBB4_2
203; CHECK-NEXT: @ %bb.3: @ %for.cond.cleanup
David Green9cf920e2020-03-20 08:25:19 +0000204; CHECK-NEXT: bx lr
205entry:
206 %0 = and i32 %n, 7
207 %cmp = icmp eq i32 %0, 0
208 tail call void @llvm.assume(i1 %cmp)
209 %cmp18 = icmp sgt i32 %n, 0
210 br i1 %cmp18, label %vector.ph, label %for.cond.cleanup
211
212vector.ph: ; preds = %entry
213 %broadcast.splatinsert10 = insertelement <4 x float> undef, float %B, i32 0
214 %broadcast.splat11 = shufflevector <4 x float> %broadcast.splatinsert10, <4 x float> undef, <4 x i32> zeroinitializer
215 br label %vector.body
216
217vector.body: ; preds = %vector.body, %vector.ph
218 %index = phi i32 [ 0, %vector.ph ], [ %index.next, %vector.body ]
219 %1 = getelementptr inbounds float, float* %A, i32 %index
220 %2 = bitcast float* %1 to <4 x float>*
221 %wide.load = load <4 x float>, <4 x float>* %2, align 4
222 %3 = fsub fast <4 x float> %wide.load, %broadcast.splat11
223 %4 = getelementptr inbounds float, float* %C, i32 %index
224 %5 = bitcast float* %4 to <4 x float>*
225 store <4 x float> %3, <4 x float>* %5, align 4
226 %index.next = add i32 %index, 4
227 %6 = icmp eq i32 %index.next, %n
228 br i1 %6, label %for.cond.cleanup, label %vector.body
229
230for.cond.cleanup: ; preds = %vector.body, %entry
231 ret void
232}
233
234define arm_aapcs_vfpcc void @test_fsub_r(float* noalias nocapture readonly %A, float %B, float* noalias nocapture %C, i32 %n) {
235; CHECK-LABEL: test_fsub_r:
236; CHECK: @ %bb.0: @ %entry
237; CHECK-NEXT: cmp r2, #1
238; CHECK-NEXT: it lt
239; CHECK-NEXT: bxlt lr
Sam Parkera3e41d42020-08-27 07:09:25 +0100240; CHECK-NEXT: .LBB5_1: @ %vector.ph
David Green9cf920e2020-03-20 08:25:19 +0000241; CHECK-NEXT: vmov r3, s0
242; CHECK-NEXT: vdup.32 q0, r3
Sam Parkera3e41d42020-08-27 07:09:25 +0100243; CHECK-NEXT: .LBB5_2: @ %vector.body
David Green9cf920e2020-03-20 08:25:19 +0000244; CHECK-NEXT: @ =>This Inner Loop Header: Depth=1
245; CHECK-NEXT: vldrw.u32 q1, [r0], #16
246; CHECK-NEXT: subs r2, #4
247; CHECK-NEXT: vsub.f32 q1, q0, q1
248; CHECK-NEXT: vstrb.8 q1, [r1], #16
Sam Parkera3e41d42020-08-27 07:09:25 +0100249; CHECK-NEXT: bne .LBB5_2
250; CHECK-NEXT: @ %bb.3: @ %for.cond.cleanup
David Green9cf920e2020-03-20 08:25:19 +0000251; CHECK-NEXT: bx lr
252entry:
253 %0 = and i32 %n, 7
254 %cmp = icmp eq i32 %0, 0
255 tail call void @llvm.assume(i1 %cmp)
256 %cmp18 = icmp sgt i32 %n, 0
257 br i1 %cmp18, label %vector.ph, label %for.cond.cleanup
258
259vector.ph: ; preds = %entry
260 %broadcast.splatinsert10 = insertelement <4 x float> undef, float %B, i32 0
261 %broadcast.splat11 = shufflevector <4 x float> %broadcast.splatinsert10, <4 x float> undef, <4 x i32> zeroinitializer
262 br label %vector.body
263
264vector.body: ; preds = %vector.body, %vector.ph
265 %index = phi i32 [ 0, %vector.ph ], [ %index.next, %vector.body ]
266 %1 = getelementptr inbounds float, float* %A, i32 %index
267 %2 = bitcast float* %1 to <4 x float>*
268 %wide.load = load <4 x float>, <4 x float>* %2, align 4
269 %3 = fsub fast <4 x float> %broadcast.splat11, %wide.load
270 %4 = getelementptr inbounds float, float* %C, i32 %index
271 %5 = bitcast float* %4 to <4 x float>*
272 store <4 x float> %3, <4 x float>* %5, align 4
273 %index.next = add i32 %index, 4
274 %6 = icmp eq i32 %index.next, %n
275 br i1 %6, label %for.cond.cleanup, label %vector.body
276
277for.cond.cleanup: ; preds = %vector.body, %entry
278 ret void
279}
280
281
282define arm_aapcs_vfpcc void @test_fmas(float* noalias nocapture readonly %A, float* noalias nocapture readonly %B, float %C, float* noalias nocapture %D, i32 %n) {
283; CHECK-LABEL: test_fmas:
284; CHECK: @ %bb.0: @ %entry
285; CHECK-NEXT: cmp r3, #1
286; CHECK-NEXT: it lt
287; CHECK-NEXT: bxlt lr
Sam Parkera3e41d42020-08-27 07:09:25 +0100288; CHECK-NEXT: .LBB6_1: @ %vector.ph
David Green9cf920e2020-03-20 08:25:19 +0000289; CHECK-NEXT: vmov r12, s0
Sam Parkera3e41d42020-08-27 07:09:25 +0100290; CHECK-NEXT: .LBB6_2: @ %vector.body
David Green9cf920e2020-03-20 08:25:19 +0000291; CHECK-NEXT: @ =>This Inner Loop Header: Depth=1
David Green37b9cc82020-03-25 11:35:53 +0000292; CHECK-NEXT: vldrw.u32 q0, [r0], #16
293; CHECK-NEXT: vldrw.u32 q1, [r1], #16
David Green9cf920e2020-03-20 08:25:19 +0000294; CHECK-NEXT: subs r3, #4
David Green37b9cc82020-03-25 11:35:53 +0000295; CHECK-NEXT: vfmas.f32 q1, q0, r12
296; CHECK-NEXT: vstrb.8 q1, [r2], #16
Sam Parkera3e41d42020-08-27 07:09:25 +0100297; CHECK-NEXT: bne .LBB6_2
298; CHECK-NEXT: @ %bb.3: @ %for.cond.cleanup
David Green9cf920e2020-03-20 08:25:19 +0000299; CHECK-NEXT: bx lr
300entry:
301 %0 = and i32 %n, 7
302 %cmp = icmp eq i32 %0, 0
303 tail call void @llvm.assume(i1 %cmp)
304 %cmp110 = icmp sgt i32 %n, 0
305 br i1 %cmp110, label %vector.ph, label %for.cond.cleanup
306
307vector.ph: ; preds = %entry
308 %broadcast.splatinsert13 = insertelement <4 x float> undef, float %C, i32 0
309 %broadcast.splat14 = shufflevector <4 x float> %broadcast.splatinsert13, <4 x float> undef, <4 x i32> zeroinitializer
310 br label %vector.body
311
312vector.body: ; preds = %vector.body, %vector.ph
313 %index = phi i32 [ 0, %vector.ph ], [ %index.next, %vector.body ]
314 %1 = getelementptr inbounds float, float* %A, i32 %index
315 %2 = bitcast float* %1 to <4 x float>*
316 %wide.load = load <4 x float>, <4 x float>* %2, align 4
317 %3 = getelementptr inbounds float, float* %B, i32 %index
318 %4 = bitcast float* %3 to <4 x float>*
319 %wide.load12 = load <4 x float>, <4 x float>* %4, align 4
320 %5 = fmul fast <4 x float> %wide.load12, %wide.load
321 %6 = fadd fast <4 x float> %5, %broadcast.splat14
322 %7 = getelementptr inbounds float, float* %D, i32 %index
323 %8 = bitcast float* %7 to <4 x float>*
324 store <4 x float> %6, <4 x float>* %8, align 4
325 %index.next = add i32 %index, 4
326 %9 = icmp eq i32 %index.next, %n
327 br i1 %9, label %for.cond.cleanup, label %vector.body
328
329for.cond.cleanup: ; preds = %vector.body, %entry
330 ret void
331}
332
333define arm_aapcs_vfpcc void @test_fmas_r(float* noalias nocapture readonly %A, float* noalias nocapture readonly %B, float %C, float* noalias nocapture %D, i32 %n) {
334; CHECK-LABEL: test_fmas_r:
335; CHECK: @ %bb.0: @ %entry
336; CHECK-NEXT: cmp r3, #1
337; CHECK-NEXT: it lt
338; CHECK-NEXT: bxlt lr
Sam Parkera3e41d42020-08-27 07:09:25 +0100339; CHECK-NEXT: .LBB7_1: @ %vector.ph
David Green9cf920e2020-03-20 08:25:19 +0000340; CHECK-NEXT: vmov r12, s0
Sam Parkera3e41d42020-08-27 07:09:25 +0100341; CHECK-NEXT: .LBB7_2: @ %vector.body
David Green9cf920e2020-03-20 08:25:19 +0000342; CHECK-NEXT: @ =>This Inner Loop Header: Depth=1
David Green37b9cc82020-03-25 11:35:53 +0000343; CHECK-NEXT: vldrw.u32 q0, [r0], #16
344; CHECK-NEXT: vldrw.u32 q1, [r1], #16
David Green9cf920e2020-03-20 08:25:19 +0000345; CHECK-NEXT: subs r3, #4
David Green37b9cc82020-03-25 11:35:53 +0000346; CHECK-NEXT: vfmas.f32 q1, q0, r12
347; CHECK-NEXT: vstrb.8 q1, [r2], #16
Sam Parkera3e41d42020-08-27 07:09:25 +0100348; CHECK-NEXT: bne .LBB7_2
349; CHECK-NEXT: @ %bb.3: @ %for.cond.cleanup
David Green9cf920e2020-03-20 08:25:19 +0000350; CHECK-NEXT: bx lr
351entry:
352 %0 = and i32 %n, 7
353 %cmp = icmp eq i32 %0, 0
354 tail call void @llvm.assume(i1 %cmp)
355 %cmp110 = icmp sgt i32 %n, 0
356 br i1 %cmp110, label %vector.ph, label %for.cond.cleanup
357
358vector.ph: ; preds = %entry
359 %broadcast.splatinsert13 = insertelement <4 x float> undef, float %C, i32 0
360 %broadcast.splat14 = shufflevector <4 x float> %broadcast.splatinsert13, <4 x float> undef, <4 x i32> zeroinitializer
361 br label %vector.body
362
363vector.body: ; preds = %vector.body, %vector.ph
364 %index = phi i32 [ 0, %vector.ph ], [ %index.next, %vector.body ]
365 %1 = getelementptr inbounds float, float* %A, i32 %index
366 %2 = bitcast float* %1 to <4 x float>*
367 %wide.load = load <4 x float>, <4 x float>* %2, align 4
368 %3 = getelementptr inbounds float, float* %B, i32 %index
369 %4 = bitcast float* %3 to <4 x float>*
370 %wide.load12 = load <4 x float>, <4 x float>* %4, align 4
371 %5 = fmul fast <4 x float> %wide.load12, %wide.load
372 %6 = fadd fast <4 x float> %broadcast.splat14, %5
373 %7 = getelementptr inbounds float, float* %D, i32 %index
374 %8 = bitcast float* %7 to <4 x float>*
375 store <4 x float> %6, <4 x float>* %8, align 4
376 %index.next = add i32 %index, 4
377 %9 = icmp eq i32 %index.next, %n
378 br i1 %9, label %for.cond.cleanup, label %vector.body
379
380for.cond.cleanup: ; preds = %vector.body, %entry
381 ret void
382}
383
384define arm_aapcs_vfpcc void @test_fma(float* noalias nocapture readonly %A, float* noalias nocapture readonly %B, float %C, float* noalias nocapture %D, i32 %n) {
385; CHECK-LABEL: test_fma:
386; CHECK: @ %bb.0: @ %entry
387; CHECK-NEXT: cmp r3, #1
388; CHECK-NEXT: it lt
389; CHECK-NEXT: bxlt lr
Sam Parkera3e41d42020-08-27 07:09:25 +0100390; CHECK-NEXT: .LBB8_1: @ %vector.ph
David Green9cf920e2020-03-20 08:25:19 +0000391; CHECK-NEXT: vmov r12, s0
Sam Parkera3e41d42020-08-27 07:09:25 +0100392; CHECK-NEXT: .LBB8_2: @ %vector.body
David Green9cf920e2020-03-20 08:25:19 +0000393; CHECK-NEXT: @ =>This Inner Loop Header: Depth=1
David Green37b9cc82020-03-25 11:35:53 +0000394; CHECK-NEXT: vldrw.u32 q0, [r0], #16
395; CHECK-NEXT: vldrw.u32 q1, [r1], #16
David Green9cf920e2020-03-20 08:25:19 +0000396; CHECK-NEXT: subs r3, #4
David Green37b9cc82020-03-25 11:35:53 +0000397; CHECK-NEXT: vfma.f32 q1, q0, r12
398; CHECK-NEXT: vstrb.8 q1, [r2], #16
Sam Parkera3e41d42020-08-27 07:09:25 +0100399; CHECK-NEXT: bne .LBB8_2
400; CHECK-NEXT: @ %bb.3: @ %for.cond.cleanup
David Green9cf920e2020-03-20 08:25:19 +0000401; CHECK-NEXT: bx lr
402entry:
403 %0 = and i32 %n, 7
404 %cmp = icmp eq i32 %0, 0
405 tail call void @llvm.assume(i1 %cmp)
406 %cmp110 = icmp sgt i32 %n, 0
407 br i1 %cmp110, label %vector.ph, label %for.cond.cleanup
408
409vector.ph: ; preds = %entry
410 %broadcast.splatinsert12 = insertelement <4 x float> undef, float %C, i32 0
411 %broadcast.splat13 = shufflevector <4 x float> %broadcast.splatinsert12, <4 x float> undef, <4 x i32> zeroinitializer
412 br label %vector.body
413
414vector.body: ; preds = %vector.body, %vector.ph
415 %index = phi i32 [ 0, %vector.ph ], [ %index.next, %vector.body ]
416 %1 = getelementptr inbounds float, float* %A, i32 %index
417 %2 = bitcast float* %1 to <4 x float>*
418 %wide.load = load <4 x float>, <4 x float>* %2, align 4
419 %3 = fmul fast <4 x float> %wide.load, %broadcast.splat13
420 %4 = getelementptr inbounds float, float* %B, i32 %index
421 %5 = bitcast float* %4 to <4 x float>*
422 %wide.load14 = load <4 x float>, <4 x float>* %5, align 4
423 %6 = fadd fast <4 x float> %3, %wide.load14
424 %7 = getelementptr inbounds float, float* %D, i32 %index
425 %8 = bitcast float* %7 to <4 x float>*
426 store <4 x float> %6, <4 x float>* %8, align 4
427 %index.next = add i32 %index, 4
428 %9 = icmp eq i32 %index.next, %n
429 br i1 %9, label %for.cond.cleanup, label %vector.body
430
431for.cond.cleanup: ; preds = %vector.body, %entry
432 ret void
433}
434
435define arm_aapcs_vfpcc void @test_fma_r(float* noalias nocapture readonly %A, float* noalias nocapture readonly %B, float %C, float* noalias nocapture %D, i32 %n) {
436; CHECK-LABEL: test_fma_r:
437; CHECK: @ %bb.0: @ %entry
438; CHECK-NEXT: cmp r3, #1
439; CHECK-NEXT: it lt
440; CHECK-NEXT: bxlt lr
Sam Parkera3e41d42020-08-27 07:09:25 +0100441; CHECK-NEXT: .LBB9_1: @ %vector.ph
David Green9cf920e2020-03-20 08:25:19 +0000442; CHECK-NEXT: vmov r12, s0
Sam Parkera3e41d42020-08-27 07:09:25 +0100443; CHECK-NEXT: .LBB9_2: @ %vector.body
David Green9cf920e2020-03-20 08:25:19 +0000444; CHECK-NEXT: @ =>This Inner Loop Header: Depth=1
David Green37b9cc82020-03-25 11:35:53 +0000445; CHECK-NEXT: vldrw.u32 q0, [r0], #16
446; CHECK-NEXT: vldrw.u32 q1, [r1], #16
David Green9cf920e2020-03-20 08:25:19 +0000447; CHECK-NEXT: subs r3, #4
David Green37b9cc82020-03-25 11:35:53 +0000448; CHECK-NEXT: vfma.f32 q1, q0, r12
449; CHECK-NEXT: vstrb.8 q1, [r2], #16
Sam Parkera3e41d42020-08-27 07:09:25 +0100450; CHECK-NEXT: bne .LBB9_2
451; CHECK-NEXT: @ %bb.3: @ %for.cond.cleanup
David Green9cf920e2020-03-20 08:25:19 +0000452; CHECK-NEXT: bx lr
453entry:
454 %0 = and i32 %n, 7
455 %cmp = icmp eq i32 %0, 0
456 tail call void @llvm.assume(i1 %cmp)
457 %cmp110 = icmp sgt i32 %n, 0
458 br i1 %cmp110, label %vector.ph, label %for.cond.cleanup
459
460vector.ph: ; preds = %entry
461 %broadcast.splatinsert12 = insertelement <4 x float> undef, float %C, i32 0
462 %broadcast.splat13 = shufflevector <4 x float> %broadcast.splatinsert12, <4 x float> undef, <4 x i32> zeroinitializer
463 br label %vector.body
464
465vector.body: ; preds = %vector.body, %vector.ph
466 %index = phi i32 [ 0, %vector.ph ], [ %index.next, %vector.body ]
467 %1 = getelementptr inbounds float, float* %A, i32 %index
468 %2 = bitcast float* %1 to <4 x float>*
469 %wide.load = load <4 x float>, <4 x float>* %2, align 4
470 %3 = fmul fast <4 x float> %broadcast.splat13, %wide.load
471 %4 = getelementptr inbounds float, float* %B, i32 %index
472 %5 = bitcast float* %4 to <4 x float>*
473 %wide.load14 = load <4 x float>, <4 x float>* %5, align 4
474 %6 = fadd fast <4 x float> %3, %wide.load14
475 %7 = getelementptr inbounds float, float* %D, i32 %index
476 %8 = bitcast float* %7 to <4 x float>*
477 store <4 x float> %6, <4 x float>* %8, align 4
478 %index.next = add i32 %index, 4
479 %9 = icmp eq i32 %index.next, %n
480 br i1 %9, label %for.cond.cleanup, label %vector.body
481
482for.cond.cleanup: ; preds = %vector.body, %entry
483 ret void
484}
485
486
487define arm_aapcs_vfpcc void @test_fmss(float* noalias nocapture readonly %A, float* noalias nocapture readonly %B, float %C, float* noalias nocapture %D, i32 %n) {
488; CHECK-LABEL: test_fmss:
489; CHECK: @ %bb.0: @ %entry
490; CHECK-NEXT: cmp r3, #1
491; CHECK-NEXT: it lt
492; CHECK-NEXT: bxlt lr
Sam Parkera3e41d42020-08-27 07:09:25 +0100493; CHECK-NEXT: .LBB10_1: @ %vector.ph
David Green9cf920e2020-03-20 08:25:19 +0000494; CHECK-NEXT: vmov r12, s0
495; CHECK-NEXT: vdup.32 q0, r12
496; CHECK-NEXT: vneg.f32 q0, q0
Sam Parkera3e41d42020-08-27 07:09:25 +0100497; CHECK-NEXT: .LBB10_2: @ %vector.body
David Green9cf920e2020-03-20 08:25:19 +0000498; CHECK-NEXT: @ =>This Inner Loop Header: Depth=1
499; CHECK-NEXT: vldrw.u32 q1, [r0], #16
500; CHECK-NEXT: vldrw.u32 q2, [r1], #16
501; CHECK-NEXT: vmov q3, q0
502; CHECK-NEXT: subs r3, #4
503; CHECK-NEXT: vfma.f32 q3, q2, q1
504; CHECK-NEXT: vstrb.8 q3, [r2], #16
Sam Parkera3e41d42020-08-27 07:09:25 +0100505; CHECK-NEXT: bne .LBB10_2
506; CHECK-NEXT: @ %bb.3: @ %for.cond.cleanup
David Green9cf920e2020-03-20 08:25:19 +0000507; CHECK-NEXT: bx lr
508entry:
509 %0 = and i32 %n, 7
510 %cmp = icmp eq i32 %0, 0
511 tail call void @llvm.assume(i1 %cmp)
512 %cmp110 = icmp sgt i32 %n, 0
513 br i1 %cmp110, label %vector.ph, label %for.cond.cleanup
514
515vector.ph: ; preds = %entry
516 %broadcast.splatinsert13 = insertelement <4 x float> undef, float %C, i32 0
517 %broadcast.splat14 = shufflevector <4 x float> %broadcast.splatinsert13, <4 x float> undef, <4 x i32> zeroinitializer
518 br label %vector.body
519
520vector.body: ; preds = %vector.body, %vector.ph
521 %index = phi i32 [ 0, %vector.ph ], [ %index.next, %vector.body ]
522 %1 = getelementptr inbounds float, float* %A, i32 %index
523 %2 = bitcast float* %1 to <4 x float>*
524 %wide.load = load <4 x float>, <4 x float>* %2, align 4
525 %3 = getelementptr inbounds float, float* %B, i32 %index
526 %4 = bitcast float* %3 to <4 x float>*
527 %wide.load12 = load <4 x float>, <4 x float>* %4, align 4
528 %5 = fmul fast <4 x float> %wide.load12, %wide.load
529 %6 = fsub fast <4 x float> %5, %broadcast.splat14
530 %7 = getelementptr inbounds float, float* %D, i32 %index
531 %8 = bitcast float* %7 to <4 x float>*
532 store <4 x float> %6, <4 x float>* %8, align 4
533 %index.next = add i32 %index, 4
534 %9 = icmp eq i32 %index.next, %n
535 br i1 %9, label %for.cond.cleanup, label %vector.body
536
537for.cond.cleanup: ; preds = %vector.body, %entry
538 ret void
539}
540
541define arm_aapcs_vfpcc void @test_fmss_r(float* noalias nocapture readonly %A, float* noalias nocapture readonly %B, float %C, float* noalias nocapture %D, i32 %n) {
542; CHECK-LABEL: test_fmss_r:
543; CHECK: @ %bb.0: @ %entry
544; CHECK-NEXT: cmp r3, #1
545; CHECK-NEXT: it lt
546; CHECK-NEXT: bxlt lr
Sam Parkera3e41d42020-08-27 07:09:25 +0100547; CHECK-NEXT: .LBB11_1: @ %vector.ph
David Green9cf920e2020-03-20 08:25:19 +0000548; CHECK-NEXT: vmov r12, s0
549; CHECK-NEXT: vdup.32 q0, r12
Sam Parkera3e41d42020-08-27 07:09:25 +0100550; CHECK-NEXT: .LBB11_2: @ %vector.body
David Green9cf920e2020-03-20 08:25:19 +0000551; CHECK-NEXT: @ =>This Inner Loop Header: Depth=1
552; CHECK-NEXT: vldrw.u32 q1, [r0], #16
553; CHECK-NEXT: vldrw.u32 q2, [r1], #16
554; CHECK-NEXT: vmov q3, q0
555; CHECK-NEXT: subs r3, #4
556; CHECK-NEXT: vfms.f32 q3, q2, q1
557; CHECK-NEXT: vstrb.8 q3, [r2], #16
Sam Parkera3e41d42020-08-27 07:09:25 +0100558; CHECK-NEXT: bne .LBB11_2
559; CHECK-NEXT: @ %bb.3: @ %for.cond.cleanup
David Green9cf920e2020-03-20 08:25:19 +0000560; CHECK-NEXT: bx lr
561entry:
562 %0 = and i32 %n, 7
563 %cmp = icmp eq i32 %0, 0
564 tail call void @llvm.assume(i1 %cmp)
565 %cmp110 = icmp sgt i32 %n, 0
566 br i1 %cmp110, label %vector.ph, label %for.cond.cleanup
567
568vector.ph: ; preds = %entry
569 %broadcast.splatinsert13 = insertelement <4 x float> undef, float %C, i32 0
570 %broadcast.splat14 = shufflevector <4 x float> %broadcast.splatinsert13, <4 x float> undef, <4 x i32> zeroinitializer
571 br label %vector.body
572
573vector.body: ; preds = %vector.body, %vector.ph
574 %index = phi i32 [ 0, %vector.ph ], [ %index.next, %vector.body ]
575 %1 = getelementptr inbounds float, float* %A, i32 %index
576 %2 = bitcast float* %1 to <4 x float>*
577 %wide.load = load <4 x float>, <4 x float>* %2, align 4
578 %3 = getelementptr inbounds float, float* %B, i32 %index
579 %4 = bitcast float* %3 to <4 x float>*
580 %wide.load12 = load <4 x float>, <4 x float>* %4, align 4
581 %5 = fmul fast <4 x float> %wide.load12, %wide.load
582 %6 = fsub fast <4 x float> %broadcast.splat14, %5
583 %7 = getelementptr inbounds float, float* %D, i32 %index
584 %8 = bitcast float* %7 to <4 x float>*
585 store <4 x float> %6, <4 x float>* %8, align 4
586 %index.next = add i32 %index, 4
587 %9 = icmp eq i32 %index.next, %n
588 br i1 %9, label %for.cond.cleanup, label %vector.body
589
590for.cond.cleanup: ; preds = %vector.body, %entry
591 ret void
592}
593
594define arm_aapcs_vfpcc void @test_fms(float* noalias nocapture readonly %A, float* noalias nocapture readonly %B, float %C, float* noalias nocapture %D, i32 %n) {
595; CHECK-LABEL: test_fms:
596; CHECK: @ %bb.0: @ %entry
597; CHECK-NEXT: cmp r3, #1
598; CHECK-NEXT: it lt
599; CHECK-NEXT: bxlt lr
Sam Parkera3e41d42020-08-27 07:09:25 +0100600; CHECK-NEXT: .LBB12_1: @ %vector.ph
David Green9cf920e2020-03-20 08:25:19 +0000601; CHECK-NEXT: vmov r12, s0
Sam Parkera3e41d42020-08-27 07:09:25 +0100602; CHECK-NEXT: .LBB12_2: @ %vector.body
David Green9cf920e2020-03-20 08:25:19 +0000603; CHECK-NEXT: @ =>This Inner Loop Header: Depth=1
David Green37b9cc82020-03-25 11:35:53 +0000604; CHECK-NEXT: vldrw.u32 q0, [r1], #16
605; CHECK-NEXT: vldrw.u32 q1, [r0], #16
David Green9cf920e2020-03-20 08:25:19 +0000606; CHECK-NEXT: subs r3, #4
David Green37b9cc82020-03-25 11:35:53 +0000607; CHECK-NEXT: vneg.f32 q0, q0
608; CHECK-NEXT: vfma.f32 q0, q1, r12
609; CHECK-NEXT: vstrb.8 q0, [r2], #16
Sam Parkera3e41d42020-08-27 07:09:25 +0100610; CHECK-NEXT: bne .LBB12_2
611; CHECK-NEXT: @ %bb.3: @ %for.cond.cleanup
David Green9cf920e2020-03-20 08:25:19 +0000612; CHECK-NEXT: bx lr
613entry:
614 %0 = and i32 %n, 7
615 %cmp = icmp eq i32 %0, 0
616 tail call void @llvm.assume(i1 %cmp)
617 %cmp110 = icmp sgt i32 %n, 0
618 br i1 %cmp110, label %vector.ph, label %for.cond.cleanup
619
620vector.ph: ; preds = %entry
621 %broadcast.splatinsert12 = insertelement <4 x float> undef, float %C, i32 0
622 %broadcast.splat13 = shufflevector <4 x float> %broadcast.splatinsert12, <4 x float> undef, <4 x i32> zeroinitializer
623 br label %vector.body
624
625vector.body: ; preds = %vector.body, %vector.ph
626 %index = phi i32 [ 0, %vector.ph ], [ %index.next, %vector.body ]
627 %1 = getelementptr inbounds float, float* %A, i32 %index
628 %2 = bitcast float* %1 to <4 x float>*
629 %wide.load = load <4 x float>, <4 x float>* %2, align 4
630 %3 = fmul fast <4 x float> %wide.load, %broadcast.splat13
631 %4 = getelementptr inbounds float, float* %B, i32 %index
632 %5 = bitcast float* %4 to <4 x float>*
633 %wide.load14 = load <4 x float>, <4 x float>* %5, align 4
634 %6 = fsub fast <4 x float> %3, %wide.load14
635 %7 = getelementptr inbounds float, float* %D, i32 %index
636 %8 = bitcast float* %7 to <4 x float>*
637 store <4 x float> %6, <4 x float>* %8, align 4
638 %index.next = add i32 %index, 4
639 %9 = icmp eq i32 %index.next, %n
640 br i1 %9, label %for.cond.cleanup, label %vector.body
641
642for.cond.cleanup: ; preds = %vector.body, %entry
643 ret void
644}
645
646define arm_aapcs_vfpcc void @test_fms_r(float* noalias nocapture readonly %A, float* noalias nocapture readonly %B, float %C, float* noalias nocapture %D, i32 %n) {
647; CHECK-LABEL: test_fms_r:
648; CHECK: @ %bb.0: @ %entry
649; CHECK-NEXT: cmp r3, #1
650; CHECK-NEXT: it lt
651; CHECK-NEXT: bxlt lr
Sam Parkera3e41d42020-08-27 07:09:25 +0100652; CHECK-NEXT: .LBB13_1: @ %vector.ph
David Green9cf920e2020-03-20 08:25:19 +0000653; CHECK-NEXT: vmov r12, s0
Sam Parkera3e41d42020-08-27 07:09:25 +0100654; CHECK-NEXT: .LBB13_2: @ %vector.body
David Green9cf920e2020-03-20 08:25:19 +0000655; CHECK-NEXT: @ =>This Inner Loop Header: Depth=1
David Green37b9cc82020-03-25 11:35:53 +0000656; CHECK-NEXT: vldrw.u32 q0, [r1], #16
657; CHECK-NEXT: vldrw.u32 q1, [r0], #16
David Green9cf920e2020-03-20 08:25:19 +0000658; CHECK-NEXT: subs r3, #4
David Green37b9cc82020-03-25 11:35:53 +0000659; CHECK-NEXT: vneg.f32 q0, q0
660; CHECK-NEXT: vfma.f32 q0, q1, r12
661; CHECK-NEXT: vstrb.8 q0, [r2], #16
Sam Parkera3e41d42020-08-27 07:09:25 +0100662; CHECK-NEXT: bne .LBB13_2
663; CHECK-NEXT: @ %bb.3: @ %for.cond.cleanup
David Green9cf920e2020-03-20 08:25:19 +0000664; CHECK-NEXT: bx lr
665entry:
666 %0 = and i32 %n, 7
667 %cmp = icmp eq i32 %0, 0
668 tail call void @llvm.assume(i1 %cmp)
669 %cmp110 = icmp sgt i32 %n, 0
670 br i1 %cmp110, label %vector.ph, label %for.cond.cleanup
671
672vector.ph: ; preds = %entry
673 %broadcast.splatinsert12 = insertelement <4 x float> undef, float %C, i32 0
674 %broadcast.splat13 = shufflevector <4 x float> %broadcast.splatinsert12, <4 x float> undef, <4 x i32> zeroinitializer
675 br label %vector.body
676
677vector.body: ; preds = %vector.body, %vector.ph
678 %index = phi i32 [ 0, %vector.ph ], [ %index.next, %vector.body ]
679 %1 = getelementptr inbounds float, float* %A, i32 %index
680 %2 = bitcast float* %1 to <4 x float>*
681 %wide.load = load <4 x float>, <4 x float>* %2, align 4
682 %3 = fmul fast <4 x float> %broadcast.splat13, %wide.load
683 %4 = getelementptr inbounds float, float* %B, i32 %index
684 %5 = bitcast float* %4 to <4 x float>*
685 %wide.load14 = load <4 x float>, <4 x float>* %5, align 4
686 %6 = fsub fast <4 x float> %3, %wide.load14
687 %7 = getelementptr inbounds float, float* %D, i32 %index
688 %8 = bitcast float* %7 to <4 x float>*
689 store <4 x float> %6, <4 x float>* %8, align 4
690 %index.next = add i32 %index, 4
691 %9 = icmp eq i32 %index.next, %n
692 br i1 %9, label %for.cond.cleanup, label %vector.body
693
694for.cond.cleanup: ; preds = %vector.body, %entry
695 ret void
696}
697
698
699define dso_local void @test_nested(float* noalias nocapture %pInT1, float* noalias nocapture readonly %pOutT1, float* noalias nocapture readonly %pPRT_in, float* noalias nocapture readnone %pPRT_pDst, i32 %numRows, i32 %numCols, i32 %l, float %in) local_unnamed_addr #0 {
700; CHECK-LABEL: test_nested:
701; CHECK: @ %bb.0: @ %for.body.us.preheader
David Green076e08a2020-05-29 10:53:30 +0100702; CHECK-NEXT: .save {r4, r5, r6, lr}
703; CHECK-NEXT: push {r4, r5, r6, lr}
704; CHECK-NEXT: ldrd lr, r12, [sp, #16]
David Green9cf920e2020-03-20 08:25:19 +0000705; CHECK-NEXT: lsl.w r3, r12, #2
706; CHECK-NEXT: dls lr, lr
707; CHECK-NEXT: .LBB14_1: @ %for.body.us
708; CHECK-NEXT: @ =>This Loop Header: Depth=1
709; CHECK-NEXT: @ Child Loop BB14_2 Depth 2
David Greenb3499f52020-03-20 09:23:57 +0000710; CHECK-NEXT: ldr r4, [r1]
David Green076e08a2020-05-29 10:53:30 +0100711; CHECK-NEXT: mov r5, r2
712; CHECK-NEXT: mov r6, r12
David Green9cf920e2020-03-20 08:25:19 +0000713; CHECK-NEXT: vdup.32 q0, r4
David Green076e08a2020-05-29 10:53:30 +0100714; CHECK-NEXT: mov r4, r0
David Green9cf920e2020-03-20 08:25:19 +0000715; CHECK-NEXT: .LBB14_2: @ %vector.body
716; CHECK-NEXT: @ Parent Loop BB14_1 Depth=1
717; CHECK-NEXT: @ => This Inner Loop Header: Depth=2
David Green076e08a2020-05-29 10:53:30 +0100718; CHECK-NEXT: vldrw.u32 q1, [r5], #16
719; CHECK-NEXT: vldrw.u32 q2, [r4]
720; CHECK-NEXT: subs r6, #4
David Green9cf920e2020-03-20 08:25:19 +0000721; CHECK-NEXT: vfms.f32 q2, q1, q0
David Green076e08a2020-05-29 10:53:30 +0100722; CHECK-NEXT: vstrb.8 q2, [r4], #16
David Green9cf920e2020-03-20 08:25:19 +0000723; CHECK-NEXT: bne .LBB14_2
724; CHECK-NEXT: @ %bb.3: @ %for.cond6.for.end_crit_edge.us
725; CHECK-NEXT: @ in Loop: Header=BB14_1 Depth=1
726; CHECK-NEXT: add r0, r3
727; CHECK-NEXT: add r2, r3
728; CHECK-NEXT: adds r1, #4
729; CHECK-NEXT: le lr, .LBB14_1
730; CHECK-NEXT: @ %bb.4: @ %for.end14
David Green076e08a2020-05-29 10:53:30 +0100731; CHECK-NEXT: pop {r4, r5, r6, pc}
David Green9cf920e2020-03-20 08:25:19 +0000732for.body.us.preheader:
733 %cmp = icmp sgt i32 %numRows, 0
734 tail call void @llvm.assume(i1 %cmp)
735 %cmp1 = icmp sgt i32 %numCols, 0
736 tail call void @llvm.assume(i1 %cmp1)
737 %rem = and i32 %numCols, 7
738 %cmp2 = icmp eq i32 %rem, 0
739 tail call void @llvm.assume(i1 %cmp2)
740 %cmp3 = icmp slt i32 %l, %numCols
741 tail call void @llvm.assume(i1 %cmp3)
742 br label %for.body.us
743
744for.body.us: ; preds = %for.cond6.for.end_crit_edge.us, %for.body.us.preheader
745 %pInT1.addr.038.us = phi float* [ %scevgep40, %for.cond6.for.end_crit_edge.us ], [ %pInT1, %for.body.us.preheader ]
746 %i.037.us = phi i32 [ %inc13.us, %for.cond6.for.end_crit_edge.us ], [ 0, %for.body.us.preheader ]
747 %pOutT1.addr.036.us = phi float* [ %incdec.ptr.us, %for.cond6.for.end_crit_edge.us ], [ %pOutT1, %for.body.us.preheader ]
748 %pPRT_in.addr.035.us = phi float* [ %scevgep, %for.cond6.for.end_crit_edge.us ], [ %pPRT_in, %for.body.us.preheader ]
749 %scevgep = getelementptr float, float* %pPRT_in.addr.035.us, i32 %numCols
750 %0 = load float, float* %pOutT1.addr.036.us, align 4
751 %broadcast.splatinsert47 = insertelement <4 x float> undef, float %0, i32 0
752 %broadcast.splat48 = shufflevector <4 x float> %broadcast.splatinsert47, <4 x float> undef, <4 x i32> zeroinitializer
753 br label %vector.body
754
755vector.body: ; preds = %vector.body, %for.body.us
756 %index = phi i32 [ 0, %for.body.us ], [ %index.next, %vector.body ]
757 %next.gep = getelementptr float, float* %pInT1.addr.038.us, i32 %index
758 %next.gep45 = getelementptr float, float* %pPRT_in.addr.035.us, i32 %index
759 %1 = bitcast float* %next.gep to <4 x float>*
760 %wide.load = load <4 x float>, <4 x float>* %1, align 4
761 %2 = bitcast float* %next.gep45 to <4 x float>*
762 %wide.load46 = load <4 x float>, <4 x float>* %2, align 4
763 %3 = fmul fast <4 x float> %wide.load46, %broadcast.splat48
764 %4 = fsub fast <4 x float> %wide.load, %3
765 store <4 x float> %4, <4 x float>* %1, align 4
766 %index.next = add i32 %index, 4
767 %5 = icmp eq i32 %index.next, %numCols
768 br i1 %5, label %for.cond6.for.end_crit_edge.us, label %vector.body
769
770for.cond6.for.end_crit_edge.us: ; preds = %vector.body
771 %incdec.ptr.us = getelementptr inbounds float, float* %pOutT1.addr.036.us, i32 1
772 %scevgep40 = getelementptr float, float* %pInT1.addr.038.us, i32 %numCols
773 %inc13.us = add nuw nsw i32 %i.037.us, 1
774 %exitcond41 = icmp eq i32 %inc13.us, %numRows
775 br i1 %exitcond41, label %for.end14, label %for.body.us
776
777for.end14: ; preds = %for.cond6.for.end_crit_edge.us
778 ret void
779}
780
781%struct.arm_fir_instance_f32 = type { i16, float*, float* }
782define void @arm_fir_f32_1_4_mve(%struct.arm_fir_instance_f32* nocapture readonly %S, float* nocapture readonly %pSrc, float* %pDst, i32 %blockSize) {
783; CHECK-LABEL: arm_fir_f32_1_4_mve:
784; CHECK: @ %bb.0: @ %entry
David Green37b9cc82020-03-25 11:35:53 +0000785; CHECK-NEXT: .save {r4, r5, r6, r7, r8, r9, r10, r11, lr}
786; CHECK-NEXT: push.w {r4, r5, r6, r7, r8, r9, r10, r11, lr}
David Green076e08a2020-05-29 10:53:30 +0100787; CHECK-NEXT: .pad #8
788; CHECK-NEXT: sub sp, #8
789; CHECK-NEXT: ldrh.w r9, [r0]
790; CHECK-NEXT: mov r11, r1
David Greenfa152552020-05-13 14:35:32 +0100791; CHECK-NEXT: ldr.w r12, [r0, #4]
David Green076e08a2020-05-29 10:53:30 +0100792; CHECK-NEXT: sub.w r1, r9, #1
793; CHECK-NEXT: cmp r1, #3
David Green9cf920e2020-03-20 08:25:19 +0000794; CHECK-NEXT: bhi .LBB15_6
795; CHECK-NEXT: @ %bb.1: @ %if.then
David Greenfa152552020-05-13 14:35:32 +0100796; CHECK-NEXT: ldr r4, [r0, #8]
David Green076e08a2020-05-29 10:53:30 +0100797; CHECK-NEXT: lsr.w lr, r3, #2
798; CHECK-NEXT: ldrd r7, r6, [r4]
799; CHECK-NEXT: ldrd r5, r8, [r4, #8]
800; CHECK-NEXT: add.w r4, r12, r1, lsl #2
David Green9cf920e2020-03-20 08:25:19 +0000801; CHECK-NEXT: wls lr, lr, .LBB15_5
802; CHECK-NEXT: @ %bb.2: @ %while.body.lr.ph
David Green076e08a2020-05-29 10:53:30 +0100803; CHECK-NEXT: bic r1, r3, #3
804; CHECK-NEXT: str r1, [sp] @ 4-byte Spill
805; CHECK-NEXT: add.w r10, r12, #4
806; CHECK-NEXT: add.w r1, r2, r1, lsl #2
807; CHECK-NEXT: str r1, [sp, #4] @ 4-byte Spill
808; CHECK-NEXT: mov r1, r11
David Green9cf920e2020-03-20 08:25:19 +0000809; CHECK-NEXT: .LBB15_3: @ %while.body
810; CHECK-NEXT: @ =>This Inner Loop Header: Depth=1
David Green076e08a2020-05-29 10:53:30 +0100811; CHECK-NEXT: vldrw.u32 q0, [r1], #16
812; CHECK-NEXT: vstrb.8 q0, [r4], #16
813; CHECK-NEXT: vldrw.u32 q0, [r10, #-4]
814; CHECK-NEXT: vldrw.u32 q1, [r10], #16
David Greenfa152552020-05-13 14:35:32 +0100815; CHECK-NEXT: vmul.f32 q0, q0, r7
David Green076e08a2020-05-29 10:53:30 +0100816; CHECK-NEXT: vldrw.u32 q2, [r10, #-8]
817; CHECK-NEXT: vfma.f32 q0, q1, r6
818; CHECK-NEXT: vldrw.u32 q1, [r10, #-12]
819; CHECK-NEXT: vfma.f32 q0, q1, r5
820; CHECK-NEXT: vfma.f32 q0, q2, r8
821; CHECK-NEXT: vstrb.8 q0, [r2], #16
David Green9cf920e2020-03-20 08:25:19 +0000822; CHECK-NEXT: le lr, .LBB15_3
823; CHECK-NEXT: @ %bb.4: @ %while.end.loopexit
David Green076e08a2020-05-29 10:53:30 +0100824; CHECK-NEXT: ldr r1, [sp] @ 4-byte Reload
825; CHECK-NEXT: ldr r2, [sp, #4] @ 4-byte Reload
826; CHECK-NEXT: add.w r12, r12, r1, lsl #2
827; CHECK-NEXT: add.w r11, r11, r1, lsl #2
David Green9cf920e2020-03-20 08:25:19 +0000828; CHECK-NEXT: .LBB15_5: @ %while.end
David Green076e08a2020-05-29 10:53:30 +0100829; CHECK-NEXT: and r1, r3, #3
830; CHECK-NEXT: vldrw.u32 q0, [r11]
831; CHECK-NEXT: vctp.32 r1
David Green9cf920e2020-03-20 08:25:19 +0000832; CHECK-NEXT: vpst
David Greenfa152552020-05-13 14:35:32 +0100833; CHECK-NEXT: vstrwt.32 q0, [r4]
834; CHECK-NEXT: vldrw.u32 q0, [r12]
835; CHECK-NEXT: vldrw.u32 q1, [r12, #4]
David Green37b9cc82020-03-25 11:35:53 +0000836; CHECK-NEXT: vmul.f32 q0, q0, r7
David Green076e08a2020-05-29 10:53:30 +0100837; CHECK-NEXT: vfma.f32 q0, q1, r6
David Greenfa152552020-05-13 14:35:32 +0100838; CHECK-NEXT: vldrw.u32 q1, [r12, #8]
David Green076e08a2020-05-29 10:53:30 +0100839; CHECK-NEXT: vfma.f32 q0, q1, r5
David Greenfa152552020-05-13 14:35:32 +0100840; CHECK-NEXT: vldrw.u32 q1, [r12, #12]
David Green076e08a2020-05-29 10:53:30 +0100841; CHECK-NEXT: vfma.f32 q0, q1, r8
David Green9cf920e2020-03-20 08:25:19 +0000842; CHECK-NEXT: vpst
David Green37b9cc82020-03-25 11:35:53 +0000843; CHECK-NEXT: vstrwt.32 q0, [r2]
David Greenfa152552020-05-13 14:35:32 +0100844; CHECK-NEXT: ldr.w r12, [r0, #4]
David Green9cf920e2020-03-20 08:25:19 +0000845; CHECK-NEXT: .LBB15_6: @ %if.end
David Green076e08a2020-05-29 10:53:30 +0100846; CHECK-NEXT: add.w r0, r12, r3, lsl #2
847; CHECK-NEXT: lsr.w lr, r9, #2
David Green9cf920e2020-03-20 08:25:19 +0000848; CHECK-NEXT: wls lr, lr, .LBB15_10
849; CHECK-NEXT: @ %bb.7: @ %while.body51.preheader
David Green076e08a2020-05-29 10:53:30 +0100850; CHECK-NEXT: bic r2, r9, #3
851; CHECK-NEXT: adds r1, r2, r3
David Greenfa152552020-05-13 14:35:32 +0100852; CHECK-NEXT: mov r3, r12
David Greenfa152552020-05-13 14:35:32 +0100853; CHECK-NEXT: add.w r1, r12, r1, lsl #2
David Green9cf920e2020-03-20 08:25:19 +0000854; CHECK-NEXT: .LBB15_8: @ %while.body51
855; CHECK-NEXT: @ =>This Inner Loop Header: Depth=1
856; CHECK-NEXT: vldrw.u32 q0, [r0], #16
857; CHECK-NEXT: vstrb.8 q0, [r3], #16
858; CHECK-NEXT: le lr, .LBB15_8
859; CHECK-NEXT: @ %bb.9: @ %while.end55.loopexit
David Greenfa152552020-05-13 14:35:32 +0100860; CHECK-NEXT: add.w r12, r12, r2, lsl #2
David Green9cf920e2020-03-20 08:25:19 +0000861; CHECK-NEXT: mov r0, r1
862; CHECK-NEXT: .LBB15_10: @ %while.end55
David Green076e08a2020-05-29 10:53:30 +0100863; CHECK-NEXT: ands r1, r9, #3
David Green9cf920e2020-03-20 08:25:19 +0000864; CHECK-NEXT: beq .LBB15_12
865; CHECK-NEXT: @ %bb.11: @ %if.then59
866; CHECK-NEXT: vldrw.u32 q0, [r0]
867; CHECK-NEXT: vctp.32 r1
868; CHECK-NEXT: vpst
David Greenfa152552020-05-13 14:35:32 +0100869; CHECK-NEXT: vstrwt.32 q0, [r12]
David Green9cf920e2020-03-20 08:25:19 +0000870; CHECK-NEXT: .LBB15_12: @ %if.end61
David Green076e08a2020-05-29 10:53:30 +0100871; CHECK-NEXT: add sp, #8
David Green37b9cc82020-03-25 11:35:53 +0000872; CHECK-NEXT: pop.w {r4, r5, r6, r7, r8, r9, r10, r11, pc}
David Green9cf920e2020-03-20 08:25:19 +0000873entry:
874 %pState1 = getelementptr inbounds %struct.arm_fir_instance_f32, %struct.arm_fir_instance_f32* %S, i32 0, i32 1
875 %0 = load float*, float** %pState1, align 4
876 %pCoeffs2 = getelementptr inbounds %struct.arm_fir_instance_f32, %struct.arm_fir_instance_f32* %S, i32 0, i32 2
877 %1 = load float*, float** %pCoeffs2, align 4
878 %numTaps3 = getelementptr inbounds %struct.arm_fir_instance_f32, %struct.arm_fir_instance_f32* %S, i32 0, i32 0
879 %2 = load i16, i16* %numTaps3, align 4
880 %conv = zext i16 %2 to i32
881 %sub = add nsw i32 %conv, -1
882 %cmp = icmp ult i32 %sub, 4
883 br i1 %cmp, label %if.then, label %if.end
884
885if.then: ; preds = %entry
886 %arrayidx = getelementptr inbounds float, float* %0, i32 %sub
887 %incdec.ptr = getelementptr inbounds float, float* %1, i32 1
888 %3 = load float, float* %1, align 4
889 %incdec.ptr6 = getelementptr inbounds float, float* %1, i32 2
890 %4 = load float, float* %incdec.ptr, align 4
891 %incdec.ptr7 = getelementptr inbounds float, float* %1, i32 3
892 %5 = load float, float* %incdec.ptr6, align 4
893 %6 = load float, float* %incdec.ptr7, align 4
894 %shr = lshr i32 %blockSize, 2
895 %cmp9146 = icmp eq i32 %shr, 0
896 %.pre161 = insertelement <4 x float> undef, float %3, i32 0
897 %.pre162 = shufflevector <4 x float> %.pre161, <4 x float> undef, <4 x i32> zeroinitializer
898 %.pre163 = insertelement <4 x float> undef, float %4, i32 0
899 %.pre164 = shufflevector <4 x float> %.pre163, <4 x float> undef, <4 x i32> zeroinitializer
900 %.pre165 = insertelement <4 x float> undef, float %5, i32 0
901 %.pre166 = shufflevector <4 x float> %.pre165, <4 x float> undef, <4 x i32> zeroinitializer
902 %.pre167 = insertelement <4 x float> undef, float %6, i32 0
903 %.pre168 = shufflevector <4 x float> %.pre167, <4 x float> undef, <4 x i32> zeroinitializer
904 br i1 %cmp9146, label %while.end, label %while.body.lr.ph
905
906while.body.lr.ph: ; preds = %if.then
907 %7 = and i32 %blockSize, -4
908 %scevgep158 = getelementptr float, float* %pDst, i32 %7
909 br label %while.body
910
911while.body: ; preds = %while.body.lr.ph, %while.body
912 %pStateCur.0151 = phi float* [ %arrayidx, %while.body.lr.ph ], [ %add.ptr, %while.body ]
913 %pSamples.0150 = phi float* [ %0, %while.body.lr.ph ], [ %add.ptr24, %while.body ]
914 %pOutput.0149 = phi float* [ %pDst, %while.body.lr.ph ], [ %add.ptr23, %while.body ]
915 %pTempSrc.0148 = phi float* [ %pSrc, %while.body.lr.ph ], [ %add.ptr11, %while.body ]
916 %blkCnt.0147 = phi i32 [ %shr, %while.body.lr.ph ], [ %dec, %while.body ]
917 %8 = bitcast float* %pTempSrc.0148 to <4 x float>*
918 %9 = load <4 x float>, <4 x float>* %8, align 4
919 %10 = bitcast float* %pStateCur.0151 to <4 x float>*
920 store <4 x float> %9, <4 x float>* %10, align 4
921 %add.ptr = getelementptr inbounds float, float* %pStateCur.0151, i32 4
922 %add.ptr11 = getelementptr inbounds float, float* %pTempSrc.0148, i32 4
923 %11 = bitcast float* %pSamples.0150 to <4 x float>*
924 %12 = load <4 x float>, <4 x float>* %11, align 4
925 %13 = fmul fast <4 x float> %12, %.pre162
926 %arrayidx12 = getelementptr inbounds float, float* %pSamples.0150, i32 1
927 %14 = bitcast float* %arrayidx12 to <4 x float>*
928 %15 = load <4 x float>, <4 x float>* %14, align 4
929 %mul = fmul fast <4 x float> %15, %.pre164
930 %add = fadd fast <4 x float> %mul, %13
931 %arrayidx13 = getelementptr inbounds float, float* %pSamples.0150, i32 2
932 %16 = bitcast float* %arrayidx13 to <4 x float>*
933 %17 = load <4 x float>, <4 x float>* %16, align 4
934 %mul16 = fmul fast <4 x float> %17, %.pre166
935 %add17 = fadd fast <4 x float> %add, %mul16
936 %arrayidx18 = getelementptr inbounds float, float* %pSamples.0150, i32 3
937 %18 = bitcast float* %arrayidx18 to <4 x float>*
938 %19 = load <4 x float>, <4 x float>* %18, align 4
939 %mul21 = fmul fast <4 x float> %19, %.pre168
940 %add22 = fadd fast <4 x float> %add17, %mul21
941 %20 = bitcast float* %pOutput.0149 to <4 x float>*
942 store <4 x float> %add22, <4 x float>* %20, align 4
943 %add.ptr23 = getelementptr inbounds float, float* %pOutput.0149, i32 4
944 %add.ptr24 = getelementptr inbounds float, float* %pSamples.0150, i32 4
945 %dec = add nsw i32 %blkCnt.0147, -1
946 %cmp9 = icmp eq i32 %dec, 0
947 br i1 %cmp9, label %while.end.loopexit, label %while.body
948
949while.end.loopexit: ; preds = %while.body
950 %scevgep157 = getelementptr float, float* %pSrc, i32 %7
951 %scevgep159 = getelementptr float, float* %0, i32 %7
952 br label %while.end
953
954while.end: ; preds = %if.then, %while.end.loopexit
955 %pTempSrc.0.lcssa = phi float* [ %scevgep157, %while.end.loopexit ], [ %pSrc, %if.then ]
956 %pOutput.0.lcssa = phi float* [ %scevgep158, %while.end.loopexit ], [ %pDst, %if.then ]
957 %pSamples.0.lcssa = phi float* [ %scevgep159, %while.end.loopexit ], [ %0, %if.then ]
958 %pStateCur.0.lcssa = phi float* [ %add.ptr, %while.end.loopexit ], [ %arrayidx, %if.then ]
959 %and = and i32 %blockSize, 3
960 %21 = tail call <4 x i1> @llvm.arm.mve.vctp32(i32 %and)
961 %22 = bitcast float* %pTempSrc.0.lcssa to <4 x float>*
962 %23 = load <4 x float>, <4 x float>* %22, align 4
963 %24 = bitcast float* %pStateCur.0.lcssa to <4 x float>*
964 tail call void @llvm.masked.store.v4f32.p0v4f32(<4 x float> %23, <4 x float>* %24, i32 4, <4 x i1> %21)
965 %25 = bitcast float* %pSamples.0.lcssa to <4 x float>*
966 %26 = load <4 x float>, <4 x float>* %25, align 4
967 %27 = fmul fast <4 x float> %26, %.pre162
968 %arrayidx29 = getelementptr inbounds float, float* %pSamples.0.lcssa, i32 1
969 %28 = bitcast float* %arrayidx29 to <4 x float>*
970 %29 = load <4 x float>, <4 x float>* %28, align 4
971 %mul32 = fmul fast <4 x float> %29, %.pre164
972 %add33 = fadd fast <4 x float> %mul32, %27
973 %arrayidx34 = getelementptr inbounds float, float* %pSamples.0.lcssa, i32 2
974 %30 = bitcast float* %arrayidx34 to <4 x float>*
975 %31 = load <4 x float>, <4 x float>* %30, align 4
976 %mul37 = fmul fast <4 x float> %31, %.pre166
977 %add38 = fadd fast <4 x float> %add33, %mul37
978 %arrayidx39 = getelementptr inbounds float, float* %pSamples.0.lcssa, i32 3
979 %32 = bitcast float* %arrayidx39 to <4 x float>*
980 %33 = load <4 x float>, <4 x float>* %32, align 4
981 %mul42 = fmul fast <4 x float> %33, %.pre168
982 %add43 = fadd fast <4 x float> %add38, %mul42
983 %34 = bitcast float* %pOutput.0.lcssa to <4 x float>*
984 tail call void @llvm.masked.store.v4f32.p0v4f32(<4 x float> %add43, <4 x float>* %34, i32 4, <4 x i1> %21)
985 %.pre = load float*, float** %pState1, align 4
986 br label %if.end
987
988if.end: ; preds = %while.end, %entry
989 %35 = phi float* [ %.pre, %while.end ], [ %0, %entry ]
990 %arrayidx45 = getelementptr inbounds float, float* %35, i32 %blockSize
991 %shr47 = lshr i32 %conv, 2
992 %cmp49141 = icmp eq i32 %shr47, 0
993 br i1 %cmp49141, label %while.end55, label %while.body51.preheader
994
995while.body51.preheader: ; preds = %if.end
996 %36 = and i32 %conv, 65532
997 %37 = add i32 %36, %blockSize
998 %scevgep = getelementptr float, float* %35, i32 %37
999 br label %while.body51
1000
1001while.body51: ; preds = %while.body51.preheader, %while.body51
1002 %pTempSrc.1144 = phi float* [ %add.ptr52, %while.body51 ], [ %arrayidx45, %while.body51.preheader ]
1003 %pTempDest.0143 = phi float* [ %add.ptr53, %while.body51 ], [ %35, %while.body51.preheader ]
1004 %blkCnt.1142 = phi i32 [ %dec54, %while.body51 ], [ %shr47, %while.body51.preheader ]
1005 %38 = bitcast float* %pTempSrc.1144 to <4 x float>*
1006 %39 = load <4 x float>, <4 x float>* %38, align 4
1007 %40 = bitcast float* %pTempDest.0143 to <4 x float>*
1008 store <4 x float> %39, <4 x float>* %40, align 4
1009 %add.ptr52 = getelementptr inbounds float, float* %pTempSrc.1144, i32 4
1010 %add.ptr53 = getelementptr inbounds float, float* %pTempDest.0143, i32 4
1011 %dec54 = add nsw i32 %blkCnt.1142, -1
1012 %cmp49 = icmp eq i32 %dec54, 0
1013 br i1 %cmp49, label %while.end55.loopexit, label %while.body51
1014
1015while.end55.loopexit: ; preds = %while.body51
1016 %scevgep156 = getelementptr float, float* %35, i32 %36
1017 br label %while.end55
1018
1019while.end55: ; preds = %while.end55.loopexit, %if.end
1020 %pTempDest.0.lcssa = phi float* [ %35, %if.end ], [ %scevgep156, %while.end55.loopexit ]
1021 %pTempSrc.1.lcssa = phi float* [ %arrayidx45, %if.end ], [ %scevgep, %while.end55.loopexit ]
1022 %and56 = and i32 %conv, 3
1023 %cmp57 = icmp eq i32 %and56, 0
1024 br i1 %cmp57, label %if.end61, label %if.then59
1025
1026if.then59: ; preds = %while.end55
1027 %41 = tail call <4 x i1> @llvm.arm.mve.vctp32(i32 %and56)
1028 %42 = bitcast float* %pTempSrc.1.lcssa to <4 x float>*
1029 %43 = load <4 x float>, <4 x float>* %42, align 4
1030 %44 = bitcast float* %pTempDest.0.lcssa to <4 x float>*
1031 tail call void @llvm.masked.store.v4f32.p0v4f32(<4 x float> %43, <4 x float>* %44, i32 4, <4 x i1> %41)
1032 br label %if.end61
1033
1034if.end61: ; preds = %while.end55, %if.then59
1035 ret void
1036}
1037
1038
1039define void @fir(%struct.arm_fir_instance_f32* nocapture readonly %S, float* nocapture readonly %pSrc, float* nocapture %pDst, i32 %blockSize) {
1040; CHECK-LABEL: fir:
1041; CHECK: @ %bb.0: @ %entry
1042; CHECK-NEXT: .save {r4, r5, r6, r7, r8, r9, r10, r11, lr}
1043; CHECK-NEXT: push.w {r4, r5, r6, r7, r8, r9, r10, r11, lr}
1044; CHECK-NEXT: .pad #4
1045; CHECK-NEXT: sub sp, #4
David Greenb3499f52020-03-20 09:23:57 +00001046; CHECK-NEXT: .vsave {d8, d9, d10, d11, d12, d13}
1047; CHECK-NEXT: vpush {d8, d9, d10, d11, d12, d13}
David Green892af452020-04-22 13:30:22 +01001048; CHECK-NEXT: .pad #32
1049; CHECK-NEXT: sub sp, #32
David Green9cf920e2020-03-20 08:25:19 +00001050; CHECK-NEXT: cmp r3, #8
1051; CHECK-NEXT: blo.w .LBB16_12
1052; CHECK-NEXT: @ %bb.1: @ %if.then
1053; CHECK-NEXT: movs r7, #0
1054; CHECK-NEXT: cmp.w r7, r3, lsr #2
1055; CHECK-NEXT: beq.w .LBB16_12
1056; CHECK-NEXT: @ %bb.2: @ %while.body.lr.ph
David Green9e035472020-07-03 14:18:32 +01001057; CHECK-NEXT: ldrh r4, [r0]
1058; CHECK-NEXT: lsr.w r10, r3, #2
1059; CHECK-NEXT: ldrd r5, r12, [r0, #4]
David Green892af452020-04-22 13:30:22 +01001060; CHECK-NEXT: movs r3, #1
David Green9e035472020-07-03 14:18:32 +01001061; CHECK-NEXT: sub.w r7, r4, #8
1062; CHECK-NEXT: add.w r0, r7, r7, lsr #29
1063; CHECK-NEXT: asrs r6, r0, #3
David Green892af452020-04-22 13:30:22 +01001064; CHECK-NEXT: cmp r6, #1
David Green9cf920e2020-03-20 08:25:19 +00001065; CHECK-NEXT: it gt
David Green9e035472020-07-03 14:18:32 +01001066; CHECK-NEXT: asrgt r3, r0, #3
1067; CHECK-NEXT: add.w r0, r5, r4, lsl #2
1068; CHECK-NEXT: sub.w r9, r0, #4
1069; CHECK-NEXT: rsbs r0, r4, #0
1070; CHECK-NEXT: str r3, [sp, #4] @ 4-byte Spill
1071; CHECK-NEXT: and r3, r7, #7
1072; CHECK-NEXT: str r0, [sp, #16] @ 4-byte Spill
1073; CHECK-NEXT: add.w r0, r12, #32
1074; CHECK-NEXT: str r4, [sp, #20] @ 4-byte Spill
1075; CHECK-NEXT: str r0, [sp, #8] @ 4-byte Spill
David Green892af452020-04-22 13:30:22 +01001076; CHECK-NEXT: str r3, [sp, #12] @ 4-byte Spill
David Green9cf920e2020-03-20 08:25:19 +00001077; CHECK-NEXT: b .LBB16_4
1078; CHECK-NEXT: .LBB16_3: @ %while.end
1079; CHECK-NEXT: @ in Loop: Header=BB16_4 Depth=1
David Green9e035472020-07-03 14:18:32 +01001080; CHECK-NEXT: ldr r0, [sp, #16] @ 4-byte Reload
1081; CHECK-NEXT: subs.w r10, r10, #1
David Green9cf920e2020-03-20 08:25:19 +00001082; CHECK-NEXT: vstrb.8 q0, [r2], #16
David Green9e035472020-07-03 14:18:32 +01001083; CHECK-NEXT: add.w r0, r5, r0, lsl #2
1084; CHECK-NEXT: add.w r5, r0, #16
1085; CHECK-NEXT: beq.w .LBB16_12
David Green9cf920e2020-03-20 08:25:19 +00001086; CHECK-NEXT: .LBB16_4: @ %while.body
1087; CHECK-NEXT: @ =>This Loop Header: Depth=1
1088; CHECK-NEXT: @ Child Loop BB16_6 Depth 2
1089; CHECK-NEXT: @ Child Loop BB16_10 Depth 2
David Greenb3499f52020-03-20 09:23:57 +00001090; CHECK-NEXT: vldrw.u32 q0, [r1], #16
David Green9e035472020-07-03 14:18:32 +01001091; CHECK-NEXT: ldrd r7, r4, [r12]
1092; CHECK-NEXT: ldrd r0, r6, [r12, #8]
1093; CHECK-NEXT: ldrd r3, lr, [r12, #16]
1094; CHECK-NEXT: ldrd r11, r8, [r12, #24]
1095; CHECK-NEXT: vstrb.8 q0, [r9], #16
1096; CHECK-NEXT: vldrw.u32 q0, [r5], #32
1097; CHECK-NEXT: vldrw.u32 q1, [r5, #-28]
1098; CHECK-NEXT: vmul.f32 q0, q0, r7
1099; CHECK-NEXT: vldrw.u32 q6, [r5, #-24]
1100; CHECK-NEXT: vldrw.u32 q4, [r5, #-20]
1101; CHECK-NEXT: vfma.f32 q0, q1, r4
1102; CHECK-NEXT: vldrw.u32 q5, [r5, #-16]
1103; CHECK-NEXT: vfma.f32 q0, q6, r0
1104; CHECK-NEXT: vldrw.u32 q2, [r5, #-12]
David Green892af452020-04-22 13:30:22 +01001105; CHECK-NEXT: vfma.f32 q0, q4, r6
David Green9e035472020-07-03 14:18:32 +01001106; CHECK-NEXT: vldrw.u32 q3, [r5, #-8]
1107; CHECK-NEXT: vfma.f32 q0, q5, r3
1108; CHECK-NEXT: vldrw.u32 q1, [r5, #-4]
1109; CHECK-NEXT: vfma.f32 q0, q2, lr
1110; CHECK-NEXT: ldr r0, [sp, #20] @ 4-byte Reload
1111; CHECK-NEXT: vfma.f32 q0, q3, r11
1112; CHECK-NEXT: strd r9, r1, [sp, #24] @ 8-byte Folded Spill
1113; CHECK-NEXT: vfma.f32 q0, q1, r8
Jean-Michel Gorius65cd2c72020-05-22 21:26:46 +02001114; CHECK-NEXT: cmp r0, #16
David Greenb3499f52020-03-20 09:23:57 +00001115; CHECK-NEXT: blo .LBB16_7
David Green9cf920e2020-03-20 08:25:19 +00001116; CHECK-NEXT: @ %bb.5: @ %for.body.preheader
1117; CHECK-NEXT: @ in Loop: Header=BB16_4 Depth=1
David Green9e035472020-07-03 14:18:32 +01001118; CHECK-NEXT: ldr.w lr, [sp, #4] @ 4-byte Reload
Sam Parker38f625d2020-10-01 10:47:02 +01001119; CHECK-NEXT: dls lr, lr
David Green6dcbc322020-10-20 08:55:21 +01001120; CHECK-NEXT: ldr r7, [sp, #8] @ 4-byte Reload
David Green9cf920e2020-03-20 08:25:19 +00001121; CHECK-NEXT: .LBB16_6: @ %for.body
1122; CHECK-NEXT: @ Parent Loop BB16_4 Depth=1
1123; CHECK-NEXT: @ => This Inner Loop Header: Depth=2
David Green9e035472020-07-03 14:18:32 +01001124; CHECK-NEXT: ldm.w r7, {r0, r3, r4, r6}
1125; CHECK-NEXT: vldrw.u32 q1, [r5], #32
1126; CHECK-NEXT: add.w r11, r7, #16
1127; CHECK-NEXT: vldrw.u32 q6, [r5, #-24]
1128; CHECK-NEXT: vldrw.u32 q4, [r5, #-20]
David Green9cf920e2020-03-20 08:25:19 +00001129; CHECK-NEXT: vfma.f32 q0, q1, r0
David Green9e035472020-07-03 14:18:32 +01001130; CHECK-NEXT: vldrw.u32 q1, [r5, #-28]
1131; CHECK-NEXT: ldm.w r11, {r1, r8, r11}
1132; CHECK-NEXT: vldrw.u32 q5, [r5, #-16]
David Greenb3499f52020-03-20 09:23:57 +00001133; CHECK-NEXT: vfma.f32 q0, q1, r3
David Green9e035472020-07-03 14:18:32 +01001134; CHECK-NEXT: vldrw.u32 q2, [r5, #-12]
David Greenb3499f52020-03-20 09:23:57 +00001135; CHECK-NEXT: vfma.f32 q0, q6, r4
David Green9e035472020-07-03 14:18:32 +01001136; CHECK-NEXT: vldrw.u32 q3, [r5, #-8]
1137; CHECK-NEXT: vfma.f32 q0, q4, r6
1138; CHECK-NEXT: ldr.w r9, [r7, #28]
1139; CHECK-NEXT: vfma.f32 q0, q5, r1
1140; CHECK-NEXT: vldrw.u32 q1, [r5, #-4]
1141; CHECK-NEXT: vfma.f32 q0, q2, r8
David Green892af452020-04-22 13:30:22 +01001142; CHECK-NEXT: adds r7, #32
David Green892af452020-04-22 13:30:22 +01001143; CHECK-NEXT: vfma.f32 q0, q3, r11
David Green9e035472020-07-03 14:18:32 +01001144; CHECK-NEXT: vfma.f32 q0, q1, r9
David Green9cf920e2020-03-20 08:25:19 +00001145; CHECK-NEXT: le lr, .LBB16_6
David Greenb3499f52020-03-20 09:23:57 +00001146; CHECK-NEXT: b .LBB16_8
1147; CHECK-NEXT: .LBB16_7: @ in Loop: Header=BB16_4 Depth=1
David Green892af452020-04-22 13:30:22 +01001148; CHECK-NEXT: ldr r7, [sp, #8] @ 4-byte Reload
David Greenb3499f52020-03-20 09:23:57 +00001149; CHECK-NEXT: .LBB16_8: @ %for.end
David Green9cf920e2020-03-20 08:25:19 +00001150; CHECK-NEXT: @ in Loop: Header=BB16_4 Depth=1
David Green9e035472020-07-03 14:18:32 +01001151; CHECK-NEXT: ldrd r9, r1, [sp, #24] @ 8-byte Folded Reload
1152; CHECK-NEXT: ldr r3, [sp, #12] @ 4-byte Reload
1153; CHECK-NEXT: cmp.w r3, #0
David Greenb3499f52020-03-20 09:23:57 +00001154; CHECK-NEXT: beq .LBB16_3
David Green9e035472020-07-03 14:18:32 +01001155; CHECK-NEXT: b .LBB16_9
1156; CHECK-NEXT: .LBB16_9: @ %while.body76.preheader
David Green9cf920e2020-03-20 08:25:19 +00001157; CHECK-NEXT: @ in Loop: Header=BB16_4 Depth=1
David Green9e035472020-07-03 14:18:32 +01001158; CHECK-NEXT: mov r4, r5
1159; CHECK-NEXT: mov lr, r3
David Green9cf920e2020-03-20 08:25:19 +00001160; CHECK-NEXT: .LBB16_10: @ %while.body76
1161; CHECK-NEXT: @ Parent Loop BB16_4 Depth=1
1162; CHECK-NEXT: @ => This Inner Loop Header: Depth=2
David Green9e035472020-07-03 14:18:32 +01001163; CHECK-NEXT: ldr r0, [r7], #4
David Green892af452020-04-22 13:30:22 +01001164; CHECK-NEXT: vldrw.u32 q1, [r4], #4
David Green9e035472020-07-03 14:18:32 +01001165; CHECK-NEXT: subs.w lr, lr, #1
1166; CHECK-NEXT: vfma.f32 q0, q1, r0
1167; CHECK-NEXT: bne .LBB16_10
1168; CHECK-NEXT: b .LBB16_11
1169; CHECK-NEXT: .LBB16_11: @ %while.end.loopexit
David Green9cf920e2020-03-20 08:25:19 +00001170; CHECK-NEXT: @ in Loop: Header=BB16_4 Depth=1
David Green9e035472020-07-03 14:18:32 +01001171; CHECK-NEXT: add.w r5, r5, r3, lsl #2
David Green9cf920e2020-03-20 08:25:19 +00001172; CHECK-NEXT: b .LBB16_3
1173; CHECK-NEXT: .LBB16_12: @ %if.end
David Green892af452020-04-22 13:30:22 +01001174; CHECK-NEXT: add sp, #32
David Greenb3499f52020-03-20 09:23:57 +00001175; CHECK-NEXT: vpop {d8, d9, d10, d11, d12, d13}
David Green9cf920e2020-03-20 08:25:19 +00001176; CHECK-NEXT: add sp, #4
1177; CHECK-NEXT: pop.w {r4, r5, r6, r7, r8, r9, r10, r11, pc}
1178entry:
1179 %pState1 = getelementptr inbounds %struct.arm_fir_instance_f32, %struct.arm_fir_instance_f32* %S, i32 0, i32 1
1180 %0 = load float*, float** %pState1, align 4
1181 %pCoeffs2 = getelementptr inbounds %struct.arm_fir_instance_f32, %struct.arm_fir_instance_f32* %S, i32 0, i32 2
1182 %1 = load float*, float** %pCoeffs2, align 4
1183 %numTaps3 = getelementptr inbounds %struct.arm_fir_instance_f32, %struct.arm_fir_instance_f32* %S, i32 0, i32 0
1184 %2 = load i16, i16* %numTaps3, align 4
1185 %conv = zext i16 %2 to i32
1186 %cmp = icmp ugt i32 %blockSize, 7
1187 br i1 %cmp, label %if.then, label %if.end
1188
1189if.then: ; preds = %entry
1190 %shr = lshr i32 %blockSize, 2
1191 %cmp5217 = icmp eq i32 %shr, 0
1192 br i1 %cmp5217, label %if.end, label %while.body.lr.ph
1193
1194while.body.lr.ph: ; preds = %if.then
1195 %sub = add nsw i32 %conv, -1
1196 %arrayidx = getelementptr inbounds float, float* %0, i32 %sub
1197 %incdec.ptr = getelementptr inbounds float, float* %1, i32 1
1198 %incdec.ptr7 = getelementptr inbounds float, float* %1, i32 2
1199 %incdec.ptr8 = getelementptr inbounds float, float* %1, i32 3
1200 %incdec.ptr9 = getelementptr inbounds float, float* %1, i32 4
1201 %incdec.ptr10 = getelementptr inbounds float, float* %1, i32 5
1202 %incdec.ptr11 = getelementptr inbounds float, float* %1, i32 6
1203 %incdec.ptr12 = getelementptr inbounds float, float* %1, i32 7
1204 %sub37 = add nsw i32 %conv, -8
1205 %div = sdiv i32 %sub37, 8
1206 %pCoeffsCur.0199 = getelementptr inbounds float, float* %1, i32 8
1207 %cmp38201 = icmp ugt i16 %2, 15
1208 %and = and i32 %sub37, 7
1209 %cmp74210 = icmp eq i32 %and, 0
1210 %idx.neg = sub nsw i32 0, %conv
1211 %3 = icmp sgt i32 %div, 1
1212 %smax = select i1 %3, i32 %div, i32 1
1213 br label %while.body
1214
1215while.body: ; preds = %while.body.lr.ph, %while.end
1216 %blkCnt.0222 = phi i32 [ %shr, %while.body.lr.ph ], [ %dec84, %while.end ]
1217 %pStateCur.0221 = phi float* [ %arrayidx, %while.body.lr.ph ], [ %add.ptr, %while.end ]
1218 %pSamples.0220 = phi float* [ %0, %while.body.lr.ph ], [ %add.ptr83, %while.end ]
1219 %pTempSrc.0219 = phi float* [ %pSrc, %while.body.lr.ph ], [ %add.ptr14, %while.end ]
1220 %pOutput.0218 = phi float* [ %pDst, %while.body.lr.ph ], [ %add.ptr81, %while.end ]
1221 %4 = load float, float* %1, align 4
1222 %5 = load float, float* %incdec.ptr, align 4
1223 %6 = load float, float* %incdec.ptr7, align 4
1224 %7 = load float, float* %incdec.ptr8, align 4
1225 %8 = load float, float* %incdec.ptr9, align 4
1226 %9 = load float, float* %incdec.ptr10, align 4
1227 %10 = load float, float* %incdec.ptr11, align 4
1228 %11 = load float, float* %incdec.ptr12, align 4
1229 %12 = bitcast float* %pTempSrc.0219 to <4 x float>*
1230 %13 = load <4 x float>, <4 x float>* %12, align 4
1231 %14 = bitcast float* %pStateCur.0221 to <4 x float>*
1232 store <4 x float> %13, <4 x float>* %14, align 4
1233 %add.ptr = getelementptr inbounds float, float* %pStateCur.0221, i32 4
1234 %add.ptr14 = getelementptr inbounds float, float* %pTempSrc.0219, i32 4
1235 %15 = bitcast float* %pSamples.0220 to <4 x float>*
1236 %16 = load <4 x float>, <4 x float>* %15, align 4
1237 %.splatinsert = insertelement <4 x float> undef, float %4, i32 0
1238 %.splat = shufflevector <4 x float> %.splatinsert, <4 x float> undef, <4 x i32> zeroinitializer
1239 %17 = fmul fast <4 x float> %16, %.splat
1240 %arrayidx15 = getelementptr inbounds float, float* %pSamples.0220, i32 1
1241 %18 = bitcast float* %arrayidx15 to <4 x float>*
1242 %19 = load <4 x float>, <4 x float>* %18, align 4
1243 %.splatinsert16 = insertelement <4 x float> undef, float %5, i32 0
1244 %.splat17 = shufflevector <4 x float> %.splatinsert16, <4 x float> undef, <4 x i32> zeroinitializer
1245 %20 = tail call fast <4 x float> @llvm.fma.v4f32(<4 x float> %19, <4 x float> %.splat17, <4 x float> %17)
1246 %arrayidx18 = getelementptr inbounds float, float* %pSamples.0220, i32 2
1247 %21 = bitcast float* %arrayidx18 to <4 x float>*
1248 %22 = load <4 x float>, <4 x float>* %21, align 4
1249 %.splatinsert19 = insertelement <4 x float> undef, float %6, i32 0
1250 %.splat20 = shufflevector <4 x float> %.splatinsert19, <4 x float> undef, <4 x i32> zeroinitializer
1251 %23 = tail call fast <4 x float> @llvm.fma.v4f32(<4 x float> %22, <4 x float> %.splat20, <4 x float> %20)
1252 %arrayidx21 = getelementptr inbounds float, float* %pSamples.0220, i32 3
1253 %24 = bitcast float* %arrayidx21 to <4 x float>*
1254 %25 = load <4 x float>, <4 x float>* %24, align 4
1255 %.splatinsert22 = insertelement <4 x float> undef, float %7, i32 0
1256 %.splat23 = shufflevector <4 x float> %.splatinsert22, <4 x float> undef, <4 x i32> zeroinitializer
1257 %26 = tail call fast <4 x float> @llvm.fma.v4f32(<4 x float> %25, <4 x float> %.splat23, <4 x float> %23)
1258 %arrayidx24 = getelementptr inbounds float, float* %pSamples.0220, i32 4
1259 %27 = bitcast float* %arrayidx24 to <4 x float>*
1260 %28 = load <4 x float>, <4 x float>* %27, align 4
1261 %.splatinsert25 = insertelement <4 x float> undef, float %8, i32 0
1262 %.splat26 = shufflevector <4 x float> %.splatinsert25, <4 x float> undef, <4 x i32> zeroinitializer
1263 %29 = tail call fast <4 x float> @llvm.fma.v4f32(<4 x float> %28, <4 x float> %.splat26, <4 x float> %26)
1264 %arrayidx27 = getelementptr inbounds float, float* %pSamples.0220, i32 5
1265 %30 = bitcast float* %arrayidx27 to <4 x float>*
1266 %31 = load <4 x float>, <4 x float>* %30, align 4
1267 %.splatinsert28 = insertelement <4 x float> undef, float %9, i32 0
1268 %.splat29 = shufflevector <4 x float> %.splatinsert28, <4 x float> undef, <4 x i32> zeroinitializer
1269 %32 = tail call fast <4 x float> @llvm.fma.v4f32(<4 x float> %31, <4 x float> %.splat29, <4 x float> %29)
1270 %arrayidx30 = getelementptr inbounds float, float* %pSamples.0220, i32 6
1271 %33 = bitcast float* %arrayidx30 to <4 x float>*
1272 %34 = load <4 x float>, <4 x float>* %33, align 4
1273 %.splatinsert31 = insertelement <4 x float> undef, float %10, i32 0
1274 %.splat32 = shufflevector <4 x float> %.splatinsert31, <4 x float> undef, <4 x i32> zeroinitializer
1275 %35 = tail call fast <4 x float> @llvm.fma.v4f32(<4 x float> %34, <4 x float> %.splat32, <4 x float> %32)
1276 %arrayidx33 = getelementptr inbounds float, float* %pSamples.0220, i32 7
1277 %36 = bitcast float* %arrayidx33 to <4 x float>*
1278 %37 = load <4 x float>, <4 x float>* %36, align 4
1279 %.splatinsert34 = insertelement <4 x float> undef, float %11, i32 0
1280 %.splat35 = shufflevector <4 x float> %.splatinsert34, <4 x float> undef, <4 x i32> zeroinitializer
1281 %38 = tail call fast <4 x float> @llvm.fma.v4f32(<4 x float> %37, <4 x float> %.splat35, <4 x float> %35)
1282 %pSamples.1200 = getelementptr inbounds float, float* %pSamples.0220, i32 8
1283 br i1 %cmp38201, label %for.body, label %for.end
1284
1285for.body: ; preds = %while.body, %for.body
1286 %pSamples.1207 = phi float* [ %pSamples.1, %for.body ], [ %pSamples.1200, %while.body ]
1287 %pCoeffsCur.0206 = phi float* [ %pCoeffsCur.0, %for.body ], [ %pCoeffsCur.0199, %while.body ]
1288 %.pn205 = phi float* [ %pCoeffsCur.0206, %for.body ], [ %1, %while.body ]
1289 %i.0204 = phi i32 [ %inc, %for.body ], [ 0, %while.body ]
1290 %vecAcc0.0203 = phi <4 x float> [ %70, %for.body ], [ %38, %while.body ]
1291 %pSamples.0.pn202 = phi float* [ %pSamples.1207, %for.body ], [ %pSamples.0220, %while.body ]
1292 %incdec.ptr40 = getelementptr inbounds float, float* %.pn205, i32 9
1293 %39 = load float, float* %pCoeffsCur.0206, align 4
1294 %incdec.ptr41 = getelementptr inbounds float, float* %.pn205, i32 10
1295 %40 = load float, float* %incdec.ptr40, align 4
1296 %incdec.ptr42 = getelementptr inbounds float, float* %.pn205, i32 11
1297 %41 = load float, float* %incdec.ptr41, align 4
1298 %incdec.ptr43 = getelementptr inbounds float, float* %.pn205, i32 12
1299 %42 = load float, float* %incdec.ptr42, align 4
1300 %incdec.ptr44 = getelementptr inbounds float, float* %.pn205, i32 13
1301 %43 = load float, float* %incdec.ptr43, align 4
1302 %incdec.ptr45 = getelementptr inbounds float, float* %.pn205, i32 14
1303 %44 = load float, float* %incdec.ptr44, align 4
1304 %incdec.ptr46 = getelementptr inbounds float, float* %.pn205, i32 15
1305 %45 = load float, float* %incdec.ptr45, align 4
1306 %46 = load float, float* %incdec.ptr46, align 4
1307 %47 = bitcast float* %pSamples.1207 to <4 x float>*
1308 %48 = load <4 x float>, <4 x float>* %47, align 4
1309 %.splatinsert48 = insertelement <4 x float> undef, float %39, i32 0
1310 %.splat49 = shufflevector <4 x float> %.splatinsert48, <4 x float> undef, <4 x i32> zeroinitializer
1311 %49 = tail call fast <4 x float> @llvm.fma.v4f32(<4 x float> %48, <4 x float> %.splat49, <4 x float> %vecAcc0.0203)
1312 %arrayidx50 = getelementptr inbounds float, float* %pSamples.0.pn202, i32 9
1313 %50 = bitcast float* %arrayidx50 to <4 x float>*
1314 %51 = load <4 x float>, <4 x float>* %50, align 4
1315 %.splatinsert51 = insertelement <4 x float> undef, float %40, i32 0
1316 %.splat52 = shufflevector <4 x float> %.splatinsert51, <4 x float> undef, <4 x i32> zeroinitializer
1317 %52 = tail call fast <4 x float> @llvm.fma.v4f32(<4 x float> %51, <4 x float> %.splat52, <4 x float> %49)
1318 %arrayidx53 = getelementptr inbounds float, float* %pSamples.0.pn202, i32 10
1319 %53 = bitcast float* %arrayidx53 to <4 x float>*
1320 %54 = load <4 x float>, <4 x float>* %53, align 4
1321 %.splatinsert54 = insertelement <4 x float> undef, float %41, i32 0
1322 %.splat55 = shufflevector <4 x float> %.splatinsert54, <4 x float> undef, <4 x i32> zeroinitializer
1323 %55 = tail call fast <4 x float> @llvm.fma.v4f32(<4 x float> %54, <4 x float> %.splat55, <4 x float> %52)
1324 %arrayidx56 = getelementptr inbounds float, float* %pSamples.0.pn202, i32 11
1325 %56 = bitcast float* %arrayidx56 to <4 x float>*
1326 %57 = load <4 x float>, <4 x float>* %56, align 4
1327 %.splatinsert57 = insertelement <4 x float> undef, float %42, i32 0
1328 %.splat58 = shufflevector <4 x float> %.splatinsert57, <4 x float> undef, <4 x i32> zeroinitializer
1329 %58 = tail call fast <4 x float> @llvm.fma.v4f32(<4 x float> %57, <4 x float> %.splat58, <4 x float> %55)
1330 %arrayidx59 = getelementptr inbounds float, float* %pSamples.0.pn202, i32 12
1331 %59 = bitcast float* %arrayidx59 to <4 x float>*
1332 %60 = load <4 x float>, <4 x float>* %59, align 4
1333 %.splatinsert60 = insertelement <4 x float> undef, float %43, i32 0
1334 %.splat61 = shufflevector <4 x float> %.splatinsert60, <4 x float> undef, <4 x i32> zeroinitializer
1335 %61 = tail call fast <4 x float> @llvm.fma.v4f32(<4 x float> %60, <4 x float> %.splat61, <4 x float> %58)
1336 %arrayidx62 = getelementptr inbounds float, float* %pSamples.0.pn202, i32 13
1337 %62 = bitcast float* %arrayidx62 to <4 x float>*
1338 %63 = load <4 x float>, <4 x float>* %62, align 4
1339 %.splatinsert63 = insertelement <4 x float> undef, float %44, i32 0
1340 %.splat64 = shufflevector <4 x float> %.splatinsert63, <4 x float> undef, <4 x i32> zeroinitializer
1341 %64 = tail call fast <4 x float> @llvm.fma.v4f32(<4 x float> %63, <4 x float> %.splat64, <4 x float> %61)
1342 %arrayidx65 = getelementptr inbounds float, float* %pSamples.0.pn202, i32 14
1343 %65 = bitcast float* %arrayidx65 to <4 x float>*
1344 %66 = load <4 x float>, <4 x float>* %65, align 4
1345 %.splatinsert66 = insertelement <4 x float> undef, float %45, i32 0
1346 %.splat67 = shufflevector <4 x float> %.splatinsert66, <4 x float> undef, <4 x i32> zeroinitializer
1347 %67 = tail call fast <4 x float> @llvm.fma.v4f32(<4 x float> %66, <4 x float> %.splat67, <4 x float> %64)
1348 %arrayidx68 = getelementptr inbounds float, float* %pSamples.0.pn202, i32 15
1349 %68 = bitcast float* %arrayidx68 to <4 x float>*
1350 %69 = load <4 x float>, <4 x float>* %68, align 4
1351 %.splatinsert69 = insertelement <4 x float> undef, float %46, i32 0
1352 %.splat70 = shufflevector <4 x float> %.splatinsert69, <4 x float> undef, <4 x i32> zeroinitializer
1353 %70 = tail call fast <4 x float> @llvm.fma.v4f32(<4 x float> %69, <4 x float> %.splat70, <4 x float> %67)
1354 %inc = add nuw nsw i32 %i.0204, 1
1355 %pCoeffsCur.0 = getelementptr inbounds float, float* %pCoeffsCur.0206, i32 8
1356 %pSamples.1 = getelementptr inbounds float, float* %pSamples.1207, i32 8
1357 %exitcond = icmp eq i32 %inc, %smax
1358 br i1 %exitcond, label %for.end, label %for.body
1359
1360for.end: ; preds = %for.body, %while.body
1361 %vecAcc0.0.lcssa = phi <4 x float> [ %38, %while.body ], [ %70, %for.body ]
1362 %pCoeffsCur.0.lcssa = phi float* [ %pCoeffsCur.0199, %while.body ], [ %pCoeffsCur.0, %for.body ]
1363 %pSamples.1.lcssa = phi float* [ %pSamples.1200, %while.body ], [ %pSamples.1, %for.body ]
1364 br i1 %cmp74210, label %while.end, label %while.body76
1365
1366while.body76: ; preds = %for.end, %while.body76
1367 %pCoeffsCur.1214 = phi float* [ %incdec.ptr77, %while.body76 ], [ %pCoeffsCur.0.lcssa, %for.end ]
1368 %vecAcc0.1213 = phi <4 x float> [ %74, %while.body76 ], [ %vecAcc0.0.lcssa, %for.end ]
1369 %numCnt.0212 = phi i32 [ %dec, %while.body76 ], [ %and, %for.end ]
1370 %pSamples.2211 = phi float* [ %incdec.ptr80, %while.body76 ], [ %pSamples.1.lcssa, %for.end ]
1371 %incdec.ptr77 = getelementptr inbounds float, float* %pCoeffsCur.1214, i32 1
1372 %71 = load float, float* %pCoeffsCur.1214, align 4
1373 %72 = bitcast float* %pSamples.2211 to <4 x float>*
1374 %73 = load <4 x float>, <4 x float>* %72, align 4
1375 %.splatinsert78 = insertelement <4 x float> undef, float %71, i32 0
1376 %.splat79 = shufflevector <4 x float> %.splatinsert78, <4 x float> undef, <4 x i32> zeroinitializer
1377 %74 = tail call fast <4 x float> @llvm.fma.v4f32(<4 x float> %73, <4 x float> %.splat79, <4 x float> %vecAcc0.1213)
1378 %incdec.ptr80 = getelementptr inbounds float, float* %pSamples.2211, i32 1
1379 %dec = add nsw i32 %numCnt.0212, -1
1380 %cmp74 = icmp sgt i32 %numCnt.0212, 1
1381 br i1 %cmp74, label %while.body76, label %while.end.loopexit
1382
1383while.end.loopexit: ; preds = %while.body76
1384 %scevgep = getelementptr float, float* %pSamples.1.lcssa, i32 %and
1385 br label %while.end
1386
1387while.end: ; preds = %while.end.loopexit, %for.end
1388 %pSamples.2.lcssa = phi float* [ %pSamples.1.lcssa, %for.end ], [ %scevgep, %while.end.loopexit ]
1389 %vecAcc0.1.lcssa = phi <4 x float> [ %vecAcc0.0.lcssa, %for.end ], [ %74, %while.end.loopexit ]
1390 %75 = bitcast float* %pOutput.0218 to <4 x float>*
1391 store <4 x float> %vecAcc0.1.lcssa, <4 x float>* %75, align 4
1392 %add.ptr81 = getelementptr inbounds float, float* %pOutput.0218, i32 4
1393 %add.ptr82 = getelementptr inbounds float, float* %pSamples.2.lcssa, i32 4
1394 %add.ptr83 = getelementptr inbounds float, float* %add.ptr82, i32 %idx.neg
1395 %dec84 = add nsw i32 %blkCnt.0222, -1
1396 %cmp5 = icmp eq i32 %dec84, 0
1397 br i1 %cmp5, label %if.end, label %while.body
1398
1399if.end: ; preds = %while.end, %if.then, %entry
1400 ret void
1401}
1402
David Greene8e7b2c2020-05-28 17:49:01 +01001403%struct.arm_biquad_cascade_stereo_df2T_instance_f32 = type { i8, float*, float* }
1404define arm_aapcs_vfpcc void @arm_biquad_cascade_stereo_df2T_f32(%struct.arm_biquad_cascade_stereo_df2T_instance_f32* nocapture readonly %0, float* %1, float* %2, i32 %3) {
1405; CHECK-LABEL: arm_biquad_cascade_stereo_df2T_f32:
1406; CHECK: @ %bb.0:
1407; CHECK-NEXT: .save {r4, r5, r6, r7, lr}
1408; CHECK-NEXT: push {r4, r5, r6, r7, lr}
1409; CHECK-NEXT: .pad #4
1410; CHECK-NEXT: sub sp, #4
1411; CHECK-NEXT: .vsave {d8, d9, d10, d11}
1412; CHECK-NEXT: vpush {d8, d9, d10, d11}
1413; CHECK-NEXT: .pad #24
1414; CHECK-NEXT: sub sp, #24
1415; CHECK-NEXT: ldrb.w lr, [r0]
1416; CHECK-NEXT: movs r4, #0
1417; CHECK-NEXT: ldrd r12, r0, [r0, #4]
1418; CHECK-NEXT: cmp r3, #0
1419; CHECK-NEXT: strd r4, r4, [sp, #16]
1420; CHECK-NEXT: beq .LBB17_5
1421; CHECK-NEXT: @ %bb.1:
1422; CHECK-NEXT: movs r5, #2
1423; CHECK-NEXT: viwdup.u32 q0, r4, r5, #1
1424; CHECK-NEXT: mov r4, sp
1425; CHECK-NEXT: .LBB17_2: @ =>This Loop Header: Depth=1
1426; CHECK-NEXT: @ Child Loop BB17_3 Depth 2
1427; CHECK-NEXT: mov r7, lr
1428; CHECK-NEXT: ldr.w lr, [r0, #12]
1429; CHECK-NEXT: ldrd r5, r6, [r0]
1430; CHECK-NEXT: vldrw.u32 q1, [r12]
1431; CHECK-NEXT: vldr s12, [r0, #8]
1432; CHECK-NEXT: vdup.32 q2, lr
1433; CHECK-NEXT: vldr s14, [r0, #16]
1434; CHECK-NEXT: vstrw.32 q1, [r4]
1435; CHECK-NEXT: vdup.32 q1, r6
1436; CHECK-NEXT: mov r6, r2
1437; CHECK-NEXT: vmov.f32 s6, s12
David Greene8e7b2c2020-05-28 17:49:01 +01001438; CHECK-NEXT: vmov.f32 s10, s14
David Green6dcbc322020-10-20 08:55:21 +01001439; CHECK-NEXT: dls lr, r3
David Greene8e7b2c2020-05-28 17:49:01 +01001440; CHECK-NEXT: vmov.f32 s7, s12
1441; CHECK-NEXT: vmov.f32 s11, s14
1442; CHECK-NEXT: .LBB17_3: @ Parent Loop BB17_2 Depth=1
1443; CHECK-NEXT: @ => This Inner Loop Header: Depth=2
1444; CHECK-NEXT: vldrw.u32 q4, [r1, q0, uxtw #2]
1445; CHECK-NEXT: vldrw.u32 q5, [r4, q0, uxtw #2]
1446; CHECK-NEXT: adds r1, #8
1447; CHECK-NEXT: vfma.f32 q5, q4, r5
1448; CHECK-NEXT: vstmia r6, {s20, s21}
1449; CHECK-NEXT: adds r6, #8
1450; CHECK-NEXT: vldrw.u32 q3, [sp, #8]
1451; CHECK-NEXT: vfma.f32 q3, q5, q2
1452; CHECK-NEXT: vfma.f32 q3, q4, q1
1453; CHECK-NEXT: vstrw.32 q3, [r4]
1454; CHECK-NEXT: le lr, .LBB17_3
1455; CHECK-NEXT: @ %bb.4: @ in Loop: Header=BB17_2 Depth=1
1456; CHECK-NEXT: mov lr, r7
1457; CHECK-NEXT: adds r0, #20
1458; CHECK-NEXT: subs.w lr, r7, #1
1459; CHECK-NEXT: vstrb.8 q3, [r12], #16
1460; CHECK-NEXT: mov r1, r2
1461; CHECK-NEXT: bne .LBB17_2
1462; CHECK-NEXT: b .LBB17_7
1463; CHECK-NEXT: .LBB17_5: @ %.preheader
1464; CHECK-NEXT: mov r0, sp
1465; CHECK-NEXT: dls lr, lr
1466; CHECK-NEXT: .LBB17_6: @ =>This Inner Loop Header: Depth=1
1467; CHECK-NEXT: vldrw.u32 q0, [r12], #16
1468; CHECK-NEXT: vstrw.32 q0, [r0]
1469; CHECK-NEXT: le lr, .LBB17_6
1470; CHECK-NEXT: .LBB17_7:
1471; CHECK-NEXT: add sp, #24
1472; CHECK-NEXT: vpop {d8, d9, d10, d11}
1473; CHECK-NEXT: add sp, #4
1474; CHECK-NEXT: pop {r4, r5, r6, r7, pc}
1475 %5 = alloca [6 x float], align 4
1476 %6 = getelementptr inbounds %struct.arm_biquad_cascade_stereo_df2T_instance_f32, %struct.arm_biquad_cascade_stereo_df2T_instance_f32* %0, i32 0, i32 1
1477 %7 = load float*, float** %6, align 4
1478 %8 = getelementptr inbounds %struct.arm_biquad_cascade_stereo_df2T_instance_f32, %struct.arm_biquad_cascade_stereo_df2T_instance_f32* %0, i32 0, i32 2
1479 %9 = load float*, float** %8, align 4
1480 %10 = getelementptr inbounds %struct.arm_biquad_cascade_stereo_df2T_instance_f32, %struct.arm_biquad_cascade_stereo_df2T_instance_f32* %0, i32 0, i32 0
1481 %11 = load i8, i8* %10, align 4
1482 %12 = zext i8 %11 to i32
1483 %13 = bitcast [6 x float]* %5 to i8*
1484 call void @llvm.lifetime.start.p0i8(i64 24, i8* nonnull %13) #5
1485 %14 = tail call { <4 x i32>, i32 } @llvm.arm.mve.viwdup.v4i32(i32 0, i32 2, i32 1)
1486 %15 = extractvalue { <4 x i32>, i32 } %14, 0
1487 %16 = getelementptr inbounds [6 x float], [6 x float]* %5, i32 0, i32 4
1488 store float 0.000000e+00, float* %16, align 4
1489 %17 = getelementptr inbounds [6 x float], [6 x float]* %5, i32 0, i32 5
1490 store float 0.000000e+00, float* %17, align 4
1491 %18 = bitcast [6 x float]* %5 to <4 x float>*
1492 %19 = icmp eq i32 %3, 0
1493 %20 = bitcast [6 x float]* %5 to i32*
1494 %21 = getelementptr inbounds [6 x float], [6 x float]* %5, i32 0, i32 2
1495 %22 = bitcast float* %21 to <4 x float>*
1496 br i1 %19, label %23, label %31
1497
149823: ; preds = %4, %23
1499 %24 = phi i32 [ %29, %23 ], [ %12, %4 ]
1500 %25 = phi float* [ %28, %23 ], [ %7, %4 ]
1501 %26 = bitcast float* %25 to <4 x float>*
1502 %27 = load <4 x float>, <4 x float>* %26, align 8
1503 store <4 x float> %27, <4 x float>* %18, align 4
1504 %28 = getelementptr inbounds float, float* %25, i32 4
1505 %29 = add i32 %24, -1
1506 %30 = icmp eq i32 %29, 0
1507 br i1 %30, label %82, label %23
1508
150931: ; preds = %4, %77
1510 %32 = phi i32 [ %80, %77 ], [ %12, %4 ]
1511 %33 = phi float* [ %78, %77 ], [ %9, %4 ]
1512 %34 = phi float* [ %79, %77 ], [ %7, %4 ]
1513 %35 = phi float* [ %2, %77 ], [ %1, %4 ]
1514 %36 = getelementptr inbounds float, float* %33, i32 1
1515 %37 = load float, float* %33, align 4
1516 %38 = getelementptr inbounds float, float* %33, i32 2
1517 %39 = load float, float* %36, align 4
1518 %40 = getelementptr inbounds float, float* %33, i32 3
1519 %41 = load float, float* %38, align 4
1520 %42 = getelementptr inbounds float, float* %33, i32 4
1521 %43 = load float, float* %40, align 4
1522 %44 = load float, float* %42, align 4
1523 %45 = insertelement <4 x float> undef, float %43, i32 0
1524 %46 = shufflevector <4 x float> %45, <4 x float> undef, <4 x i32> <i32 0, i32 0, i32 undef, i32 undef>
1525 %47 = insertelement <4 x float> %46, float %44, i32 2
1526 %48 = insertelement <4 x float> %47, float %44, i32 3
1527 %49 = insertelement <4 x float> undef, float %39, i32 0
1528 %50 = shufflevector <4 x float> %49, <4 x float> undef, <4 x i32> <i32 0, i32 0, i32 undef, i32 undef>
1529 %51 = insertelement <4 x float> %50, float %41, i32 2
1530 %52 = insertelement <4 x float> %51, float %41, i32 3
1531 %53 = bitcast float* %34 to <4 x float>*
1532 %54 = load <4 x float>, <4 x float>* %53, align 8
1533 store <4 x float> %54, <4 x float>* %18, align 4
1534 %55 = insertelement <4 x float> undef, float %37, i32 0
1535 %56 = shufflevector <4 x float> %55, <4 x float> undef, <4 x i32> zeroinitializer
1536 br label %57
1537
153857: ; preds = %31, %57
1539 %58 = phi float* [ %35, %31 ], [ %74, %57 ]
1540 %59 = phi float* [ %2, %31 ], [ %70, %57 ]
1541 %60 = phi i32 [ %3, %31 ], [ %75, %57 ]
1542 %61 = call <4 x i32> @llvm.arm.mve.vldr.gather.offset.v4i32.p0i32.v4i32(i32* nonnull %20, <4 x i32> %15, i32 32, i32 2, i32 1)
1543 %62 = bitcast <4 x i32> %61 to <4 x float>
1544 %63 = bitcast float* %58 to i32*
1545 %64 = call <4 x i32> @llvm.arm.mve.vldr.gather.offset.v4i32.p0i32.v4i32(i32* %63, <4 x i32> %15, i32 32, i32 2, i32 1)
1546 %65 = bitcast <4 x i32> %64 to <4 x float>
1547 %66 = call fast <4 x float> @llvm.fma.v4f32(<4 x float> %65, <4 x float> %56, <4 x float> %62)
1548 %67 = extractelement <4 x float> %66, i32 0
1549 %68 = getelementptr inbounds float, float* %59, i32 1
1550 store float %67, float* %59, align 4
1551 %69 = extractelement <4 x float> %66, i32 1
1552 %70 = getelementptr inbounds float, float* %59, i32 2
1553 store float %69, float* %68, align 4
1554 %71 = load <4 x float>, <4 x float>* %22, align 4
1555 %72 = call fast <4 x float> @llvm.fma.v4f32(<4 x float> %66, <4 x float> %48, <4 x float> %71)
1556 %73 = call fast <4 x float> @llvm.fma.v4f32(<4 x float> %65, <4 x float> %52, <4 x float> %72)
1557 store <4 x float> %73, <4 x float>* %18, align 4
1558 %74 = getelementptr inbounds float, float* %58, i32 2
1559 %75 = add i32 %60, -1
1560 %76 = icmp eq i32 %75, 0
1561 br i1 %76, label %77, label %57
1562
156377: ; preds = %57
1564 %78 = getelementptr inbounds float, float* %33, i32 5
1565 store <4 x float> %73, <4 x float>* %53, align 4
1566 %79 = getelementptr inbounds float, float* %34, i32 4
1567 %80 = add i32 %32, -1
1568 %81 = icmp eq i32 %80, 0
1569 br i1 %81, label %82, label %31
1570
157182: ; preds = %77, %23
1572 call void @llvm.lifetime.end.p0i8(i64 24, i8* nonnull %13) #5
1573 ret void
1574}
1575
1576define arm_aapcs_vfpcc void @fms(float* nocapture readonly %pSrc1, float* nocapture readonly %pSrc2, float* nocapture readonly %pSrc3, float* nocapture %pDst, i32 %N, i32 %M) {
1577; CHECK-LABEL: fms:
1578; CHECK: @ %bb.0: @ %entry
1579; CHECK-NEXT: .save {r4, r5, r7, lr}
1580; CHECK-NEXT: push {r4, r5, r7, lr}
1581; CHECK-NEXT: ldr.w lr, [sp, #16]
1582; CHECK-NEXT: movs r4, #0
1583; CHECK-NEXT: cmp.w r4, lr, lsr #2
1584; CHECK-NEXT: beq .LBB18_5
1585; CHECK-NEXT: @ %bb.1: @ %do.body.preheader
1586; CHECK-NEXT: ldr.w r12, [sp, #20]
1587; CHECK-NEXT: lsr.w r5, lr, #2
1588; CHECK-NEXT: .LBB18_2: @ %do.body
1589; CHECK-NEXT: @ =>This Loop Header: Depth=1
1590; CHECK-NEXT: @ Child Loop BB18_3 Depth 2
1591; CHECK-NEXT: ldr r4, [r2]
Sam Parker38f625d2020-10-01 10:47:02 +01001592; CHECK-NEXT: dls lr, r5
David Green6dcbc322020-10-20 08:55:21 +01001593; CHECK-NEXT: vdup.32 q0, r4
David Greene8e7b2c2020-05-28 17:49:01 +01001594; CHECK-NEXT: .LBB18_3: @ %while.body
1595; CHECK-NEXT: @ Parent Loop BB18_2 Depth=1
1596; CHECK-NEXT: @ => This Inner Loop Header: Depth=2
1597; CHECK-NEXT: vldrw.u32 q1, [r1], #16
1598; CHECK-NEXT: vldrw.u32 q2, [r0], #16
1599; CHECK-NEXT: vfms.f32 q2, q0, q1
1600; CHECK-NEXT: vstrb.8 q2, [r3], #16
1601; CHECK-NEXT: le lr, .LBB18_3
1602; CHECK-NEXT: @ %bb.4: @ %while.end
1603; CHECK-NEXT: @ in Loop: Header=BB18_2 Depth=1
1604; CHECK-NEXT: subs.w r12, r12, #1
1605; CHECK-NEXT: add.w r2, r2, #4
1606; CHECK-NEXT: bne .LBB18_2
1607; CHECK-NEXT: .LBB18_5: @ %do.end
1608; CHECK-NEXT: pop {r4, r5, r7, pc}
1609entry:
1610 %shr = lshr i32 %N, 2
1611 %cmp15 = icmp eq i32 %shr, 0
1612 br i1 %cmp15, label %do.end, label %do.body
1613
1614do.body: ; preds = %entry, %while.end
1615 %pDst.addr.0 = phi float* [ %add.ptr2, %while.end ], [ %pDst, %entry ]
1616 %M.addr.0 = phi i32 [ %dec3, %while.end ], [ %M, %entry ]
1617 %pSrc3.addr.0 = phi float* [ %incdec.ptr, %while.end ], [ %pSrc3, %entry ]
1618 %pSrc2.addr.0 = phi float* [ %add.ptr1, %while.end ], [ %pSrc2, %entry ]
1619 %pSrc1.addr.0 = phi float* [ %add.ptr, %while.end ], [ %pSrc1, %entry ]
1620 %0 = load float, float* %pSrc3.addr.0, align 4
1621 %.splatinsert = insertelement <4 x float> undef, float %0, i32 0
1622 %.splat = shufflevector <4 x float> %.splatinsert, <4 x float> undef, <4 x i32> zeroinitializer
1623 br label %while.body
1624
1625while.body: ; preds = %do.body, %while.body
1626 %pSrc1.addr.119 = phi float* [ %pSrc1.addr.0, %do.body ], [ %add.ptr, %while.body ]
1627 %pSrc2.addr.118 = phi float* [ %pSrc2.addr.0, %do.body ], [ %add.ptr1, %while.body ]
1628 %blkCnt.017 = phi i32 [ %shr, %do.body ], [ %dec, %while.body ]
1629 %pDst.addr.116 = phi float* [ %pDst.addr.0, %do.body ], [ %add.ptr2, %while.body ]
1630 %1 = bitcast float* %pSrc1.addr.119 to <4 x float>*
1631 %2 = load <4 x float>, <4 x float>* %1, align 4
1632 %3 = bitcast float* %pSrc2.addr.118 to <4 x float>*
1633 %4 = load <4 x float>, <4 x float>* %3, align 4
1634 %5 = fneg fast <4 x float> %4
1635 %6 = tail call fast <4 x float> @llvm.fma.v4f32(<4 x float> %.splat, <4 x float> %5, <4 x float> %2)
1636 %7 = bitcast float* %pDst.addr.116 to <4 x float>*
1637 store <4 x float> %6, <4 x float>* %7, align 4
1638 %add.ptr = getelementptr inbounds float, float* %pSrc1.addr.119, i32 4
1639 %add.ptr1 = getelementptr inbounds float, float* %pSrc2.addr.118, i32 4
1640 %add.ptr2 = getelementptr inbounds float, float* %pDst.addr.116, i32 4
1641 %dec = add nsw i32 %blkCnt.017, -1
1642 %cmp = icmp eq i32 %dec, 0
1643 br i1 %cmp, label %while.end, label %while.body
1644
1645while.end: ; preds = %while.body
1646 %incdec.ptr = getelementptr inbounds float, float* %pSrc3.addr.0, i32 1
1647 %dec3 = add i32 %M.addr.0, -1
1648 %cmp4 = icmp eq i32 %dec3, 0
1649 br i1 %cmp4, label %do.end, label %do.body
1650
1651do.end: ; preds = %while.end, %entry
1652 ret void
1653}
1654
1655
1656%struct.arm_biquad_casd_df1_inst_f32 = type { i32, float*, float* }
1657define arm_aapcs_vfpcc void @arm_biquad_cascade_df1_f32(%struct.arm_biquad_casd_df1_inst_f32* nocapture readonly %S, float* nocapture readonly %pSrc, float* nocapture %pDst, i32 %blockSize) {
1658; CHECK-LABEL: arm_biquad_cascade_df1_f32:
1659; CHECK: @ %bb.0: @ %entry
1660; CHECK-NEXT: .save {r4, r5, r6, r7, r8, r9, r10, r11, lr}
1661; CHECK-NEXT: push.w {r4, r5, r6, r7, r8, r9, r10, r11, lr}
1662; CHECK-NEXT: .pad #4
1663; CHECK-NEXT: sub sp, #4
1664; CHECK-NEXT: .vsave {d8, d9, d10, d11, d12, d13, d14, d15}
1665; CHECK-NEXT: vpush {d8, d9, d10, d11, d12, d13, d14, d15}
Tres Popp09d72ad2020-06-22 13:06:18 +02001666; CHECK-NEXT: .pad #88
1667; CHECK-NEXT: sub sp, #88
1668; CHECK-NEXT: ldrd r12, r10, [r0]
1669; CHECK-NEXT: @ implicit-def: $s2
David Greene8e7b2c2020-05-28 17:49:01 +01001670; CHECK-NEXT: and r7, r3, #3
Tres Popp09d72ad2020-06-22 13:06:18 +02001671; CHECK-NEXT: ldr.w r11, [r0, #8]
1672; CHECK-NEXT: lsrs r0, r3, #2
1673; CHECK-NEXT: str r0, [sp, #60] @ 4-byte Spill
1674; CHECK-NEXT: str r7, [sp, #12] @ 4-byte Spill
1675; CHECK-NEXT: str r2, [sp, #56] @ 4-byte Spill
David Greene8e7b2c2020-05-28 17:49:01 +01001676; CHECK-NEXT: b .LBB19_3
1677; CHECK-NEXT: .LBB19_1: @ in Loop: Header=BB19_3 Depth=1
Tres Popp09d72ad2020-06-22 13:06:18 +02001678; CHECK-NEXT: vmov.f32 s14, s7
1679; CHECK-NEXT: ldr r2, [sp, #56] @ 4-byte Reload
1680; CHECK-NEXT: vmov.f32 s0, s10
1681; CHECK-NEXT: vmov.f32 s7, s6
David Greene8e7b2c2020-05-28 17:49:01 +01001682; CHECK-NEXT: .LBB19_2: @ %if.end69
1683; CHECK-NEXT: @ in Loop: Header=BB19_3 Depth=1
Tres Popp09d72ad2020-06-22 13:06:18 +02001684; CHECK-NEXT: vstr s8, [r10]
1685; CHECK-NEXT: subs.w r12, r12, #1
1686; CHECK-NEXT: vstr s0, [r10, #4]
1687; CHECK-NEXT: add.w r11, r11, #128
1688; CHECK-NEXT: vstr s14, [r10, #8]
David Greene8e7b2c2020-05-28 17:49:01 +01001689; CHECK-NEXT: mov r1, r2
Tres Popp09d72ad2020-06-22 13:06:18 +02001690; CHECK-NEXT: vstr s7, [r10, #12]
1691; CHECK-NEXT: add.w r10, r10, #16
David Greene8e7b2c2020-05-28 17:49:01 +01001692; CHECK-NEXT: beq.w .LBB19_13
1693; CHECK-NEXT: .LBB19_3: @ %do.body
1694; CHECK-NEXT: @ =>This Loop Header: Depth=1
1695; CHECK-NEXT: @ Child Loop BB19_5 Depth 2
Tres Popp09d72ad2020-06-22 13:06:18 +02001696; CHECK-NEXT: vldr s7, [r10, #8]
1697; CHECK-NEXT: mov r5, r2
1698; CHECK-NEXT: ldr r0, [sp, #60] @ 4-byte Reload
1699; CHECK-NEXT: vldr s8, [r10]
1700; CHECK-NEXT: vldr s10, [r10, #4]
1701; CHECK-NEXT: vldr s6, [r10, #12]
1702; CHECK-NEXT: wls lr, r0, .LBB19_6
David Greene8e7b2c2020-05-28 17:49:01 +01001703; CHECK-NEXT: @ %bb.4: @ %while.body.lr.ph
1704; CHECK-NEXT: @ in Loop: Header=BB19_3 Depth=1
Tres Popp09d72ad2020-06-22 13:06:18 +02001705; CHECK-NEXT: ldrd r5, lr, [sp, #56] @ 8-byte Folded Reload
David Greene8e7b2c2020-05-28 17:49:01 +01001706; CHECK-NEXT: .LBB19_5: @ %while.body
1707; CHECK-NEXT: @ Parent Loop BB19_3 Depth=1
1708; CHECK-NEXT: @ => This Inner Loop Header: Depth=2
Tres Popp09d72ad2020-06-22 13:06:18 +02001709; CHECK-NEXT: vmov r4, s8
1710; CHECK-NEXT: vldr s8, [r1, #12]
1711; CHECK-NEXT: vldrw.u32 q0, [r11, #112]
1712; CHECK-NEXT: vmov r0, s10
1713; CHECK-NEXT: vldr s10, [r1, #8]
1714; CHECK-NEXT: vmov r7, s7
1715; CHECK-NEXT: vmov r9, s6
1716; CHECK-NEXT: vldrw.u32 q1, [r11]
1717; CHECK-NEXT: vstrw.32 q0, [sp, #64] @ 16-byte Spill
1718; CHECK-NEXT: vmov r8, s8
1719; CHECK-NEXT: vldrw.u32 q0, [r11, #16]
1720; CHECK-NEXT: ldr r6, [r1, #4]
1721; CHECK-NEXT: vldrw.u32 q7, [r11, #32]
1722; CHECK-NEXT: vmul.f32 q1, q1, r8
1723; CHECK-NEXT: vmov r3, s10
1724; CHECK-NEXT: vldrw.u32 q3, [r11, #48]
1725; CHECK-NEXT: vfma.f32 q1, q0, r3
1726; CHECK-NEXT: ldr r3, [r1]
1727; CHECK-NEXT: vfma.f32 q1, q7, r6
1728; CHECK-NEXT: vldrw.u32 q6, [r11, #64]
1729; CHECK-NEXT: vfma.f32 q1, q3, r3
1730; CHECK-NEXT: vldrw.u32 q5, [r11, #80]
1731; CHECK-NEXT: vfma.f32 q1, q6, r4
1732; CHECK-NEXT: vldrw.u32 q4, [r11, #96]
1733; CHECK-NEXT: vfma.f32 q1, q5, r0
1734; CHECK-NEXT: vldrw.u32 q0, [sp, #64] @ 16-byte Reload
1735; CHECK-NEXT: vfma.f32 q1, q4, r7
David Greene8e7b2c2020-05-28 17:49:01 +01001736; CHECK-NEXT: adds r1, #16
Tres Popp09d72ad2020-06-22 13:06:18 +02001737; CHECK-NEXT: vfma.f32 q1, q0, r9
1738; CHECK-NEXT: vmov.f32 s2, s8
1739; CHECK-NEXT: vstrb.8 q1, [r5], #16
David Greene8e7b2c2020-05-28 17:49:01 +01001740; CHECK-NEXT: le lr, .LBB19_5
1741; CHECK-NEXT: .LBB19_6: @ %while.end
1742; CHECK-NEXT: @ in Loop: Header=BB19_3 Depth=1
Tres Popp09d72ad2020-06-22 13:06:18 +02001743; CHECK-NEXT: ldr r7, [sp, #12] @ 4-byte Reload
1744; CHECK-NEXT: cmp r7, #0
David Greene8e7b2c2020-05-28 17:49:01 +01001745; CHECK-NEXT: beq .LBB19_1
1746; CHECK-NEXT: @ %bb.7: @ %if.then
1747; CHECK-NEXT: @ in Loop: Header=BB19_3 Depth=1
Tres Popp09d72ad2020-06-22 13:06:18 +02001748; CHECK-NEXT: vldr s24, [r1]
1749; CHECK-NEXT: vmov r0, s8
1750; CHECK-NEXT: vldr s0, [r1, #4]
1751; CHECK-NEXT: vldrw.u32 q3, [r11]
1752; CHECK-NEXT: vldr s3, [r1, #12]
1753; CHECK-NEXT: vldrw.u32 q4, [r11, #32]
1754; CHECK-NEXT: vldr s1, [r1, #8]
1755; CHECK-NEXT: vmov r1, s10
1756; CHECK-NEXT: vldrw.u32 q2, [r11, #96]
1757; CHECK-NEXT: vmov r6, s3
1758; CHECK-NEXT: vmul.f32 q3, q3, r6
1759; CHECK-NEXT: vmov r6, s1
1760; CHECK-NEXT: vstrw.32 q2, [sp, #32] @ 16-byte Spill
1761; CHECK-NEXT: vldrw.u32 q2, [r11, #112]
1762; CHECK-NEXT: vldrw.u32 q5, [r11, #48]
1763; CHECK-NEXT: vmov r4, s0
1764; CHECK-NEXT: vstrw.32 q2, [sp, #64] @ 16-byte Spill
1765; CHECK-NEXT: vldrw.u32 q2, [r11, #80]
1766; CHECK-NEXT: vldrw.u32 q7, [r11, #64]
1767; CHECK-NEXT: vmov r3, s24
1768; CHECK-NEXT: vstrw.32 q2, [sp, #16] @ 16-byte Spill
1769; CHECK-NEXT: vldrw.u32 q2, [r11, #16]
1770; CHECK-NEXT: vmov r2, s7
1771; CHECK-NEXT: cmp r7, #1
1772; CHECK-NEXT: vfma.f32 q3, q2, r6
1773; CHECK-NEXT: vldrw.u32 q2, [sp, #16] @ 16-byte Reload
1774; CHECK-NEXT: vfma.f32 q3, q4, r4
1775; CHECK-NEXT: vmov lr, s6
1776; CHECK-NEXT: vfma.f32 q3, q5, r3
1777; CHECK-NEXT: vfma.f32 q3, q7, r0
1778; CHECK-NEXT: vfma.f32 q3, q2, r1
1779; CHECK-NEXT: vldrw.u32 q2, [sp, #32] @ 16-byte Reload
1780; CHECK-NEXT: vfma.f32 q3, q2, r2
1781; CHECK-NEXT: vldrw.u32 q2, [sp, #64] @ 16-byte Reload
1782; CHECK-NEXT: vfma.f32 q3, q2, lr
David Greene8e7b2c2020-05-28 17:49:01 +01001783; CHECK-NEXT: bne .LBB19_9
1784; CHECK-NEXT: @ %bb.8: @ %if.then58
1785; CHECK-NEXT: @ in Loop: Header=BB19_3 Depth=1
Tres Popp09d72ad2020-06-22 13:06:18 +02001786; CHECK-NEXT: vstr s12, [r5]
1787; CHECK-NEXT: vmov.f32 s8, s24
1788; CHECK-NEXT: vmov.f32 s0, s2
1789; CHECK-NEXT: vmov.f32 s14, s12
1790; CHECK-NEXT: b .LBB19_11
David Greene8e7b2c2020-05-28 17:49:01 +01001791; CHECK-NEXT: .LBB19_9: @ %if.else
1792; CHECK-NEXT: @ in Loop: Header=BB19_3 Depth=1
Tres Popp09d72ad2020-06-22 13:06:18 +02001793; CHECK-NEXT: cmp r7, #2
1794; CHECK-NEXT: vstmia r5, {s12, s13}
1795; CHECK-NEXT: bne .LBB19_12
David Greene8e7b2c2020-05-28 17:49:01 +01001796; CHECK-NEXT: @ %bb.10: @ in Loop: Header=BB19_3 Depth=1
Tres Popp09d72ad2020-06-22 13:06:18 +02001797; CHECK-NEXT: vmov.f32 s8, s0
1798; CHECK-NEXT: vmov.f32 s14, s13
1799; CHECK-NEXT: vmov.f32 s0, s24
1800; CHECK-NEXT: vmov.f32 s7, s12
1801; CHECK-NEXT: .LBB19_11: @ %if.end69
David Greene8e7b2c2020-05-28 17:49:01 +01001802; CHECK-NEXT: @ in Loop: Header=BB19_3 Depth=1
Tres Popp09d72ad2020-06-22 13:06:18 +02001803; CHECK-NEXT: vmov.f32 s2, s3
1804; CHECK-NEXT: ldr r2, [sp, #56] @ 4-byte Reload
1805; CHECK-NEXT: b .LBB19_2
1806; CHECK-NEXT: .LBB19_12: @ %if.else64
David Greene8e7b2c2020-05-28 17:49:01 +01001807; CHECK-NEXT: @ in Loop: Header=BB19_3 Depth=1
Tres Popp09d72ad2020-06-22 13:06:18 +02001808; CHECK-NEXT: vmov.f32 s7, s13
1809; CHECK-NEXT: ldr r2, [sp, #56] @ 4-byte Reload
1810; CHECK-NEXT: vmov.f32 s2, s3
1811; CHECK-NEXT: vstr s14, [r5, #8]
1812; CHECK-NEXT: vmov.f32 s8, s1
David Greene8e7b2c2020-05-28 17:49:01 +01001813; CHECK-NEXT: b .LBB19_2
1814; CHECK-NEXT: .LBB19_13: @ %do.end
Tres Popp09d72ad2020-06-22 13:06:18 +02001815; CHECK-NEXT: add sp, #88
David Greene8e7b2c2020-05-28 17:49:01 +01001816; CHECK-NEXT: vpop {d8, d9, d10, d11, d12, d13, d14, d15}
1817; CHECK-NEXT: add sp, #4
1818; CHECK-NEXT: pop.w {r4, r5, r6, r7, r8, r9, r10, r11, pc}
1819entry:
1820 %pState1 = getelementptr inbounds %struct.arm_biquad_casd_df1_inst_f32, %struct.arm_biquad_casd_df1_inst_f32* %S, i32 0, i32 1
1821 %0 = load float*, float** %pState1, align 4
1822 %pCoeffs2 = getelementptr inbounds %struct.arm_biquad_casd_df1_inst_f32, %struct.arm_biquad_casd_df1_inst_f32* %S, i32 0, i32 2
1823 %1 = load float*, float** %pCoeffs2, align 4
1824 %numStages = getelementptr inbounds %struct.arm_biquad_casd_df1_inst_f32, %struct.arm_biquad_casd_df1_inst_f32* %S, i32 0, i32 0
1825 %2 = load i32, i32* %numStages, align 4
1826 %shr = lshr i32 %blockSize, 2
1827 %cmp201 = icmp eq i32 %shr, 0
1828 %and = and i32 %blockSize, 3
1829 %tobool = icmp eq i32 %and, 0
1830 %cmp57 = icmp eq i32 %and, 1
1831 %cmp60 = icmp eq i32 %and, 2
1832 br label %do.body
1833
1834do.body: ; preds = %if.end69, %entry
1835 %pState.0 = phi float* [ %0, %entry ], [ %incdec.ptr73, %if.end69 ]
1836 %pCoeffs.0 = phi float* [ %1, %entry ], [ %add.ptr74, %if.end69 ]
1837 %pIn.0 = phi float* [ %pSrc, %entry ], [ %pDst, %if.end69 ]
1838 %X3.0 = phi float [ undef, %entry ], [ %X3.2, %if.end69 ]
1839 %stage.0 = phi i32 [ %2, %entry ], [ %dec75, %if.end69 ]
1840 %3 = load float, float* %pState.0, align 4
1841 %arrayidx3 = getelementptr inbounds float, float* %pState.0, i32 1
1842 %4 = load float, float* %arrayidx3, align 4
1843 %arrayidx4 = getelementptr inbounds float, float* %pState.0, i32 2
1844 %5 = load float, float* %arrayidx4, align 4
1845 %arrayidx5 = getelementptr inbounds float, float* %pState.0, i32 3
1846 %6 = load float, float* %arrayidx5, align 4
1847 br i1 %cmp201, label %while.end, label %while.body.lr.ph
1848
1849while.body.lr.ph: ; preds = %do.body
1850 %7 = bitcast float* %pCoeffs.0 to <4 x float>*
1851 %arrayidx9 = getelementptr inbounds float, float* %pCoeffs.0, i32 4
1852 %8 = bitcast float* %arrayidx9 to <4 x float>*
1853 %arrayidx12 = getelementptr inbounds float, float* %pCoeffs.0, i32 8
1854 %9 = bitcast float* %arrayidx12 to <4 x float>*
1855 %arrayidx15 = getelementptr inbounds float, float* %pCoeffs.0, i32 12
1856 %10 = bitcast float* %arrayidx15 to <4 x float>*
1857 %arrayidx18 = getelementptr inbounds float, float* %pCoeffs.0, i32 16
1858 %11 = bitcast float* %arrayidx18 to <4 x float>*
1859 %arrayidx21 = getelementptr inbounds float, float* %pCoeffs.0, i32 20
1860 %12 = bitcast float* %arrayidx21 to <4 x float>*
1861 %arrayidx24 = getelementptr inbounds float, float* %pCoeffs.0, i32 24
1862 %13 = bitcast float* %arrayidx24 to <4 x float>*
1863 %arrayidx27 = getelementptr inbounds float, float* %pCoeffs.0, i32 28
1864 %14 = bitcast float* %arrayidx27 to <4 x float>*
1865 br label %while.body
1866
1867while.body: ; preds = %while.body.lr.ph, %while.body
1868 %sample.0208 = phi i32 [ %shr, %while.body.lr.ph ], [ %dec, %while.body ]
1869 %pIn.1207 = phi float* [ %pIn.0, %while.body.lr.ph ], [ %incdec.ptr8, %while.body ]
1870 %pOut.1206 = phi float* [ %pDst, %while.body.lr.ph ], [ %add.ptr, %while.body ]
1871 %Yn2.0205 = phi float [ %6, %while.body.lr.ph ], [ %37, %while.body ]
1872 %Yn1.0204 = phi float [ %5, %while.body.lr.ph ], [ %36, %while.body ]
1873 %Xn2.0203 = phi float [ %4, %while.body.lr.ph ], [ %17, %while.body ]
1874 %Xn1.0202 = phi float [ %3, %while.body.lr.ph ], [ %18, %while.body ]
1875 %incdec.ptr = getelementptr inbounds float, float* %pIn.1207, i32 1
1876 %15 = load float, float* %pIn.1207, align 4
1877 %incdec.ptr6 = getelementptr inbounds float, float* %pIn.1207, i32 2
1878 %16 = load float, float* %incdec.ptr, align 4
1879 %incdec.ptr7 = getelementptr inbounds float, float* %pIn.1207, i32 3
1880 %17 = load float, float* %incdec.ptr6, align 4
1881 %incdec.ptr8 = getelementptr inbounds float, float* %pIn.1207, i32 4
1882 %18 = load float, float* %incdec.ptr7, align 4
1883 %19 = load <4 x float>, <4 x float>* %7, align 4
1884 %.splatinsert = insertelement <4 x float> undef, float %18, i32 0
1885 %.splat = shufflevector <4 x float> %.splatinsert, <4 x float> undef, <4 x i32> zeroinitializer
1886 %20 = fmul fast <4 x float> %.splat, %19
1887 %21 = load <4 x float>, <4 x float>* %8, align 4
1888 %.splatinsert10 = insertelement <4 x float> undef, float %17, i32 0
1889 %.splat11 = shufflevector <4 x float> %.splatinsert10, <4 x float> undef, <4 x i32> zeroinitializer
1890 %22 = tail call fast <4 x float> @llvm.fma.v4f32(<4 x float> %21, <4 x float> %.splat11, <4 x float> %20)
1891 %23 = load <4 x float>, <4 x float>* %9, align 4
1892 %.splatinsert13 = insertelement <4 x float> undef, float %16, i32 0
1893 %.splat14 = shufflevector <4 x float> %.splatinsert13, <4 x float> undef, <4 x i32> zeroinitializer
1894 %24 = tail call fast <4 x float> @llvm.fma.v4f32(<4 x float> %23, <4 x float> %.splat14, <4 x float> %22)
1895 %25 = load <4 x float>, <4 x float>* %10, align 4
1896 %.splatinsert16 = insertelement <4 x float> undef, float %15, i32 0
1897 %.splat17 = shufflevector <4 x float> %.splatinsert16, <4 x float> undef, <4 x i32> zeroinitializer
1898 %26 = tail call fast <4 x float> @llvm.fma.v4f32(<4 x float> %25, <4 x float> %.splat17, <4 x float> %24)
1899 %27 = load <4 x float>, <4 x float>* %11, align 4
1900 %.splatinsert19 = insertelement <4 x float> undef, float %Xn1.0202, i32 0
1901 %.splat20 = shufflevector <4 x float> %.splatinsert19, <4 x float> undef, <4 x i32> zeroinitializer
1902 %28 = tail call fast <4 x float> @llvm.fma.v4f32(<4 x float> %27, <4 x float> %.splat20, <4 x float> %26)
1903 %29 = load <4 x float>, <4 x float>* %12, align 4
1904 %.splatinsert22 = insertelement <4 x float> undef, float %Xn2.0203, i32 0
1905 %.splat23 = shufflevector <4 x float> %.splatinsert22, <4 x float> undef, <4 x i32> zeroinitializer
1906 %30 = tail call fast <4 x float> @llvm.fma.v4f32(<4 x float> %29, <4 x float> %.splat23, <4 x float> %28)
1907 %31 = load <4 x float>, <4 x float>* %13, align 4
1908 %.splatinsert25 = insertelement <4 x float> undef, float %Yn1.0204, i32 0
1909 %.splat26 = shufflevector <4 x float> %.splatinsert25, <4 x float> undef, <4 x i32> zeroinitializer
1910 %32 = tail call fast <4 x float> @llvm.fma.v4f32(<4 x float> %31, <4 x float> %.splat26, <4 x float> %30)
1911 %33 = load <4 x float>, <4 x float>* %14, align 4
1912 %.splatinsert28 = insertelement <4 x float> undef, float %Yn2.0205, i32 0
1913 %.splat29 = shufflevector <4 x float> %.splatinsert28, <4 x float> undef, <4 x i32> zeroinitializer
1914 %34 = tail call fast <4 x float> @llvm.fma.v4f32(<4 x float> %33, <4 x float> %.splat29, <4 x float> %32)
1915 %35 = bitcast float* %pOut.1206 to <4 x float>*
1916 store <4 x float> %34, <4 x float>* %35, align 4
1917 %add.ptr = getelementptr inbounds float, float* %pOut.1206, i32 4
1918 %36 = extractelement <4 x float> %34, i32 3
1919 %37 = extractelement <4 x float> %34, i32 2
1920 %dec = add nsw i32 %sample.0208, -1
1921 %cmp = icmp eq i32 %dec, 0
1922 br i1 %cmp, label %while.end, label %while.body
1923
1924while.end: ; preds = %while.body, %do.body
1925 %Xn1.0.lcssa = phi float [ %3, %do.body ], [ %18, %while.body ]
1926 %Xn2.0.lcssa = phi float [ %4, %do.body ], [ %17, %while.body ]
1927 %Yn1.0.lcssa = phi float [ %5, %do.body ], [ %36, %while.body ]
1928 %Yn2.0.lcssa = phi float [ %6, %do.body ], [ %37, %while.body ]
1929 %pOut.1.lcssa = phi float* [ %pDst, %do.body ], [ %add.ptr, %while.body ]
1930 %pIn.1.lcssa = phi float* [ %pIn.0, %do.body ], [ %incdec.ptr8, %while.body ]
1931 %X3.1.lcssa = phi float [ %X3.0, %do.body ], [ %18, %while.body ]
1932 br i1 %tobool, label %if.end69, label %if.then
1933
1934if.then: ; preds = %while.end
1935 %incdec.ptr30 = getelementptr inbounds float, float* %pIn.1.lcssa, i32 1
1936 %38 = load float, float* %pIn.1.lcssa, align 4
1937 %incdec.ptr31 = getelementptr inbounds float, float* %pIn.1.lcssa, i32 2
1938 %39 = load float, float* %incdec.ptr30, align 4
1939 %incdec.ptr32 = getelementptr inbounds float, float* %pIn.1.lcssa, i32 3
1940 %40 = load float, float* %incdec.ptr31, align 4
1941 %41 = load float, float* %incdec.ptr32, align 4
1942 %42 = bitcast float* %pCoeffs.0 to <4 x float>*
1943 %43 = load <4 x float>, <4 x float>* %42, align 4
1944 %.splatinsert34 = insertelement <4 x float> undef, float %41, i32 0
1945 %.splat35 = shufflevector <4 x float> %.splatinsert34, <4 x float> undef, <4 x i32> zeroinitializer
1946 %44 = fmul fast <4 x float> %.splat35, %43
1947 %arrayidx36 = getelementptr inbounds float, float* %pCoeffs.0, i32 4
1948 %45 = bitcast float* %arrayidx36 to <4 x float>*
1949 %46 = load <4 x float>, <4 x float>* %45, align 4
1950 %.splatinsert37 = insertelement <4 x float> undef, float %40, i32 0
1951 %.splat38 = shufflevector <4 x float> %.splatinsert37, <4 x float> undef, <4 x i32> zeroinitializer
1952 %47 = tail call fast <4 x float> @llvm.fma.v4f32(<4 x float> %46, <4 x float> %.splat38, <4 x float> %44)
1953 %arrayidx39 = getelementptr inbounds float, float* %pCoeffs.0, i32 8
1954 %48 = bitcast float* %arrayidx39 to <4 x float>*
1955 %49 = load <4 x float>, <4 x float>* %48, align 4
1956 %.splatinsert40 = insertelement <4 x float> undef, float %39, i32 0
1957 %.splat41 = shufflevector <4 x float> %.splatinsert40, <4 x float> undef, <4 x i32> zeroinitializer
1958 %50 = tail call fast <4 x float> @llvm.fma.v4f32(<4 x float> %49, <4 x float> %.splat41, <4 x float> %47)
1959 %arrayidx42 = getelementptr inbounds float, float* %pCoeffs.0, i32 12
1960 %51 = bitcast float* %arrayidx42 to <4 x float>*
1961 %52 = load <4 x float>, <4 x float>* %51, align 4
1962 %.splatinsert43 = insertelement <4 x float> undef, float %38, i32 0
1963 %.splat44 = shufflevector <4 x float> %.splatinsert43, <4 x float> undef, <4 x i32> zeroinitializer
1964 %53 = tail call fast <4 x float> @llvm.fma.v4f32(<4 x float> %52, <4 x float> %.splat44, <4 x float> %50)
1965 %arrayidx45 = getelementptr inbounds float, float* %pCoeffs.0, i32 16
1966 %54 = bitcast float* %arrayidx45 to <4 x float>*
1967 %55 = load <4 x float>, <4 x float>* %54, align 4
1968 %.splatinsert46 = insertelement <4 x float> undef, float %Xn1.0.lcssa, i32 0
1969 %.splat47 = shufflevector <4 x float> %.splatinsert46, <4 x float> undef, <4 x i32> zeroinitializer
1970 %56 = tail call fast <4 x float> @llvm.fma.v4f32(<4 x float> %55, <4 x float> %.splat47, <4 x float> %53)
1971 %arrayidx48 = getelementptr inbounds float, float* %pCoeffs.0, i32 20
1972 %57 = bitcast float* %arrayidx48 to <4 x float>*
1973 %58 = load <4 x float>, <4 x float>* %57, align 4
1974 %.splatinsert49 = insertelement <4 x float> undef, float %Xn2.0.lcssa, i32 0
1975 %.splat50 = shufflevector <4 x float> %.splatinsert49, <4 x float> undef, <4 x i32> zeroinitializer
1976 %59 = tail call fast <4 x float> @llvm.fma.v4f32(<4 x float> %58, <4 x float> %.splat50, <4 x float> %56)
1977 %arrayidx51 = getelementptr inbounds float, float* %pCoeffs.0, i32 24
1978 %60 = bitcast float* %arrayidx51 to <4 x float>*
1979 %61 = load <4 x float>, <4 x float>* %60, align 4
1980 %.splatinsert52 = insertelement <4 x float> undef, float %Yn1.0.lcssa, i32 0
1981 %.splat53 = shufflevector <4 x float> %.splatinsert52, <4 x float> undef, <4 x i32> zeroinitializer
1982 %62 = tail call fast <4 x float> @llvm.fma.v4f32(<4 x float> %61, <4 x float> %.splat53, <4 x float> %59)
1983 %arrayidx54 = getelementptr inbounds float, float* %pCoeffs.0, i32 28
1984 %63 = bitcast float* %arrayidx54 to <4 x float>*
1985 %64 = load <4 x float>, <4 x float>* %63, align 4
1986 %.splatinsert55 = insertelement <4 x float> undef, float %Yn2.0.lcssa, i32 0
1987 %.splat56 = shufflevector <4 x float> %.splatinsert55, <4 x float> undef, <4 x i32> zeroinitializer
1988 %65 = tail call fast <4 x float> @llvm.fma.v4f32(<4 x float> %64, <4 x float> %.splat56, <4 x float> %62)
1989 %66 = extractelement <4 x float> %65, i32 0
1990 br i1 %cmp57, label %if.then58, label %if.else
1991
1992if.then58: ; preds = %if.then
1993 store float %66, float* %pOut.1.lcssa, align 4
1994 br label %if.end69
1995
1996if.else: ; preds = %if.then
1997 %incdec.ptr62 = getelementptr inbounds float, float* %pOut.1.lcssa, i32 1
1998 store float %66, float* %pOut.1.lcssa, align 4
1999 %67 = extractelement <4 x float> %65, i32 1
2000 store float %67, float* %incdec.ptr62, align 4
2001 br i1 %cmp60, label %if.end69, label %if.else64
2002
2003if.else64: ; preds = %if.else
2004 %incdec.ptr63 = getelementptr inbounds float, float* %pOut.1.lcssa, i32 2
2005 %68 = extractelement <4 x float> %65, i32 2
2006 store float %68, float* %incdec.ptr63, align 4
2007 br label %if.end69
2008
2009if.end69: ; preds = %if.else, %while.end, %if.then58, %if.else64
2010 %Xn1.1 = phi float [ %38, %if.then58 ], [ %40, %if.else64 ], [ %Xn1.0.lcssa, %while.end ], [ %39, %if.else ]
2011 %Xn2.1 = phi float [ %X3.1.lcssa, %if.then58 ], [ %39, %if.else64 ], [ %Xn2.0.lcssa, %while.end ], [ %38, %if.else ]
2012 %Yn1.1 = phi float [ %66, %if.then58 ], [ %68, %if.else64 ], [ %Yn1.0.lcssa, %while.end ], [ %67, %if.else ]
2013 %Yn2.1 = phi float [ %Yn1.0.lcssa, %if.then58 ], [ %67, %if.else64 ], [ %Yn2.0.lcssa, %while.end ], [ %66, %if.else ]
2014 %X3.2 = phi float [ %41, %if.then58 ], [ %41, %if.else64 ], [ %X3.1.lcssa, %while.end ], [ %41, %if.else ]
2015 store float %Xn1.1, float* %pState.0, align 4
2016 store float %Xn2.1, float* %arrayidx3, align 4
2017 store float %Yn1.1, float* %arrayidx4, align 4
2018 %incdec.ptr73 = getelementptr inbounds float, float* %pState.0, i32 4
2019 store float %Yn2.1, float* %arrayidx5, align 4
2020 %add.ptr74 = getelementptr inbounds float, float* %pCoeffs.0, i32 32
2021 %dec75 = add i32 %stage.0, -1
2022 %cmp76 = icmp eq i32 %dec75, 0
2023 br i1 %cmp76, label %do.end, label %do.body
2024
2025do.end: ; preds = %if.end69
2026 ret void
2027}
2028
2029declare void @llvm.lifetime.end.p0i8(i64 immarg, i8* nocapture)
2030declare void @llvm.lifetime.start.p0i8(i64 immarg, i8* nocapture)
2031declare { <4 x i32>, i32 } @llvm.arm.mve.viwdup.v4i32(i32, i32, i32)
2032declare <4 x i32> @llvm.arm.mve.vldr.gather.offset.v4i32.p0i32.v4i32(i32*, <4 x i32>, i32, i32, i32)
David Green9cf920e2020-03-20 08:25:19 +00002033declare void @llvm.assume(i1)
2034declare <4 x i1> @llvm.arm.mve.vctp32(i32)
2035declare <4 x float> @llvm.fma.v4f32(<4 x float>, <4 x float>, <4 x float>)
2036declare void @llvm.masked.store.v4f32.p0v4f32(<4 x float>, <4 x float>*, i32 immarg, <4 x i1>)