1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2; RUN: llc -mtriple=thumbv8.1m.main-none-none-eabi -mattr=+mve.fp -verify-machineinstrs %s -o - | FileCheck %s
3
4define arm_aapcs_vfpcc void @test_fadd(half* noalias nocapture readonly %A, half %B, half* 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
10; CHECK-NEXT:  .LBB0_1: @ %vector.ph
11; CHECK-NEXT:    vmov.f16 r3, s0
12; CHECK-NEXT:  .LBB0_2: @ %vector.body
13; CHECK-NEXT:    @ =>This Inner Loop Header: Depth=1
14; CHECK-NEXT:    vldrw.u32 q0, [r0], #16
15; CHECK-NEXT:    subs r2, #8
16; CHECK-NEXT:    vadd.f16 q0, q0, r3
17; CHECK-NEXT:    vstrb.8 q0, [r1], #16
18; CHECK-NEXT:    bne .LBB0_2
19; CHECK-NEXT:  @ %bb.3: @ %for.cond.cleanup
20; 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 <8 x half> undef, half %B, i32 0
30  %broadcast.splat11 = shufflevector <8 x half> %broadcast.splatinsert10, <8 x half> undef, <8 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 half, half* %A, i32 %index
36  %2 = bitcast half* %1 to <8 x half>*
37  %wide.load = load <8 x half>, <8 x half>* %2, align 4
38  %3 = fadd fast <8 x half> %wide.load, %broadcast.splat11
39  %4 = getelementptr inbounds half, half* %C, i32 %index
40  %5 = bitcast half* %4 to <8 x half>*
41  store <8 x half> %3, <8 x half>* %5, align 4
42  %index.next = add i32 %index, 8
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(half* noalias nocapture readonly %A, half %B, half* 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
56; CHECK-NEXT:  .LBB1_1: @ %vector.ph
57; CHECK-NEXT:    vmov.f16 r3, s0
58; CHECK-NEXT:  .LBB1_2: @ %vector.body
59; CHECK-NEXT:    @ =>This Inner Loop Header: Depth=1
60; CHECK-NEXT:    vldrw.u32 q0, [r0], #16
61; CHECK-NEXT:    subs r2, #8
62; CHECK-NEXT:    vadd.f16 q0, q0, r3
63; CHECK-NEXT:    vstrb.8 q0, [r1], #16
64; CHECK-NEXT:    bne .LBB1_2
65; CHECK-NEXT:  @ %bb.3: @ %for.cond.cleanup
66; 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 <8 x half> undef, half %B, i32 0
76  %broadcast.splat11 = shufflevector <8 x half> %broadcast.splatinsert10, <8 x half> undef, <8 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 half, half* %A, i32 %index
82  %2 = bitcast half* %1 to <8 x half>*
83  %wide.load = load <8 x half>, <8 x half>* %2, align 4
84  %3 = fadd fast <8 x half> %broadcast.splat11, %wide.load
85  %4 = getelementptr inbounds half, half* %C, i32 %index
86  %5 = bitcast half* %4 to <8 x half>*
87  store <8 x half> %3, <8 x half>* %5, align 4
88  %index.next = add i32 %index, 8
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(half* noalias nocapture readonly %A, half %B, half* 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
102; CHECK-NEXT:  .LBB2_1: @ %vector.ph
103; CHECK-NEXT:    vmov.f16 r3, s0
104; CHECK-NEXT:  .LBB2_2: @ %vector.body
105; CHECK-NEXT:    @ =>This Inner Loop Header: Depth=1
106; CHECK-NEXT:    vldrw.u32 q0, [r0], #16
107; CHECK-NEXT:    subs r2, #8
108; CHECK-NEXT:    vmul.f16 q0, q0, r3
109; CHECK-NEXT:    vstrb.8 q0, [r1], #16
110; CHECK-NEXT:    bne .LBB2_2
111; CHECK-NEXT:  @ %bb.3: @ %for.cond.cleanup
112; 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 <8 x half> undef, half %B, i32 0
122  %broadcast.splat11 = shufflevector <8 x half> %broadcast.splatinsert10, <8 x half> undef, <8 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 half, half* %A, i32 %index
128  %2 = bitcast half* %1 to <8 x half>*
129  %wide.load = load <8 x half>, <8 x half>* %2, align 4
130  %3 = fmul fast <8 x half> %wide.load, %broadcast.splat11
131  %4 = getelementptr inbounds half, half* %C, i32 %index
132  %5 = bitcast half* %4 to <8 x half>*
133  store <8 x half> %3, <8 x half>* %5, align 4
134  %index.next = add i32 %index, 8
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(half* noalias nocapture readonly %A, half %B, half* 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
148; CHECK-NEXT:  .LBB3_1: @ %vector.ph
149; CHECK-NEXT:    vmov.f16 r3, s0
150; CHECK-NEXT:  .LBB3_2: @ %vector.body
151; CHECK-NEXT:    @ =>This Inner Loop Header: Depth=1
152; CHECK-NEXT:    vldrw.u32 q0, [r0], #16
153; CHECK-NEXT:    subs r2, #8
154; CHECK-NEXT:    vmul.f16 q0, q0, r3
155; CHECK-NEXT:    vstrb.8 q0, [r1], #16
156; CHECK-NEXT:    bne .LBB3_2
157; CHECK-NEXT:  @ %bb.3: @ %for.cond.cleanup
158; 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 <8 x half> undef, half %B, i32 0
168  %broadcast.splat11 = shufflevector <8 x half> %broadcast.splatinsert10, <8 x half> undef, <8 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 half, half* %A, i32 %index
174  %2 = bitcast half* %1 to <8 x half>*
175  %wide.load = load <8 x half>, <8 x half>* %2, align 4
176  %3 = fmul fast <8 x half> %broadcast.splat11, %wide.load
177  %4 = getelementptr inbounds half, half* %C, i32 %index
178  %5 = bitcast half* %4 to <8 x half>*
179  store <8 x half> %3, <8 x half>* %5, align 4
180  %index.next = add i32 %index, 8
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(half* noalias nocapture readonly %A, half %B, half* 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
194; CHECK-NEXT:  .LBB4_1: @ %vector.ph
195; CHECK-NEXT:    vmov.f16 r3, s0
196; CHECK-NEXT:  .LBB4_2: @ %vector.body
197; CHECK-NEXT:    @ =>This Inner Loop Header: Depth=1
198; CHECK-NEXT:    vldrw.u32 q0, [r0], #16
199; CHECK-NEXT:    subs r2, #8
200; CHECK-NEXT:    vsub.f16 q0, q0, r3
201; CHECK-NEXT:    vstrb.8 q0, [r1], #16
202; CHECK-NEXT:    bne .LBB4_2
203; CHECK-NEXT:  @ %bb.3: @ %for.cond.cleanup
204; 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 <8 x half> undef, half %B, i32 0
214  %broadcast.splat11 = shufflevector <8 x half> %broadcast.splatinsert10, <8 x half> undef, <8 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 half, half* %A, i32 %index
220  %2 = bitcast half* %1 to <8 x half>*
221  %wide.load = load <8 x half>, <8 x half>* %2, align 4
222  %3 = fsub fast <8 x half> %wide.load, %broadcast.splat11
223  %4 = getelementptr inbounds half, half* %C, i32 %index
224  %5 = bitcast half* %4 to <8 x half>*
225  store <8 x half> %3, <8 x half>* %5, align 4
226  %index.next = add i32 %index, 8
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(half* noalias nocapture readonly %A, half %B, half* 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
240; CHECK-NEXT:  .LBB5_1: @ %vector.ph
241; CHECK-NEXT:    vmov.f16 r3, s0
242; CHECK-NEXT:    vdup.16 q0, r3
243; CHECK-NEXT:  .LBB5_2: @ %vector.body
244; CHECK-NEXT:    @ =>This Inner Loop Header: Depth=1
245; CHECK-NEXT:    vldrw.u32 q1, [r0], #16
246; CHECK-NEXT:    subs r2, #8
247; CHECK-NEXT:    vsub.f16 q1, q0, q1
248; CHECK-NEXT:    vstrb.8 q1, [r1], #16
249; CHECK-NEXT:    bne .LBB5_2
250; CHECK-NEXT:  @ %bb.3: @ %for.cond.cleanup
251; 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 <8 x half> undef, half %B, i32 0
261  %broadcast.splat11 = shufflevector <8 x half> %broadcast.splatinsert10, <8 x half> undef, <8 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 half, half* %A, i32 %index
267  %2 = bitcast half* %1 to <8 x half>*
268  %wide.load = load <8 x half>, <8 x half>* %2, align 4
269  %3 = fsub fast <8 x half> %broadcast.splat11, %wide.load
270  %4 = getelementptr inbounds half, half* %C, i32 %index
271  %5 = bitcast half* %4 to <8 x half>*
272  store <8 x half> %3, <8 x half>* %5, align 4
273  %index.next = add i32 %index, 8
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(half* noalias nocapture readonly %A, half* noalias nocapture readonly %B, half %C, half* 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
288; CHECK-NEXT:  .LBB6_1: @ %vector.ph
289; CHECK-NEXT:    vmov.f16 r12, s0
290; CHECK-NEXT:  .LBB6_2: @ %vector.body
291; CHECK-NEXT:    @ =>This Inner Loop Header: Depth=1
292; CHECK-NEXT:    vldrw.u32 q0, [r0], #16
293; CHECK-NEXT:    vldrw.u32 q1, [r1], #16
294; CHECK-NEXT:    subs r3, #8
295; CHECK-NEXT:    vfmas.f16 q1, q0, r12
296; CHECK-NEXT:    vstrb.8 q1, [r2], #16
297; CHECK-NEXT:    bne .LBB6_2
298; CHECK-NEXT:  @ %bb.3: @ %for.cond.cleanup
299; 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 <8 x half> undef, half %C, i32 0
309  %broadcast.splat14 = shufflevector <8 x half> %broadcast.splatinsert13, <8 x half> undef, <8 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 half, half* %A, i32 %index
315  %2 = bitcast half* %1 to <8 x half>*
316  %wide.load = load <8 x half>, <8 x half>* %2, align 4
317  %3 = getelementptr inbounds half, half* %B, i32 %index
318  %4 = bitcast half* %3 to <8 x half>*
319  %wide.load12 = load <8 x half>, <8 x half>* %4, align 4
320  %5 = fmul fast <8 x half> %wide.load12, %wide.load
321  %6 = fadd fast <8 x half> %5, %broadcast.splat14
322  %7 = getelementptr inbounds half, half* %D, i32 %index
323  %8 = bitcast half* %7 to <8 x half>*
324  store <8 x half> %6, <8 x half>* %8, align 4
325  %index.next = add i32 %index, 8
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(half* noalias nocapture readonly %A, half* noalias nocapture readonly %B, half %C, half* 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
339; CHECK-NEXT:  .LBB7_1: @ %vector.ph
340; CHECK-NEXT:    vmov.f16 r12, s0
341; CHECK-NEXT:  .LBB7_2: @ %vector.body
342; CHECK-NEXT:    @ =>This Inner Loop Header: Depth=1
343; CHECK-NEXT:    vldrw.u32 q0, [r0], #16
344; CHECK-NEXT:    vldrw.u32 q1, [r1], #16
345; CHECK-NEXT:    subs r3, #8
346; CHECK-NEXT:    vfmas.f16 q1, q0, r12
347; CHECK-NEXT:    vstrb.8 q1, [r2], #16
348; CHECK-NEXT:    bne .LBB7_2
349; CHECK-NEXT:  @ %bb.3: @ %for.cond.cleanup
350; 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 <8 x half> undef, half %C, i32 0
360  %broadcast.splat14 = shufflevector <8 x half> %broadcast.splatinsert13, <8 x half> undef, <8 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 half, half* %A, i32 %index
366  %2 = bitcast half* %1 to <8 x half>*
367  %wide.load = load <8 x half>, <8 x half>* %2, align 4
368  %3 = getelementptr inbounds half, half* %B, i32 %index
369  %4 = bitcast half* %3 to <8 x half>*
370  %wide.load12 = load <8 x half>, <8 x half>* %4, align 4
371  %5 = fmul fast <8 x half> %wide.load12, %wide.load
372  %6 = fadd fast <8 x half> %broadcast.splat14, %5
373  %7 = getelementptr inbounds half, half* %D, i32 %index
374  %8 = bitcast half* %7 to <8 x half>*
375  store <8 x half> %6, <8 x half>* %8, align 4
376  %index.next = add i32 %index, 8
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(half* noalias nocapture readonly %A, half* noalias nocapture readonly %B, half %C, half* 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
390; CHECK-NEXT:  .LBB8_1: @ %vector.ph
391; CHECK-NEXT:    vmov.f16 r12, s0
392; CHECK-NEXT:  .LBB8_2: @ %vector.body
393; CHECK-NEXT:    @ =>This Inner Loop Header: Depth=1
394; CHECK-NEXT:    vldrw.u32 q0, [r0], #16
395; CHECK-NEXT:    vldrw.u32 q1, [r1], #16
396; CHECK-NEXT:    subs r3, #8
397; CHECK-NEXT:    vfma.f16 q1, q0, r12
398; CHECK-NEXT:    vstrb.8 q1, [r2], #16
399; CHECK-NEXT:    bne .LBB8_2
400; CHECK-NEXT:  @ %bb.3: @ %for.cond.cleanup
401; 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 <8 x half> undef, half %C, i32 0
411  %broadcast.splat13 = shufflevector <8 x half> %broadcast.splatinsert12, <8 x half> undef, <8 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 half, half* %A, i32 %index
417  %2 = bitcast half* %1 to <8 x half>*
418  %wide.load = load <8 x half>, <8 x half>* %2, align 4
419  %3 = fmul fast <8 x half> %wide.load, %broadcast.splat13
420  %4 = getelementptr inbounds half, half* %B, i32 %index
421  %5 = bitcast half* %4 to <8 x half>*
422  %wide.load14 = load <8 x half>, <8 x half>* %5, align 4
423  %6 = fadd fast <8 x half> %3, %wide.load14
424  %7 = getelementptr inbounds half, half* %D, i32 %index
425  %8 = bitcast half* %7 to <8 x half>*
426  store <8 x half> %6, <8 x half>* %8, align 4
427  %index.next = add i32 %index, 8
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(half* noalias nocapture readonly %A, half* noalias nocapture readonly %B, half %C, half* 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
441; CHECK-NEXT:  .LBB9_1: @ %vector.ph
442; CHECK-NEXT:    vmov.f16 r12, s0
443; CHECK-NEXT:  .LBB9_2: @ %vector.body
444; CHECK-NEXT:    @ =>This Inner Loop Header: Depth=1
445; CHECK-NEXT:    vldrw.u32 q0, [r0], #16
446; CHECK-NEXT:    vldrw.u32 q1, [r1], #16
447; CHECK-NEXT:    subs r3, #8
448; CHECK-NEXT:    vfma.f16 q1, q0, r12
449; CHECK-NEXT:    vstrb.8 q1, [r2], #16
450; CHECK-NEXT:    bne .LBB9_2
451; CHECK-NEXT:  @ %bb.3: @ %for.cond.cleanup
452; 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 <8 x half> undef, half %C, i32 0
462  %broadcast.splat13 = shufflevector <8 x half> %broadcast.splatinsert12, <8 x half> undef, <8 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 half, half* %A, i32 %index
468  %2 = bitcast half* %1 to <8 x half>*
469  %wide.load = load <8 x half>, <8 x half>* %2, align 4
470  %3 = fmul fast <8 x half> %broadcast.splat13, %wide.load
471  %4 = getelementptr inbounds half, half* %B, i32 %index
472  %5 = bitcast half* %4 to <8 x half>*
473  %wide.load14 = load <8 x half>, <8 x half>* %5, align 4
474  %6 = fadd fast <8 x half> %3, %wide.load14
475  %7 = getelementptr inbounds half, half* %D, i32 %index
476  %8 = bitcast half* %7 to <8 x half>*
477  store <8 x half> %6, <8 x half>* %8, align 4
478  %index.next = add i32 %index, 8
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(half* noalias nocapture readonly %A, half* noalias nocapture readonly %B, half %C, half* 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
493; CHECK-NEXT:  .LBB10_1: @ %vector.ph
494; CHECK-NEXT:    vmov.f16 r12, s0
495; CHECK-NEXT:    vdup.16 q0, r12
496; CHECK-NEXT:    vneg.f16 q0, q0
497; CHECK-NEXT:  .LBB10_2: @ %vector.body
498; 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, #8
503; CHECK-NEXT:    vfma.f16 q3, q2, q1
504; CHECK-NEXT:    vstrb.8 q3, [r2], #16
505; CHECK-NEXT:    bne .LBB10_2
506; CHECK-NEXT:  @ %bb.3: @ %for.cond.cleanup
507; 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 <8 x half> undef, half %C, i32 0
517  %broadcast.splat14 = shufflevector <8 x half> %broadcast.splatinsert13, <8 x half> undef, <8 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 half, half* %A, i32 %index
523  %2 = bitcast half* %1 to <8 x half>*
524  %wide.load = load <8 x half>, <8 x half>* %2, align 4
525  %3 = getelementptr inbounds half, half* %B, i32 %index
526  %4 = bitcast half* %3 to <8 x half>*
527  %wide.load12 = load <8 x half>, <8 x half>* %4, align 4
528  %5 = fmul fast <8 x half> %wide.load12, %wide.load
529  %6 = fsub fast <8 x half> %5, %broadcast.splat14
530  %7 = getelementptr inbounds half, half* %D, i32 %index
531  %8 = bitcast half* %7 to <8 x half>*
532  store <8 x half> %6, <8 x half>* %8, align 4
533  %index.next = add i32 %index, 8
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(half* noalias nocapture readonly %A, half* noalias nocapture readonly %B, half %C, half* 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
547; CHECK-NEXT:  .LBB11_1: @ %vector.ph
548; CHECK-NEXT:    vmov.f16 r12, s0
549; CHECK-NEXT:    vdup.16 q0, r12
550; CHECK-NEXT:  .LBB11_2: @ %vector.body
551; 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, #8
556; CHECK-NEXT:    vfms.f16 q3, q2, q1
557; CHECK-NEXT:    vstrb.8 q3, [r2], #16
558; CHECK-NEXT:    bne .LBB11_2
559; CHECK-NEXT:  @ %bb.3: @ %for.cond.cleanup
560; 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 <8 x half> undef, half %C, i32 0
570  %broadcast.splat14 = shufflevector <8 x half> %broadcast.splatinsert13, <8 x half> undef, <8 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 half, half* %A, i32 %index
576  %2 = bitcast half* %1 to <8 x half>*
577  %wide.load = load <8 x half>, <8 x half>* %2, align 4
578  %3 = getelementptr inbounds half, half* %B, i32 %index
579  %4 = bitcast half* %3 to <8 x half>*
580  %wide.load12 = load <8 x half>, <8 x half>* %4, align 4
581  %5 = fmul fast <8 x half> %wide.load12, %wide.load
582  %6 = fsub fast <8 x half> %broadcast.splat14, %5
583  %7 = getelementptr inbounds half, half* %D, i32 %index
584  %8 = bitcast half* %7 to <8 x half>*
585  store <8 x half> %6, <8 x half>* %8, align 4
586  %index.next = add i32 %index, 8
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(half* noalias nocapture readonly %A, half* noalias nocapture readonly %B, half %C, half* 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
600; CHECK-NEXT:  .LBB12_1: @ %vector.ph
601; CHECK-NEXT:    vmov.f16 r12, s0
602; CHECK-NEXT:  .LBB12_2: @ %vector.body
603; CHECK-NEXT:    @ =>This Inner Loop Header: Depth=1
604; CHECK-NEXT:    vldrw.u32 q0, [r1], #16
605; CHECK-NEXT:    vldrw.u32 q1, [r0], #16
606; CHECK-NEXT:    subs r3, #8
607; CHECK-NEXT:    vneg.f16 q0, q0
608; CHECK-NEXT:    vfma.f16 q0, q1, r12
609; CHECK-NEXT:    vstrb.8 q0, [r2], #16
610; CHECK-NEXT:    bne .LBB12_2
611; CHECK-NEXT:  @ %bb.3: @ %for.cond.cleanup
612; 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 <8 x half> undef, half %C, i32 0
622  %broadcast.splat13 = shufflevector <8 x half> %broadcast.splatinsert12, <8 x half> undef, <8 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 half, half* %A, i32 %index
628  %2 = bitcast half* %1 to <8 x half>*
629  %wide.load = load <8 x half>, <8 x half>* %2, align 4
630  %3 = fmul fast <8 x half> %wide.load, %broadcast.splat13
631  %4 = getelementptr inbounds half, half* %B, i32 %index
632  %5 = bitcast half* %4 to <8 x half>*
633  %wide.load14 = load <8 x half>, <8 x half>* %5, align 4
634  %6 = fsub fast <8 x half> %3, %wide.load14
635  %7 = getelementptr inbounds half, half* %D, i32 %index
636  %8 = bitcast half* %7 to <8 x half>*
637  store <8 x half> %6, <8 x half>* %8, align 4
638  %index.next = add i32 %index, 8
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(half* noalias nocapture readonly %A, half* noalias nocapture readonly %B, half %C, half* 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
652; CHECK-NEXT:  .LBB13_1: @ %vector.ph
653; CHECK-NEXT:    vmov.f16 r12, s0
654; CHECK-NEXT:  .LBB13_2: @ %vector.body
655; CHECK-NEXT:    @ =>This Inner Loop Header: Depth=1
656; CHECK-NEXT:    vldrw.u32 q0, [r1], #16
657; CHECK-NEXT:    vldrw.u32 q1, [r0], #16
658; CHECK-NEXT:    subs r3, #8
659; CHECK-NEXT:    vneg.f16 q0, q0
660; CHECK-NEXT:    vfma.f16 q0, q1, r12
661; CHECK-NEXT:    vstrb.8 q0, [r2], #16
662; CHECK-NEXT:    bne .LBB13_2
663; CHECK-NEXT:  @ %bb.3: @ %for.cond.cleanup
664; 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 <8 x half> undef, half %C, i32 0
674  %broadcast.splat13 = shufflevector <8 x half> %broadcast.splatinsert12, <8 x half> undef, <8 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 half, half* %A, i32 %index
680  %2 = bitcast half* %1 to <8 x half>*
681  %wide.load = load <8 x half>, <8 x half>* %2, align 4
682  %3 = fmul fast <8 x half> %broadcast.splat13, %wide.load
683  %4 = getelementptr inbounds half, half* %B, i32 %index
684  %5 = bitcast half* %4 to <8 x half>*
685  %wide.load14 = load <8 x half>, <8 x half>* %5, align 4
686  %6 = fsub fast <8 x half> %3, %wide.load14
687  %7 = getelementptr inbounds half, half* %D, i32 %index
688  %8 = bitcast half* %7 to <8 x half>*
689  store <8 x half> %6, <8 x half>* %8, align 4
690  %index.next = add i32 %index, 8
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(half* noalias nocapture %pInT1, half* noalias nocapture readonly %pOutT1, half* noalias nocapture readonly %pPRT_in, half* noalias nocapture readnone %pPRT_pDst, i32 %numRows, i32 %numCols, i32 %l) local_unnamed_addr #0 {
700; CHECK-LABEL: test_nested:
701; CHECK:       @ %bb.0: @ %for.body.us.preheader
702; CHECK-NEXT:    .save {r4, r5, r6, lr}
703; CHECK-NEXT:    push {r4, r5, r6, lr}
704; CHECK-NEXT:    ldrd lr, r12, [sp, #16]
705; CHECK-NEXT:    lsl.w r3, r12, #1
706; CHECK-NEXT:  .LBB14_1: @ %for.body.us
707; CHECK-NEXT:    @ =>This Loop Header: Depth=1
708; CHECK-NEXT:    @ Child Loop BB14_2 Depth 2
709; CHECK-NEXT:    ldrh r4, [r1]
710; CHECK-NEXT:    mov r5, r2
711; CHECK-NEXT:    mov r6, r12
712; CHECK-NEXT:    vdup.16 q0, r4
713; CHECK-NEXT:    mov r4, r0
714; CHECK-NEXT:  .LBB14_2: @ %vector.body
715; CHECK-NEXT:    @ Parent Loop BB14_1 Depth=1
716; CHECK-NEXT:    @ => This Inner Loop Header: Depth=2
717; CHECK-NEXT:    vldrw.u32 q1, [r5], #16
718; CHECK-NEXT:    vldrw.u32 q2, [r4]
719; CHECK-NEXT:    subs r6, #8
720; CHECK-NEXT:    vfms.f16 q2, q1, q0
721; CHECK-NEXT:    vstrb.8 q2, [r4], #16
722; CHECK-NEXT:    bne .LBB14_2
723; CHECK-NEXT:  @ %bb.3: @ %for.cond6.for.end_crit_edge.us
724; CHECK-NEXT:    @ in Loop: Header=BB14_1 Depth=1
725; CHECK-NEXT:    add r0, r3
726; CHECK-NEXT:    add r2, r3
727; CHECK-NEXT:    adds r1, #2
728; CHECK-NEXT:    le lr, .LBB14_1
729; CHECK-NEXT:  @ %bb.4: @ %for.end14
730; CHECK-NEXT:    pop {r4, r5, r6, pc}
731for.body.us.preheader:
732  %cmp = icmp sgt i32 %numRows, 0
733  tail call void @llvm.assume(i1 %cmp)
734  %cmp1 = icmp sgt i32 %numCols, 0
735  tail call void @llvm.assume(i1 %cmp1)
736  %rem = and i32 %numCols, 7
737  %cmp2 = icmp eq i32 %rem, 0
738  tail call void @llvm.assume(i1 %cmp2)
739  %cmp3 = icmp slt i32 %l, %numCols
740  tail call void @llvm.assume(i1 %cmp3)
741  br label %for.body.us
742
743for.body.us:                                      ; preds = %for.cond6.for.end_crit_edge.us, %for.body.us.preheader
744  %pInT1.addr.038.us = phi half* [ %scevgep40, %for.cond6.for.end_crit_edge.us ], [ %pInT1, %for.body.us.preheader ]
745  %i.037.us = phi i32 [ %inc13.us, %for.cond6.for.end_crit_edge.us ], [ 0, %for.body.us.preheader ]
746  %pOutT1.addr.036.us = phi half* [ %incdec.ptr.us, %for.cond6.for.end_crit_edge.us ], [ %pOutT1, %for.body.us.preheader ]
747  %pPRT_in.addr.035.us = phi half* [ %scevgep, %for.cond6.for.end_crit_edge.us ], [ %pPRT_in, %for.body.us.preheader ]
748  %scevgep = getelementptr half, half* %pPRT_in.addr.035.us, i32 %numCols
749  %0 = load half, half* %pOutT1.addr.036.us, align 4
750  %broadcast.splatinsert47 = insertelement <8 x half> undef, half %0, i32 0
751  %broadcast.splat48 = shufflevector <8 x half> %broadcast.splatinsert47, <8 x half> undef, <8 x i32> zeroinitializer
752  br label %vector.body
753
754vector.body:                                      ; preds = %vector.body, %for.body.us
755  %index = phi i32 [ 0, %for.body.us ], [ %index.next, %vector.body ]
756  %next.gep = getelementptr half, half* %pInT1.addr.038.us, i32 %index
757  %next.gep45 = getelementptr half, half* %pPRT_in.addr.035.us, i32 %index
758  %1 = bitcast half* %next.gep to <8 x half>*
759  %wide.load = load <8 x half>, <8 x half>* %1, align 4
760  %2 = bitcast half* %next.gep45 to <8 x half>*
761  %wide.load46 = load <8 x half>, <8 x half>* %2, align 4
762  %3 = fmul fast <8 x half> %wide.load46, %broadcast.splat48
763  %4 = fsub fast <8 x half> %wide.load, %3
764  store <8 x half> %4, <8 x half>* %1, align 4
765  %index.next = add i32 %index, 8
766  %5 = icmp eq i32 %index.next, %numCols
767  br i1 %5, label %for.cond6.for.end_crit_edge.us, label %vector.body
768
769for.cond6.for.end_crit_edge.us:                   ; preds = %vector.body
770  %incdec.ptr.us = getelementptr inbounds half, half* %pOutT1.addr.036.us, i32 1
771  %scevgep40 = getelementptr half, half* %pInT1.addr.038.us, i32 %numCols
772  %inc13.us = add nuw nsw i32 %i.037.us, 1
773  %exitcond41 = icmp eq i32 %inc13.us, %numRows
774  br i1 %exitcond41, label %for.end14, label %for.body.us
775
776for.end14:                                        ; preds = %for.cond6.for.end_crit_edge.us
777  ret void
778}
779
780%struct.arm_fir_instance_f32 = type { i16, half*, half* }
781define void @arm_fir_f32_1_4_mve(%struct.arm_fir_instance_f32* nocapture readonly %S, half* nocapture readonly %pSrc, half* %pDst, i32 %blockSize) {
782; CHECK-LABEL: arm_fir_f32_1_4_mve:
783; CHECK:       @ %bb.0: @ %entry
784; CHECK-NEXT:    .save {r4, r5, r6, r7, r8, r9, r10, r11, lr}
785; CHECK-NEXT:    push.w {r4, r5, r6, r7, r8, r9, r10, r11, lr}
786; CHECK-NEXT:    .pad #16
787; CHECK-NEXT:    sub sp, #16
788; CHECK-NEXT:    ldrh r5, [r0]
789; CHECK-NEXT:    ldr.w r9, [r0, #4]
790; CHECK-NEXT:    subs r6, r5, #1
791; CHECK-NEXT:    cmp r6, #3
792; CHECK-NEXT:    bhi .LBB15_6
793; CHECK-NEXT:  @ %bb.1: @ %if.then
794; CHECK-NEXT:    ldr r7, [r0, #8]
795; CHECK-NEXT:    add.w r4, r9, r6, lsl #1
796; CHECK-NEXT:    lsr.w lr, r3, #2
797; CHECK-NEXT:    ldrh.w r8, [r7, #6]
798; CHECK-NEXT:    ldrh.w r12, [r7, #4]
799; CHECK-NEXT:    ldrh r6, [r7, #2]
800; CHECK-NEXT:    ldrh r7, [r7]
801; CHECK-NEXT:    wls lr, lr, .LBB15_5
802; CHECK-NEXT:  @ %bb.2: @ %while.body.lr.ph
803; CHECK-NEXT:    str r5, [sp, #12] @ 4-byte Spill
804; CHECK-NEXT:    bic r5, r3, #3
805; CHECK-NEXT:    add.w r10, r9, #2
806; CHECK-NEXT:    str r5, [sp] @ 4-byte Spill
807; CHECK-NEXT:    add.w r5, r2, r5, lsl #1
808; CHECK-NEXT:    str r5, [sp, #4] @ 4-byte Spill
809; CHECK-NEXT:    str r1, [sp, #8] @ 4-byte Spill
810; CHECK-NEXT:  .LBB15_3: @ %while.body
811; CHECK-NEXT:    @ =>This Inner Loop Header: Depth=1
812; CHECK-NEXT:    vldrw.u32 q0, [r1], #8
813; CHECK-NEXT:    sub.w r11, r10, #2
814; CHECK-NEXT:    add.w r5, r10, #2
815; CHECK-NEXT:    vstrb.8 q0, [r4], #8
816; CHECK-NEXT:    vldrw.u32 q0, [r11]
817; CHECK-NEXT:    vldrw.u32 q1, [r10]
818; CHECK-NEXT:    vmul.f16 q0, q0, r7
819; CHECK-NEXT:    vfma.f16 q0, q1, r6
820; CHECK-NEXT:    vldrw.u32 q1, [r5]
821; CHECK-NEXT:    vfma.f16 q0, q1, r12
822; CHECK-NEXT:    vldrw.u32 q1, [r10, #4]
823; CHECK-NEXT:    add.w r10, r10, #8
824; CHECK-NEXT:    vfma.f16 q0, q1, r8
825; CHECK-NEXT:    vstrb.8 q0, [r2], #8
826; CHECK-NEXT:    le lr, .LBB15_3
827; CHECK-NEXT:  @ %bb.4: @ %while.end.loopexit
828; CHECK-NEXT:    ldr r2, [sp] @ 4-byte Reload
829; CHECK-NEXT:    ldr r1, [sp, #8] @ 4-byte Reload
830; CHECK-NEXT:    ldr r5, [sp, #12] @ 4-byte Reload
831; CHECK-NEXT:    add.w r9, r9, r2, lsl #1
832; CHECK-NEXT:    add.w r1, r1, r2, lsl #1
833; CHECK-NEXT:    ldr r2, [sp, #4] @ 4-byte Reload
834; CHECK-NEXT:  .LBB15_5: @ %while.end
835; CHECK-NEXT:    and lr, r3, #3
836; CHECK-NEXT:    vldrw.u32 q0, [r1]
837; CHECK-NEXT:    vctp.16 lr
838; CHECK-NEXT:    vpst
839; CHECK-NEXT:    vstrht.16 q0, [r4]
840; CHECK-NEXT:    vldrw.u32 q0, [r9]
841; CHECK-NEXT:    add.w r1, r9, #2
842; CHECK-NEXT:    vldrw.u32 q1, [r1]
843; CHECK-NEXT:    add.w r1, r9, #6
844; CHECK-NEXT:    vmul.f16 q0, q0, r7
845; CHECK-NEXT:    vfma.f16 q0, q1, r6
846; CHECK-NEXT:    vldrw.u32 q1, [r9, #4]
847; CHECK-NEXT:    vfma.f16 q0, q1, r12
848; CHECK-NEXT:    vldrw.u32 q1, [r1]
849; CHECK-NEXT:    vfma.f16 q0, q1, r8
850; CHECK-NEXT:    vpst
851; CHECK-NEXT:    vstrht.16 q0, [r2]
852; CHECK-NEXT:    ldr.w r9, [r0, #4]
853; CHECK-NEXT:  .LBB15_6: @ %if.end
854; CHECK-NEXT:    add.w r0, r9, r3, lsl #1
855; CHECK-NEXT:    lsr.w lr, r5, #2
856; CHECK-NEXT:    wls lr, lr, .LBB15_10
857; CHECK-NEXT:  @ %bb.7: @ %while.body51.preheader
858; CHECK-NEXT:    bic r2, r5, #3
859; CHECK-NEXT:    adds r1, r2, r3
860; CHECK-NEXT:    mov r3, r9
861; CHECK-NEXT:    add.w r1, r9, r1, lsl #1
862; CHECK-NEXT:  .LBB15_8: @ %while.body51
863; CHECK-NEXT:    @ =>This Inner Loop Header: Depth=1
864; CHECK-NEXT:    vldrw.u32 q0, [r0], #8
865; CHECK-NEXT:    vstrb.8 q0, [r3], #8
866; CHECK-NEXT:    le lr, .LBB15_8
867; CHECK-NEXT:  @ %bb.9: @ %while.end55.loopexit
868; CHECK-NEXT:    add.w r9, r9, r2, lsl #1
869; CHECK-NEXT:    mov r0, r1
870; CHECK-NEXT:  .LBB15_10: @ %while.end55
871; CHECK-NEXT:    ands r1, r5, #3
872; CHECK-NEXT:    beq .LBB15_12
873; CHECK-NEXT:  @ %bb.11: @ %if.then59
874; CHECK-NEXT:    vldrw.u32 q0, [r0]
875; CHECK-NEXT:    vctp.16 r1
876; CHECK-NEXT:    vpst
877; CHECK-NEXT:    vstrht.16 q0, [r9]
878; CHECK-NEXT:  .LBB15_12: @ %if.end61
879; CHECK-NEXT:    add sp, #16
880; CHECK-NEXT:    pop.w {r4, r5, r6, r7, r8, r9, r10, r11, pc}
881entry:
882  %pState1 = getelementptr inbounds %struct.arm_fir_instance_f32, %struct.arm_fir_instance_f32* %S, i32 0, i32 1
883  %0 = load half*, half** %pState1, align 4
884  %pCoeffs2 = getelementptr inbounds %struct.arm_fir_instance_f32, %struct.arm_fir_instance_f32* %S, i32 0, i32 2
885  %1 = load half*, half** %pCoeffs2, align 4
886  %numTaps3 = getelementptr inbounds %struct.arm_fir_instance_f32, %struct.arm_fir_instance_f32* %S, i32 0, i32 0
887  %2 = load i16, i16* %numTaps3, align 4
888  %conv = zext i16 %2 to i32
889  %sub = add nsw i32 %conv, -1
890  %cmp = icmp ult i32 %sub, 4
891  br i1 %cmp, label %if.then, label %if.end
892
893if.then:                                          ; preds = %entry
894  %arrayidx = getelementptr inbounds half, half* %0, i32 %sub
895  %incdec.ptr = getelementptr inbounds half, half* %1, i32 1
896  %3 = load half, half* %1, align 4
897  %incdec.ptr6 = getelementptr inbounds half, half* %1, i32 2
898  %4 = load half, half* %incdec.ptr, align 4
899  %incdec.ptr7 = getelementptr inbounds half, half* %1, i32 3
900  %5 = load half, half* %incdec.ptr6, align 4
901  %6 = load half, half* %incdec.ptr7, align 4
902  %shr = lshr i32 %blockSize, 2
903  %cmp9146 = icmp eq i32 %shr, 0
904  %.pre161 = insertelement <8 x half> undef, half %3, i32 0
905  %.pre162 = shufflevector <8 x half> %.pre161, <8 x half> undef, <8 x i32> zeroinitializer
906  %.pre163 = insertelement <8 x half> undef, half %4, i32 0
907  %.pre164 = shufflevector <8 x half> %.pre163, <8 x half> undef, <8 x i32> zeroinitializer
908  %.pre165 = insertelement <8 x half> undef, half %5, i32 0
909  %.pre166 = shufflevector <8 x half> %.pre165, <8 x half> undef, <8 x i32> zeroinitializer
910  %.pre167 = insertelement <8 x half> undef, half %6, i32 0
911  %.pre168 = shufflevector <8 x half> %.pre167, <8 x half> undef, <8 x i32> zeroinitializer
912  br i1 %cmp9146, label %while.end, label %while.body.lr.ph
913
914while.body.lr.ph:                                 ; preds = %if.then
915  %7 = and i32 %blockSize, -4
916  %scevgep158 = getelementptr half, half* %pDst, i32 %7
917  br label %while.body
918
919while.body:                                       ; preds = %while.body.lr.ph, %while.body
920  %pStateCur.0151 = phi half* [ %arrayidx, %while.body.lr.ph ], [ %add.ptr, %while.body ]
921  %pSamples.0150 = phi half* [ %0, %while.body.lr.ph ], [ %add.ptr24, %while.body ]
922  %pOutput.0149 = phi half* [ %pDst, %while.body.lr.ph ], [ %add.ptr23, %while.body ]
923  %pTempSrc.0148 = phi half* [ %pSrc, %while.body.lr.ph ], [ %add.ptr11, %while.body ]
924  %blkCnt.0147 = phi i32 [ %shr, %while.body.lr.ph ], [ %dec, %while.body ]
925  %8 = bitcast half* %pTempSrc.0148 to <8 x half>*
926  %9 = load <8 x half>, <8 x half>* %8, align 4
927  %10 = bitcast half* %pStateCur.0151 to <8 x half>*
928  store <8 x half> %9, <8 x half>* %10, align 4
929  %add.ptr = getelementptr inbounds half, half* %pStateCur.0151, i32 4
930  %add.ptr11 = getelementptr inbounds half, half* %pTempSrc.0148, i32 4
931  %11 = bitcast half* %pSamples.0150 to <8 x half>*
932  %12 = load <8 x half>, <8 x half>* %11, align 4
933  %13 = fmul fast <8 x half> %12, %.pre162
934  %arrayidx12 = getelementptr inbounds half, half* %pSamples.0150, i32 1
935  %14 = bitcast half* %arrayidx12 to <8 x half>*
936  %15 = load <8 x half>, <8 x half>* %14, align 4
937  %mul = fmul fast <8 x half> %15, %.pre164
938  %add = fadd fast <8 x half> %mul, %13
939  %arrayidx13 = getelementptr inbounds half, half* %pSamples.0150, i32 2
940  %16 = bitcast half* %arrayidx13 to <8 x half>*
941  %17 = load <8 x half>, <8 x half>* %16, align 4
942  %mul16 = fmul fast <8 x half> %17, %.pre166
943  %add17 = fadd fast <8 x half> %add, %mul16
944  %arrayidx18 = getelementptr inbounds half, half* %pSamples.0150, i32 3
945  %18 = bitcast half* %arrayidx18 to <8 x half>*
946  %19 = load <8 x half>, <8 x half>* %18, align 4
947  %mul21 = fmul fast <8 x half> %19, %.pre168
948  %add22 = fadd fast <8 x half> %add17, %mul21
949  %20 = bitcast half* %pOutput.0149 to <8 x half>*
950  store <8 x half> %add22, <8 x half>* %20, align 4
951  %add.ptr23 = getelementptr inbounds half, half* %pOutput.0149, i32 4
952  %add.ptr24 = getelementptr inbounds half, half* %pSamples.0150, i32 4
953  %dec = add nsw i32 %blkCnt.0147, -1
954  %cmp9 = icmp eq i32 %dec, 0
955  br i1 %cmp9, label %while.end.loopexit, label %while.body
956
957while.end.loopexit:                               ; preds = %while.body
958  %scevgep157 = getelementptr half, half* %pSrc, i32 %7
959  %scevgep159 = getelementptr half, half* %0, i32 %7
960  br label %while.end
961
962while.end:                                        ; preds = %if.then, %while.end.loopexit
963  %pTempSrc.0.lcssa = phi half* [ %scevgep157, %while.end.loopexit ], [ %pSrc, %if.then ]
964  %pOutput.0.lcssa = phi half* [ %scevgep158, %while.end.loopexit ], [ %pDst, %if.then ]
965  %pSamples.0.lcssa = phi half* [ %scevgep159, %while.end.loopexit ], [ %0, %if.then ]
966  %pStateCur.0.lcssa = phi half* [ %add.ptr, %while.end.loopexit ], [ %arrayidx, %if.then ]
967  %and = and i32 %blockSize, 3
968  %21 = tail call <8 x i1> @llvm.arm.mve.vctp16(i32 %and)
969  %22 = bitcast half* %pTempSrc.0.lcssa to <8 x half>*
970  %23 = load <8 x half>, <8 x half>* %22, align 4
971  %24 = bitcast half* %pStateCur.0.lcssa to <8 x half>*
972  tail call void @llvm.masked.store.v8f16.p0v8f16(<8 x half> %23, <8 x half>* %24, i32 4, <8 x i1> %21)
973  %25 = bitcast half* %pSamples.0.lcssa to <8 x half>*
974  %26 = load <8 x half>, <8 x half>* %25, align 4
975  %27 = fmul fast <8 x half> %26, %.pre162
976  %arrayidx29 = getelementptr inbounds half, half* %pSamples.0.lcssa, i32 1
977  %28 = bitcast half* %arrayidx29 to <8 x half>*
978  %29 = load <8 x half>, <8 x half>* %28, align 4
979  %mul32 = fmul fast <8 x half> %29, %.pre164
980  %add33 = fadd fast <8 x half> %mul32, %27
981  %arrayidx34 = getelementptr inbounds half, half* %pSamples.0.lcssa, i32 2
982  %30 = bitcast half* %arrayidx34 to <8 x half>*
983  %31 = load <8 x half>, <8 x half>* %30, align 4
984  %mul37 = fmul fast <8 x half> %31, %.pre166
985  %add38 = fadd fast <8 x half> %add33, %mul37
986  %arrayidx39 = getelementptr inbounds half, half* %pSamples.0.lcssa, i32 3
987  %32 = bitcast half* %arrayidx39 to <8 x half>*
988  %33 = load <8 x half>, <8 x half>* %32, align 4
989  %mul42 = fmul fast <8 x half> %33, %.pre168
990  %add43 = fadd fast <8 x half> %add38, %mul42
991  %34 = bitcast half* %pOutput.0.lcssa to <8 x half>*
992  tail call void @llvm.masked.store.v8f16.p0v8f16(<8 x half> %add43, <8 x half>* %34, i32 4, <8 x i1> %21)
993  %.pre = load half*, half** %pState1, align 4
994  br label %if.end
995
996if.end:                                           ; preds = %while.end, %entry
997  %35 = phi half* [ %.pre, %while.end ], [ %0, %entry ]
998  %arrayidx45 = getelementptr inbounds half, half* %35, i32 %blockSize
999  %shr47 = lshr i32 %conv, 2
1000  %cmp49141 = icmp eq i32 %shr47, 0
1001  br i1 %cmp49141, label %while.end55, label %while.body51.preheader
1002
1003while.body51.preheader:                           ; preds = %if.end
1004  %36 = and i32 %conv, 65532
1005  %37 = add i32 %36, %blockSize
1006  %scevgep = getelementptr half, half* %35, i32 %37
1007  br label %while.body51
1008
1009while.body51:                                     ; preds = %while.body51.preheader, %while.body51
1010  %pTempSrc.1144 = phi half* [ %add.ptr52, %while.body51 ], [ %arrayidx45, %while.body51.preheader ]
1011  %pTempDest.0143 = phi half* [ %add.ptr53, %while.body51 ], [ %35, %while.body51.preheader ]
1012  %blkCnt.1142 = phi i32 [ %dec54, %while.body51 ], [ %shr47, %while.body51.preheader ]
1013  %38 = bitcast half* %pTempSrc.1144 to <8 x half>*
1014  %39 = load <8 x half>, <8 x half>* %38, align 4
1015  %40 = bitcast half* %pTempDest.0143 to <8 x half>*
1016  store <8 x half> %39, <8 x half>* %40, align 4
1017  %add.ptr52 = getelementptr inbounds half, half* %pTempSrc.1144, i32 4
1018  %add.ptr53 = getelementptr inbounds half, half* %pTempDest.0143, i32 4
1019  %dec54 = add nsw i32 %blkCnt.1142, -1
1020  %cmp49 = icmp eq i32 %dec54, 0
1021  br i1 %cmp49, label %while.end55.loopexit, label %while.body51
1022
1023while.end55.loopexit:                             ; preds = %while.body51
1024  %scevgep156 = getelementptr half, half* %35, i32 %36
1025  br label %while.end55
1026
1027while.end55:                                      ; preds = %while.end55.loopexit, %if.end
1028  %pTempDest.0.lcssa = phi half* [ %35, %if.end ], [ %scevgep156, %while.end55.loopexit ]
1029  %pTempSrc.1.lcssa = phi half* [ %arrayidx45, %if.end ], [ %scevgep, %while.end55.loopexit ]
1030  %and56 = and i32 %conv, 3
1031  %cmp57 = icmp eq i32 %and56, 0
1032  br i1 %cmp57, label %if.end61, label %if.then59
1033
1034if.then59:                                        ; preds = %while.end55
1035  %41 = tail call <8 x i1> @llvm.arm.mve.vctp16(i32 %and56)
1036  %42 = bitcast half* %pTempSrc.1.lcssa to <8 x half>*
1037  %43 = load <8 x half>, <8 x half>* %42, align 4
1038  %44 = bitcast half* %pTempDest.0.lcssa to <8 x half>*
1039  tail call void @llvm.masked.store.v8f16.p0v8f16(<8 x half> %43, <8 x half>* %44, i32 4, <8 x i1> %41)
1040  br label %if.end61
1041
1042if.end61:                                         ; preds = %while.end55, %if.then59
1043  ret void
1044}
1045
1046
1047define void @fir(%struct.arm_fir_instance_f32* nocapture readonly %S, half* nocapture readonly %pSrc, half* nocapture %pDst, i32 %blockSize) {
1048; CHECK-LABEL: fir:
1049; CHECK:       @ %bb.0: @ %entry
1050; CHECK-NEXT:    .save {r4, r5, r6, r7, r8, r9, r10, r11, lr}
1051; CHECK-NEXT:    push.w {r4, r5, r6, r7, r8, r9, r10, r11, lr}
1052; CHECK-NEXT:    .pad #24
1053; CHECK-NEXT:    sub sp, #24
1054; CHECK-NEXT:    cmp r3, #8
1055; CHECK-NEXT:    blo.w .LBB16_12
1056; CHECK-NEXT:  @ %bb.1: @ %entry
1057; CHECK-NEXT:    lsrs.w r12, r3, #2
1058; CHECK-NEXT:    beq.w .LBB16_12
1059; CHECK-NEXT:  @ %bb.2: @ %while.body.lr.ph
1060; CHECK-NEXT:    ldrh r4, [r0]
1061; CHECK-NEXT:    movs r6, #1
1062; CHECK-NEXT:    ldrd r5, r3, [r0, #4]
1063; CHECK-NEXT:    sub.w r0, r4, #8
1064; CHECK-NEXT:    and r8, r0, #7
1065; CHECK-NEXT:    add.w r7, r0, r0, lsr #29
1066; CHECK-NEXT:    asr.w lr, r7, #3
1067; CHECK-NEXT:    cmp.w lr, #1
1068; CHECK-NEXT:    it gt
1069; CHECK-NEXT:    asrgt r6, r7, #3
1070; CHECK-NEXT:    add.w r7, r5, r4, lsl #1
1071; CHECK-NEXT:    subs r7, #2
1072; CHECK-NEXT:    str r7, [sp, #20] @ 4-byte Spill
1073; CHECK-NEXT:    rsbs r7, r4, #0
1074; CHECK-NEXT:    str r7, [sp, #8] @ 4-byte Spill
1075; CHECK-NEXT:    add.w r7, r3, #16
1076; CHECK-NEXT:    str r6, [sp] @ 4-byte Spill
1077; CHECK-NEXT:    str r4, [sp, #12] @ 4-byte Spill
1078; CHECK-NEXT:    str r7, [sp, #4] @ 4-byte Spill
1079; CHECK-NEXT:    b .LBB16_4
1080; CHECK-NEXT:  .LBB16_3: @ %while.end
1081; CHECK-NEXT:    @ in Loop: Header=BB16_4 Depth=1
1082; CHECK-NEXT:    ldr r0, [sp, #8] @ 4-byte Reload
1083; CHECK-NEXT:    subs.w r12, r12, #1
1084; CHECK-NEXT:    ldr r1, [sp, #16] @ 4-byte Reload
1085; CHECK-NEXT:    vstrb.8 q0, [r2], #8
1086; CHECK-NEXT:    add.w r0, r5, r0, lsl #1
1087; CHECK-NEXT:    add.w r5, r0, #8
1088; CHECK-NEXT:    beq.w .LBB16_12
1089; CHECK-NEXT:  .LBB16_4: @ %while.body
1090; CHECK-NEXT:    @ =>This Loop Header: Depth=1
1091; CHECK-NEXT:    @ Child Loop BB16_6 Depth 2
1092; CHECK-NEXT:    @ Child Loop BB16_10 Depth 2
1093; CHECK-NEXT:    vldrw.u32 q0, [r1], #8
1094; CHECK-NEXT:    ldrh.w lr, [r3, #14]
1095; CHECK-NEXT:    ldrh r0, [r3, #12]
1096; CHECK-NEXT:    str r1, [sp, #16] @ 4-byte Spill
1097; CHECK-NEXT:    ldr r1, [sp, #20] @ 4-byte Reload
1098; CHECK-NEXT:    ldrh r4, [r3, #10]
1099; CHECK-NEXT:    ldrh r7, [r3, #8]
1100; CHECK-NEXT:    ldrh r6, [r3, #6]
1101; CHECK-NEXT:    ldrh.w r9, [r3, #4]
1102; CHECK-NEXT:    ldrh.w r11, [r3, #2]
1103; CHECK-NEXT:    ldrh.w r10, [r3]
1104; CHECK-NEXT:    vstrb.8 q0, [r1], #8
1105; CHECK-NEXT:    vldrw.u32 q0, [r5]
1106; CHECK-NEXT:    str r1, [sp, #20] @ 4-byte Spill
1107; CHECK-NEXT:    adds r1, r5, #2
1108; CHECK-NEXT:    vldrw.u32 q1, [r1]
1109; CHECK-NEXT:    vmul.f16 q0, q0, r10
1110; CHECK-NEXT:    adds r1, r5, #6
1111; CHECK-NEXT:    vfma.f16 q0, q1, r11
1112; CHECK-NEXT:    vldrw.u32 q1, [r5, #4]
1113; CHECK-NEXT:    vfma.f16 q0, q1, r9
1114; CHECK-NEXT:    vldrw.u32 q1, [r1]
1115; CHECK-NEXT:    add.w r1, r5, #10
1116; CHECK-NEXT:    vfma.f16 q0, q1, r6
1117; CHECK-NEXT:    vldrw.u32 q1, [r5, #8]
1118; CHECK-NEXT:    vfma.f16 q0, q1, r7
1119; CHECK-NEXT:    vldrw.u32 q1, [r1]
1120; CHECK-NEXT:    vfma.f16 q0, q1, r4
1121; CHECK-NEXT:    vldrw.u32 q1, [r5, #12]
1122; CHECK-NEXT:    vfma.f16 q0, q1, r0
1123; CHECK-NEXT:    add.w r0, r5, #14
1124; CHECK-NEXT:    vldrw.u32 q1, [r0]
1125; CHECK-NEXT:    ldr r0, [sp, #12] @ 4-byte Reload
1126; CHECK-NEXT:    adds r5, #16
1127; CHECK-NEXT:    vfma.f16 q0, q1, lr
1128; CHECK-NEXT:    cmp r0, #16
1129; CHECK-NEXT:    blo .LBB16_7
1130; CHECK-NEXT:  @ %bb.5: @ %for.body.preheader
1131; CHECK-NEXT:    @ in Loop: Header=BB16_4 Depth=1
1132; CHECK-NEXT:    ldr r0, [sp] @ 4-byte Reload
1133; CHECK-NEXT:    dls lr, r0
1134; CHECK-NEXT:    ldr r6, [sp, #4] @ 4-byte Reload
1135; CHECK-NEXT:  .LBB16_6: @ %for.body
1136; CHECK-NEXT:    @ Parent Loop BB16_4 Depth=1
1137; CHECK-NEXT:    @ => This Inner Loop Header: Depth=2
1138; CHECK-NEXT:    ldrh r0, [r6], #16
1139; CHECK-NEXT:    vldrw.u32 q1, [r5]
1140; CHECK-NEXT:    adds r1, r5, #2
1141; CHECK-NEXT:    vfma.f16 q0, q1, r0
1142; CHECK-NEXT:    vldrw.u32 q1, [r1]
1143; CHECK-NEXT:    ldrh r0, [r6, #-14]
1144; CHECK-NEXT:    adds r1, r5, #6
1145; CHECK-NEXT:    vfma.f16 q0, q1, r0
1146; CHECK-NEXT:    ldrh r0, [r6, #-12]
1147; CHECK-NEXT:    vldrw.u32 q1, [r5, #4]
1148; CHECK-NEXT:    vfma.f16 q0, q1, r0
1149; CHECK-NEXT:    vldrw.u32 q1, [r1]
1150; CHECK-NEXT:    ldrh r0, [r6, #-10]
1151; CHECK-NEXT:    add.w r1, r5, #10
1152; CHECK-NEXT:    vfma.f16 q0, q1, r0
1153; CHECK-NEXT:    ldrh r0, [r6, #-8]
1154; CHECK-NEXT:    vldrw.u32 q1, [r5, #8]
1155; CHECK-NEXT:    vfma.f16 q0, q1, r0
1156; CHECK-NEXT:    vldrw.u32 q1, [r1]
1157; CHECK-NEXT:    ldrh r0, [r6, #-6]
1158; CHECK-NEXT:    ldrh r1, [r6, #-2]
1159; CHECK-NEXT:    vfma.f16 q0, q1, r0
1160; CHECK-NEXT:    ldrh r0, [r6, #-4]
1161; CHECK-NEXT:    vldrw.u32 q1, [r5, #12]
1162; CHECK-NEXT:    vfma.f16 q0, q1, r0
1163; CHECK-NEXT:    add.w r0, r5, #14
1164; CHECK-NEXT:    vldrw.u32 q1, [r0]
1165; CHECK-NEXT:    adds r5, #16
1166; CHECK-NEXT:    vfma.f16 q0, q1, r1
1167; CHECK-NEXT:    le lr, .LBB16_6
1168; CHECK-NEXT:    b .LBB16_8
1169; CHECK-NEXT:  .LBB16_7: @ in Loop: Header=BB16_4 Depth=1
1170; CHECK-NEXT:    ldr r6, [sp, #4] @ 4-byte Reload
1171; CHECK-NEXT:  .LBB16_8: @ %for.end
1172; CHECK-NEXT:    @ in Loop: Header=BB16_4 Depth=1
1173; CHECK-NEXT:    cmp.w r8, #0
1174; CHECK-NEXT:    beq.w .LBB16_3
1175; CHECK-NEXT:    b .LBB16_9
1176; CHECK-NEXT:  .LBB16_9: @ %while.body76.preheader
1177; CHECK-NEXT:    @ in Loop: Header=BB16_4 Depth=1
1178; CHECK-NEXT:    mov r0, r5
1179; CHECK-NEXT:    mov lr, r8
1180; CHECK-NEXT:  .LBB16_10: @ %while.body76
1181; CHECK-NEXT:    @ Parent Loop BB16_4 Depth=1
1182; CHECK-NEXT:    @ => This Inner Loop Header: Depth=2
1183; CHECK-NEXT:    ldrh r1, [r6], #2
1184; CHECK-NEXT:    vldrh.u16 q1, [r0], #2
1185; CHECK-NEXT:    subs.w lr, lr, #1
1186; CHECK-NEXT:    vfma.f16 q0, q1, r1
1187; CHECK-NEXT:    bne .LBB16_10
1188; CHECK-NEXT:    b .LBB16_11
1189; CHECK-NEXT:  .LBB16_11: @ %while.end.loopexit
1190; CHECK-NEXT:    @ in Loop: Header=BB16_4 Depth=1
1191; CHECK-NEXT:    add.w r5, r5, r8, lsl #1
1192; CHECK-NEXT:    b .LBB16_3
1193; CHECK-NEXT:  .LBB16_12: @ %if.end
1194; CHECK-NEXT:    add sp, #24
1195; CHECK-NEXT:    pop.w {r4, r5, r6, r7, r8, r9, r10, r11, pc}
1196entry:
1197  %pState1 = getelementptr inbounds %struct.arm_fir_instance_f32, %struct.arm_fir_instance_f32* %S, i32 0, i32 1
1198  %0 = load half*, half** %pState1, align 4
1199  %pCoeffs2 = getelementptr inbounds %struct.arm_fir_instance_f32, %struct.arm_fir_instance_f32* %S, i32 0, i32 2
1200  %1 = load half*, half** %pCoeffs2, align 4
1201  %numTaps3 = getelementptr inbounds %struct.arm_fir_instance_f32, %struct.arm_fir_instance_f32* %S, i32 0, i32 0
1202  %2 = load i16, i16* %numTaps3, align 4
1203  %conv = zext i16 %2 to i32
1204  %cmp = icmp ugt i32 %blockSize, 7
1205  br i1 %cmp, label %if.then, label %if.end
1206
1207if.then:                                          ; preds = %entry
1208  %shr = lshr i32 %blockSize, 2
1209  %cmp5217 = icmp eq i32 %shr, 0
1210  br i1 %cmp5217, label %if.end, label %while.body.lr.ph
1211
1212while.body.lr.ph:                                 ; preds = %if.then
1213  %sub = add nsw i32 %conv, -1
1214  %arrayidx = getelementptr inbounds half, half* %0, i32 %sub
1215  %incdec.ptr = getelementptr inbounds half, half* %1, i32 1
1216  %incdec.ptr7 = getelementptr inbounds half, half* %1, i32 2
1217  %incdec.ptr8 = getelementptr inbounds half, half* %1, i32 3
1218  %incdec.ptr9 = getelementptr inbounds half, half* %1, i32 4
1219  %incdec.ptr10 = getelementptr inbounds half, half* %1, i32 5
1220  %incdec.ptr11 = getelementptr inbounds half, half* %1, i32 6
1221  %incdec.ptr12 = getelementptr inbounds half, half* %1, i32 7
1222  %sub37 = add nsw i32 %conv, -8
1223  %div = sdiv i32 %sub37, 8
1224  %pCoeffsCur.0199 = getelementptr inbounds half, half* %1, i32 8
1225  %cmp38201 = icmp ugt i16 %2, 15
1226  %and = and i32 %sub37, 7
1227  %cmp74210 = icmp eq i32 %and, 0
1228  %idx.neg = sub nsw i32 0, %conv
1229  %3 = icmp sgt i32 %div, 1
1230  %smax = select i1 %3, i32 %div, i32 1
1231  br label %while.body
1232
1233while.body:                                       ; preds = %while.body.lr.ph, %while.end
1234  %blkCnt.0222 = phi i32 [ %shr, %while.body.lr.ph ], [ %dec84, %while.end ]
1235  %pStateCur.0221 = phi half* [ %arrayidx, %while.body.lr.ph ], [ %add.ptr, %while.end ]
1236  %pSamples.0220 = phi half* [ %0, %while.body.lr.ph ], [ %add.ptr83, %while.end ]
1237  %pTempSrc.0219 = phi half* [ %pSrc, %while.body.lr.ph ], [ %add.ptr14, %while.end ]
1238  %pOutput.0218 = phi half* [ %pDst, %while.body.lr.ph ], [ %add.ptr81, %while.end ]
1239  %4 = load half, half* %1, align 4
1240  %5 = load half, half* %incdec.ptr, align 4
1241  %6 = load half, half* %incdec.ptr7, align 4
1242  %7 = load half, half* %incdec.ptr8, align 4
1243  %8 = load half, half* %incdec.ptr9, align 4
1244  %9 = load half, half* %incdec.ptr10, align 4
1245  %10 = load half, half* %incdec.ptr11, align 4
1246  %11 = load half, half* %incdec.ptr12, align 4
1247  %12 = bitcast half* %pTempSrc.0219 to <8 x half>*
1248  %13 = load <8 x half>, <8 x half>* %12, align 4
1249  %14 = bitcast half* %pStateCur.0221 to <8 x half>*
1250  store <8 x half> %13, <8 x half>* %14, align 4
1251  %add.ptr = getelementptr inbounds half, half* %pStateCur.0221, i32 4
1252  %add.ptr14 = getelementptr inbounds half, half* %pTempSrc.0219, i32 4
1253  %15 = bitcast half* %pSamples.0220 to <8 x half>*
1254  %16 = load <8 x half>, <8 x half>* %15, align 4
1255  %.splatinsert = insertelement <8 x half> undef, half %4, i32 0
1256  %.splat = shufflevector <8 x half> %.splatinsert, <8 x half> undef, <8 x i32> zeroinitializer
1257  %17 = fmul fast <8 x half> %16, %.splat
1258  %arrayidx15 = getelementptr inbounds half, half* %pSamples.0220, i32 1
1259  %18 = bitcast half* %arrayidx15 to <8 x half>*
1260  %19 = load <8 x half>, <8 x half>* %18, align 4
1261  %.splatinsert16 = insertelement <8 x half> undef, half %5, i32 0
1262  %.splat17 = shufflevector <8 x half> %.splatinsert16, <8 x half> undef, <8 x i32> zeroinitializer
1263  %20 = tail call fast <8 x half> @llvm.fma.v8f16(<8 x half> %19, <8 x half> %.splat17, <8 x half> %17)
1264  %arrayidx18 = getelementptr inbounds half, half* %pSamples.0220, i32 2
1265  %21 = bitcast half* %arrayidx18 to <8 x half>*
1266  %22 = load <8 x half>, <8 x half>* %21, align 4
1267  %.splatinsert19 = insertelement <8 x half> undef, half %6, i32 0
1268  %.splat20 = shufflevector <8 x half> %.splatinsert19, <8 x half> undef, <8 x i32> zeroinitializer
1269  %23 = tail call fast <8 x half> @llvm.fma.v8f16(<8 x half> %22, <8 x half> %.splat20, <8 x half> %20)
1270  %arrayidx21 = getelementptr inbounds half, half* %pSamples.0220, i32 3
1271  %24 = bitcast half* %arrayidx21 to <8 x half>*
1272  %25 = load <8 x half>, <8 x half>* %24, align 4
1273  %.splatinsert22 = insertelement <8 x half> undef, half %7, i32 0
1274  %.splat23 = shufflevector <8 x half> %.splatinsert22, <8 x half> undef, <8 x i32> zeroinitializer
1275  %26 = tail call fast <8 x half> @llvm.fma.v8f16(<8 x half> %25, <8 x half> %.splat23, <8 x half> %23)
1276  %arrayidx24 = getelementptr inbounds half, half* %pSamples.0220, i32 4
1277  %27 = bitcast half* %arrayidx24 to <8 x half>*
1278  %28 = load <8 x half>, <8 x half>* %27, align 4
1279  %.splatinsert25 = insertelement <8 x half> undef, half %8, i32 0
1280  %.splat26 = shufflevector <8 x half> %.splatinsert25, <8 x half> undef, <8 x i32> zeroinitializer
1281  %29 = tail call fast <8 x half> @llvm.fma.v8f16(<8 x half> %28, <8 x half> %.splat26, <8 x half> %26)
1282  %arrayidx27 = getelementptr inbounds half, half* %pSamples.0220, i32 5
1283  %30 = bitcast half* %arrayidx27 to <8 x half>*
1284  %31 = load <8 x half>, <8 x half>* %30, align 4
1285  %.splatinsert28 = insertelement <8 x half> undef, half %9, i32 0
1286  %.splat29 = shufflevector <8 x half> %.splatinsert28, <8 x half> undef, <8 x i32> zeroinitializer
1287  %32 = tail call fast <8 x half> @llvm.fma.v8f16(<8 x half> %31, <8 x half> %.splat29, <8 x half> %29)
1288  %arrayidx30 = getelementptr inbounds half, half* %pSamples.0220, i32 6
1289  %33 = bitcast half* %arrayidx30 to <8 x half>*
1290  %34 = load <8 x half>, <8 x half>* %33, align 4
1291  %.splatinsert31 = insertelement <8 x half> undef, half %10, i32 0
1292  %.splat32 = shufflevector <8 x half> %.splatinsert31, <8 x half> undef, <8 x i32> zeroinitializer
1293  %35 = tail call fast <8 x half> @llvm.fma.v8f16(<8 x half> %34, <8 x half> %.splat32, <8 x half> %32)
1294  %arrayidx33 = getelementptr inbounds half, half* %pSamples.0220, i32 7
1295  %36 = bitcast half* %arrayidx33 to <8 x half>*
1296  %37 = load <8 x half>, <8 x half>* %36, align 4
1297  %.splatinsert34 = insertelement <8 x half> undef, half %11, i32 0
1298  %.splat35 = shufflevector <8 x half> %.splatinsert34, <8 x half> undef, <8 x i32> zeroinitializer
1299  %38 = tail call fast <8 x half> @llvm.fma.v8f16(<8 x half> %37, <8 x half> %.splat35, <8 x half> %35)
1300  %pSamples.1200 = getelementptr inbounds half, half* %pSamples.0220, i32 8
1301  br i1 %cmp38201, label %for.body, label %for.end
1302
1303for.body:                                         ; preds = %while.body, %for.body
1304  %pSamples.1207 = phi half* [ %pSamples.1, %for.body ], [ %pSamples.1200, %while.body ]
1305  %pCoeffsCur.0206 = phi half* [ %pCoeffsCur.0, %for.body ], [ %pCoeffsCur.0199, %while.body ]
1306  %.pn205 = phi half* [ %pCoeffsCur.0206, %for.body ], [ %1, %while.body ]
1307  %i.0204 = phi i32 [ %inc, %for.body ], [ 0, %while.body ]
1308  %vecAcc0.0203 = phi <8 x half> [ %70, %for.body ], [ %38, %while.body ]
1309  %pSamples.0.pn202 = phi half* [ %pSamples.1207, %for.body ], [ %pSamples.0220, %while.body ]
1310  %incdec.ptr40 = getelementptr inbounds half, half* %.pn205, i32 9
1311  %39 = load half, half* %pCoeffsCur.0206, align 4
1312  %incdec.ptr41 = getelementptr inbounds half, half* %.pn205, i32 10
1313  %40 = load half, half* %incdec.ptr40, align 4
1314  %incdec.ptr42 = getelementptr inbounds half, half* %.pn205, i32 11
1315  %41 = load half, half* %incdec.ptr41, align 4
1316  %incdec.ptr43 = getelementptr inbounds half, half* %.pn205, i32 12
1317  %42 = load half, half* %incdec.ptr42, align 4
1318  %incdec.ptr44 = getelementptr inbounds half, half* %.pn205, i32 13
1319  %43 = load half, half* %incdec.ptr43, align 4
1320  %incdec.ptr45 = getelementptr inbounds half, half* %.pn205, i32 14
1321  %44 = load half, half* %incdec.ptr44, align 4
1322  %incdec.ptr46 = getelementptr inbounds half, half* %.pn205, i32 15
1323  %45 = load half, half* %incdec.ptr45, align 4
1324  %46 = load half, half* %incdec.ptr46, align 4
1325  %47 = bitcast half* %pSamples.1207 to <8 x half>*
1326  %48 = load <8 x half>, <8 x half>* %47, align 4
1327  %.splatinsert48 = insertelement <8 x half> undef, half %39, i32 0
1328  %.splat49 = shufflevector <8 x half> %.splatinsert48, <8 x half> undef, <8 x i32> zeroinitializer
1329  %49 = tail call fast <8 x half> @llvm.fma.v8f16(<8 x half> %48, <8 x half> %.splat49, <8 x half> %vecAcc0.0203)
1330  %arrayidx50 = getelementptr inbounds half, half* %pSamples.0.pn202, i32 9
1331  %50 = bitcast half* %arrayidx50 to <8 x half>*
1332  %51 = load <8 x half>, <8 x half>* %50, align 4
1333  %.splatinsert51 = insertelement <8 x half> undef, half %40, i32 0
1334  %.splat52 = shufflevector <8 x half> %.splatinsert51, <8 x half> undef, <8 x i32> zeroinitializer
1335  %52 = tail call fast <8 x half> @llvm.fma.v8f16(<8 x half> %51, <8 x half> %.splat52, <8 x half> %49)
1336  %arrayidx53 = getelementptr inbounds half, half* %pSamples.0.pn202, i32 10
1337  %53 = bitcast half* %arrayidx53 to <8 x half>*
1338  %54 = load <8 x half>, <8 x half>* %53, align 4
1339  %.splatinsert54 = insertelement <8 x half> undef, half %41, i32 0
1340  %.splat55 = shufflevector <8 x half> %.splatinsert54, <8 x half> undef, <8 x i32> zeroinitializer
1341  %55 = tail call fast <8 x half> @llvm.fma.v8f16(<8 x half> %54, <8 x half> %.splat55, <8 x half> %52)
1342  %arrayidx56 = getelementptr inbounds half, half* %pSamples.0.pn202, i32 11
1343  %56 = bitcast half* %arrayidx56 to <8 x half>*
1344  %57 = load <8 x half>, <8 x half>* %56, align 4
1345  %.splatinsert57 = insertelement <8 x half> undef, half %42, i32 0
1346  %.splat58 = shufflevector <8 x half> %.splatinsert57, <8 x half> undef, <8 x i32> zeroinitializer
1347  %58 = tail call fast <8 x half> @llvm.fma.v8f16(<8 x half> %57, <8 x half> %.splat58, <8 x half> %55)
1348  %arrayidx59 = getelementptr inbounds half, half* %pSamples.0.pn202, i32 12
1349  %59 = bitcast half* %arrayidx59 to <8 x half>*
1350  %60 = load <8 x half>, <8 x half>* %59, align 4
1351  %.splatinsert60 = insertelement <8 x half> undef, half %43, i32 0
1352  %.splat61 = shufflevector <8 x half> %.splatinsert60, <8 x half> undef, <8 x i32> zeroinitializer
1353  %61 = tail call fast <8 x half> @llvm.fma.v8f16(<8 x half> %60, <8 x half> %.splat61, <8 x half> %58)
1354  %arrayidx62 = getelementptr inbounds half, half* %pSamples.0.pn202, i32 13
1355  %62 = bitcast half* %arrayidx62 to <8 x half>*
1356  %63 = load <8 x half>, <8 x half>* %62, align 4
1357  %.splatinsert63 = insertelement <8 x half> undef, half %44, i32 0
1358  %.splat64 = shufflevector <8 x half> %.splatinsert63, <8 x half> undef, <8 x i32> zeroinitializer
1359  %64 = tail call fast <8 x half> @llvm.fma.v8f16(<8 x half> %63, <8 x half> %.splat64, <8 x half> %61)
1360  %arrayidx65 = getelementptr inbounds half, half* %pSamples.0.pn202, i32 14
1361  %65 = bitcast half* %arrayidx65 to <8 x half>*
1362  %66 = load <8 x half>, <8 x half>* %65, align 4
1363  %.splatinsert66 = insertelement <8 x half> undef, half %45, i32 0
1364  %.splat67 = shufflevector <8 x half> %.splatinsert66, <8 x half> undef, <8 x i32> zeroinitializer
1365  %67 = tail call fast <8 x half> @llvm.fma.v8f16(<8 x half> %66, <8 x half> %.splat67, <8 x half> %64)
1366  %arrayidx68 = getelementptr inbounds half, half* %pSamples.0.pn202, i32 15
1367  %68 = bitcast half* %arrayidx68 to <8 x half>*
1368  %69 = load <8 x half>, <8 x half>* %68, align 4
1369  %.splatinsert69 = insertelement <8 x half> undef, half %46, i32 0
1370  %.splat70 = shufflevector <8 x half> %.splatinsert69, <8 x half> undef, <8 x i32> zeroinitializer
1371  %70 = tail call fast <8 x half> @llvm.fma.v8f16(<8 x half> %69, <8 x half> %.splat70, <8 x half> %67)
1372  %inc = add nuw nsw i32 %i.0204, 1
1373  %pCoeffsCur.0 = getelementptr inbounds half, half* %pCoeffsCur.0206, i32 8
1374  %pSamples.1 = getelementptr inbounds half, half* %pSamples.1207, i32 8
1375  %exitcond = icmp eq i32 %inc, %smax
1376  br i1 %exitcond, label %for.end, label %for.body
1377
1378for.end:                                          ; preds = %for.body, %while.body
1379  %vecAcc0.0.lcssa = phi <8 x half> [ %38, %while.body ], [ %70, %for.body ]
1380  %pCoeffsCur.0.lcssa = phi half* [ %pCoeffsCur.0199, %while.body ], [ %pCoeffsCur.0, %for.body ]
1381  %pSamples.1.lcssa = phi half* [ %pSamples.1200, %while.body ], [ %pSamples.1, %for.body ]
1382  br i1 %cmp74210, label %while.end, label %while.body76
1383
1384while.body76:                                     ; preds = %for.end, %while.body76
1385  %pCoeffsCur.1214 = phi half* [ %incdec.ptr77, %while.body76 ], [ %pCoeffsCur.0.lcssa, %for.end ]
1386  %vecAcc0.1213 = phi <8 x half> [ %74, %while.body76 ], [ %vecAcc0.0.lcssa, %for.end ]
1387  %numCnt.0212 = phi i32 [ %dec, %while.body76 ], [ %and, %for.end ]
1388  %pSamples.2211 = phi half* [ %incdec.ptr80, %while.body76 ], [ %pSamples.1.lcssa, %for.end ]
1389  %incdec.ptr77 = getelementptr inbounds half, half* %pCoeffsCur.1214, i32 1
1390  %71 = load half, half* %pCoeffsCur.1214, align 4
1391  %72 = bitcast half* %pSamples.2211 to <8 x half>*
1392  %73 = load <8 x half>, <8 x half>* %72, align 4
1393  %.splatinsert78 = insertelement <8 x half> undef, half %71, i32 0
1394  %.splat79 = shufflevector <8 x half> %.splatinsert78, <8 x half> undef, <8 x i32> zeroinitializer
1395  %74 = tail call fast <8 x half> @llvm.fma.v8f16(<8 x half> %73, <8 x half> %.splat79, <8 x half> %vecAcc0.1213)
1396  %incdec.ptr80 = getelementptr inbounds half, half* %pSamples.2211, i32 1
1397  %dec = add nsw i32 %numCnt.0212, -1
1398  %cmp74 = icmp sgt i32 %numCnt.0212, 1
1399  br i1 %cmp74, label %while.body76, label %while.end.loopexit
1400
1401while.end.loopexit:                               ; preds = %while.body76
1402  %scevgep = getelementptr half, half* %pSamples.1.lcssa, i32 %and
1403  br label %while.end
1404
1405while.end:                                        ; preds = %while.end.loopexit, %for.end
1406  %pSamples.2.lcssa = phi half* [ %pSamples.1.lcssa, %for.end ], [ %scevgep, %while.end.loopexit ]
1407  %vecAcc0.1.lcssa = phi <8 x half> [ %vecAcc0.0.lcssa, %for.end ], [ %74, %while.end.loopexit ]
1408  %75 = bitcast half* %pOutput.0218 to <8 x half>*
1409  store <8 x half> %vecAcc0.1.lcssa, <8 x half>* %75, align 4
1410  %add.ptr81 = getelementptr inbounds half, half* %pOutput.0218, i32 4
1411  %add.ptr82 = getelementptr inbounds half, half* %pSamples.2.lcssa, i32 4
1412  %add.ptr83 = getelementptr inbounds half, half* %add.ptr82, i32 %idx.neg
1413  %dec84 = add nsw i32 %blkCnt.0222, -1
1414  %cmp5 = icmp eq i32 %dec84, 0
1415  br i1 %cmp5, label %if.end, label %while.body
1416
1417if.end:                                           ; preds = %while.end, %if.then, %entry
1418  ret void
1419}
1420
1421%struct.arm_biquad_cascade_df2T_instance_f16 = type { i8, half*, half* }
1422define void @arm_biquad_cascade_df2T_f16(%struct.arm_biquad_cascade_df2T_instance_f16* nocapture readonly %S, half* nocapture readonly %pSrc, half* nocapture %pDst, i32 %blockSize) {
1423; CHECK-LABEL: arm_biquad_cascade_df2T_f16:
1424; CHECK:       @ %bb.0: @ %entry
1425; CHECK-NEXT:    .save {r4, r5, r6, r7, r8, r9, lr}
1426; CHECK-NEXT:    push.w {r4, r5, r6, r7, r8, r9, lr}
1427; CHECK-NEXT:    .pad #4
1428; CHECK-NEXT:    sub sp, #4
1429; CHECK-NEXT:    .vsave {d8, d9, d10, d11, d12, d13}
1430; CHECK-NEXT:    vpush {d8, d9, d10, d11, d12, d13}
1431; CHECK-NEXT:    ldrd r12, r6, [r0, #4]
1432; CHECK-NEXT:    and r8, r3, #1
1433; CHECK-NEXT:    ldrb r0, [r0]
1434; CHECK-NEXT:    vldr.16 s4, .LCPI17_0
1435; CHECK-NEXT:    lsr.w r9, r3, #1
1436; CHECK-NEXT:    vmov.i32 q0, #0x0
1437; CHECK-NEXT:    b .LBB17_3
1438; CHECK-NEXT:  .LBB17_1: @ %if.else
1439; CHECK-NEXT:    @ in Loop: Header=BB17_3 Depth=1
1440; CHECK-NEXT:    vstr.16 s8, [r12]
1441; CHECK-NEXT:    vmovx.f16 s9, s8
1442; CHECK-NEXT:  .LBB17_2: @ %if.end
1443; CHECK-NEXT:    @ in Loop: Header=BB17_3 Depth=1
1444; CHECK-NEXT:    vstr.16 s9, [r12, #2]
1445; CHECK-NEXT:    adds r6, #10
1446; CHECK-NEXT:    subs r0, #1
1447; CHECK-NEXT:    add.w r12, r12, #4
1448; CHECK-NEXT:    mov r1, r2
1449; CHECK-NEXT:    beq .LBB17_8
1450; CHECK-NEXT:  .LBB17_3: @ %do.body
1451; CHECK-NEXT:    @ =>This Loop Header: Depth=1
1452; CHECK-NEXT:    @ Child Loop BB17_5 Depth 2
1453; CHECK-NEXT:    vldrh.u16 q4, [r6]
1454; CHECK-NEXT:    vldrh.u16 q3, [r6, #4]
1455; CHECK-NEXT:    movs r5, #0
1456; CHECK-NEXT:    vmov q5, q4
1457; CHECK-NEXT:    vmov q6, q3
1458; CHECK-NEXT:    vshlc q5, r5, #16
1459; CHECK-NEXT:    vshlc q6, r5, #16
1460; CHECK-NEXT:    vldrh.u16 q2, [r12]
1461; CHECK-NEXT:    vmov.f32 s9, s1
1462; CHECK-NEXT:    mov r5, r2
1463; CHECK-NEXT:    wls lr, r9, .LBB17_6
1464; CHECK-NEXT:  @ %bb.4: @ %while.body.preheader
1465; CHECK-NEXT:    @ in Loop: Header=BB17_3 Depth=1
1466; CHECK-NEXT:    mov r5, r2
1467; CHECK-NEXT:    mov lr, r9
1468; CHECK-NEXT:  .LBB17_5: @ %while.body
1469; CHECK-NEXT:    @ Parent Loop BB17_3 Depth=1
1470; CHECK-NEXT:    @ => This Inner Loop Header: Depth=2
1471; CHECK-NEXT:    ldrh r7, [r1], #4
1472; CHECK-NEXT:    vmov r4, s4
1473; CHECK-NEXT:    vfma.f16 q2, q4, r7
1474; CHECK-NEXT:    ldrh r3, [r1, #-2]
1475; CHECK-NEXT:    vmov.u16 r7, q2[0]
1476; CHECK-NEXT:    vfma.f16 q2, q3, r7
1477; CHECK-NEXT:    vmov.16 q2[3], r4
1478; CHECK-NEXT:    vfma.f16 q2, q5, r3
1479; CHECK-NEXT:    vmov.u16 r3, q2[1]
1480; CHECK-NEXT:    vfma.f16 q2, q6, r3
1481; CHECK-NEXT:    strh r3, [r5, #2]
1482; CHECK-NEXT:    vmovx.f16 s6, s9
1483; CHECK-NEXT:    vmov.f32 s8, s9
1484; CHECK-NEXT:    vins.f16 s8, s6
1485; CHECK-NEXT:    strh r7, [r5], #4
1486; CHECK-NEXT:    vmov.16 q2[2], r4
1487; CHECK-NEXT:    le lr, .LBB17_5
1488; CHECK-NEXT:  .LBB17_6: @ %while.end
1489; CHECK-NEXT:    @ in Loop: Header=BB17_3 Depth=1
1490; CHECK-NEXT:    cmp.w r8, #0
1491; CHECK-NEXT:    beq .LBB17_1
1492; CHECK-NEXT:  @ %bb.7: @ %if.then
1493; CHECK-NEXT:    @ in Loop: Header=BB17_3 Depth=1
1494; CHECK-NEXT:    ldrh r1, [r1]
1495; CHECK-NEXT:    vfma.f16 q2, q4, r1
1496; CHECK-NEXT:    vmov.u16 r1, q2[0]
1497; CHECK-NEXT:    vfma.f16 q2, q3, r1
1498; CHECK-NEXT:    strh r1, [r5]
1499; CHECK-NEXT:    vmovx.f16 s6, s8
1500; CHECK-NEXT:    vstr.16 s6, [r12]
1501; CHECK-NEXT:    b .LBB17_2
1502; CHECK-NEXT:  .LBB17_8: @ %do.end
1503; CHECK-NEXT:    vpop {d8, d9, d10, d11, d12, d13}
1504; CHECK-NEXT:    add sp, #4
1505; CHECK-NEXT:    pop.w {r4, r5, r6, r7, r8, r9, pc}
1506; CHECK-NEXT:    .p2align 1
1507; CHECK-NEXT:  @ %bb.9:
1508; CHECK-NEXT:  .LCPI17_0:
1509; CHECK-NEXT:    .short 0x0000 @ half 0
1510entry:
1511  %pState1 = getelementptr inbounds %struct.arm_biquad_cascade_df2T_instance_f16, %struct.arm_biquad_cascade_df2T_instance_f16* %S, i32 0, i32 1
1512  %0 = load half*, half** %pState1, align 4
1513  %numStages = getelementptr inbounds %struct.arm_biquad_cascade_df2T_instance_f16, %struct.arm_biquad_cascade_df2T_instance_f16* %S, i32 0, i32 0
1514  %1 = load i8, i8* %numStages, align 4
1515  %conv = zext i8 %1 to i32
1516  %pCoeffs = getelementptr inbounds %struct.arm_biquad_cascade_df2T_instance_f16, %struct.arm_biquad_cascade_df2T_instance_f16* %S, i32 0, i32 2
1517  %2 = load half*, half** %pCoeffs, align 4
1518  %div = lshr i32 %blockSize, 1
1519  %cmp.not90 = icmp eq i32 %div, 0
1520  %and = and i32 %blockSize, 1
1521  %tobool.not = icmp eq i32 %and, 0
1522  br label %do.body
1523
1524do.body:                                          ; preds = %if.end, %entry
1525  %stage.0 = phi i32 [ %conv, %entry ], [ %dec23, %if.end ]
1526  %pCurCoeffs.0 = phi half* [ %2, %entry ], [ %add.ptr2, %if.end ]
1527  %pState.0 = phi half* [ %0, %entry ], [ %pState.1, %if.end ]
1528  %pIn.0 = phi half* [ %pSrc, %entry ], [ %pDst, %if.end ]
1529  %3 = bitcast half* %pCurCoeffs.0 to <8 x half>*
1530  %4 = load <8 x half>, <8 x half>* %3, align 2
1531  %add.ptr = getelementptr inbounds half, half* %pCurCoeffs.0, i32 2
1532  %5 = bitcast half* %add.ptr to <8 x half>*
1533  %6 = load <8 x half>, <8 x half>* %5, align 2
1534  %add.ptr2 = getelementptr inbounds half, half* %pCurCoeffs.0, i32 5
1535  %7 = bitcast half* %pState.0 to <8 x half>*
1536  %8 = load <8 x half>, <8 x half>* %7, align 2
1537  %9 = shufflevector <8 x half> %8, <8 x half> <half poison, half poison, half 0xH0000, half 0xH0000, half poison, half poison, half poison, half poison>, <8 x i32> <i32 0, i32 1, i32 10, i32 11, i32 4, i32 5, i32 6, i32 7>
1538  %10 = bitcast <8 x half> %4 to <8 x i16>
1539  %11 = tail call { i32, <8 x i16> } @llvm.arm.mve.vshlc.v8i16(<8 x i16> %10, i32 0, i32 16)
1540  %12 = extractvalue { i32, <8 x i16> } %11, 0
1541  %13 = extractvalue { i32, <8 x i16> } %11, 1
1542  %14 = bitcast <8 x i16> %13 to <8 x half>
1543  %15 = bitcast <8 x half> %6 to <8 x i16>
1544  %16 = tail call { i32, <8 x i16> } @llvm.arm.mve.vshlc.v8i16(<8 x i16> %15, i32 %12, i32 16)
1545  %17 = extractvalue { i32, <8 x i16> } %16, 1
1546  %18 = bitcast <8 x i16> %17 to <8 x half>
1547  br i1 %cmp.not90, label %while.end, label %while.body
1548
1549while.body:                                       ; preds = %do.body, %while.body
1550  %pIn.194 = phi half* [ %incdec.ptr4, %while.body ], [ %pIn.0, %do.body ]
1551  %state.093 = phi <8 x half> [ %30, %while.body ], [ %9, %do.body ]
1552  %pOut.192 = phi half* [ %incdec.ptr12, %while.body ], [ %pDst, %do.body ]
1553  %sample.091 = phi i32 [ %dec, %while.body ], [ %div, %do.body ]
1554  %incdec.ptr = getelementptr inbounds half, half* %pIn.194, i32 1
1555  %19 = load half, half* %pIn.194, align 2
1556  %incdec.ptr4 = getelementptr inbounds half, half* %pIn.194, i32 2
1557  %20 = load half, half* %incdec.ptr, align 2
1558  %.splatinsert = insertelement <8 x half> poison, half %19, i32 0
1559  %.splat = shufflevector <8 x half> %.splatinsert, <8 x half> poison, <8 x i32> zeroinitializer
1560  %21 = tail call fast <8 x half> @llvm.fma.v8f16(<8 x half> %4, <8 x half> %.splat, <8 x half> %state.093)
1561  %22 = extractelement <8 x half> %21, i32 0
1562  %.splat6 = shufflevector <8 x half> %21, <8 x half> poison, <8 x i32> zeroinitializer
1563  %23 = tail call fast <8 x half> @llvm.fma.v8f16(<8 x half> %6, <8 x half> %.splat6, <8 x half> %21)
1564  %24 = insertelement <8 x half> %23, half 0xH0000, i32 3
1565  %.splatinsert7 = insertelement <8 x half> poison, half %20, i32 0
1566  %.splat8 = shufflevector <8 x half> %.splatinsert7, <8 x half> poison, <8 x i32> zeroinitializer
1567  %25 = tail call fast <8 x half> @llvm.fma.v8f16(<8 x half> %14, <8 x half> %.splat8, <8 x half> %24)
1568  %26 = extractelement <8 x half> %25, i32 1
1569  %.splat10 = shufflevector <8 x half> %25, <8 x half> undef, <8 x i32> <i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1, i32 1>
1570  %27 = tail call fast <8 x half> @llvm.fma.v8f16(<8 x half> %18, <8 x half> %.splat10, <8 x half> %25)
1571  %28 = shufflevector <8 x half> %27, <8 x half> undef, <8 x i32> <i32 2, i32 undef, i32 undef, i32 3, i32 4, i32 5, i32 6, i32 7>
1572  %29 = insertelement <8 x half> %28, half 0xH0000, i32 2
1573  %30 = shufflevector <8 x half> %29, <8 x half> %27, <8 x i32> <i32 0, i32 11, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7>
1574  %incdec.ptr11 = getelementptr inbounds half, half* %pOut.192, i32 1
1575  store half %22, half* %pOut.192, align 2
1576  %incdec.ptr12 = getelementptr inbounds half, half* %pOut.192, i32 2
1577  store half %26, half* %incdec.ptr11, align 2
1578  %dec = add nsw i32 %sample.091, -1
1579  %cmp.not = icmp eq i32 %dec, 0
1580  br i1 %cmp.not, label %while.end, label %while.body
1581
1582while.end:                                        ; preds = %while.body, %do.body
1583  %pOut.1.lcssa = phi half* [ %pDst, %do.body ], [ %incdec.ptr12, %while.body ]
1584  %state.0.lcssa = phi <8 x half> [ %9, %do.body ], [ %30, %while.body ]
1585  %pIn.1.lcssa = phi half* [ %pIn.0, %do.body ], [ %incdec.ptr4, %while.body ]
1586  br i1 %tobool.not, label %if.else, label %if.then
1587
1588if.then:                                          ; preds = %while.end
1589  %31 = load half, half* %pIn.1.lcssa, align 2
1590  %.splatinsert14 = insertelement <8 x half> poison, half %31, i32 0
1591  %.splat15 = shufflevector <8 x half> %.splatinsert14, <8 x half> poison, <8 x i32> zeroinitializer
1592  %32 = tail call fast <8 x half> @llvm.fma.v8f16(<8 x half> %4, <8 x half> %.splat15, <8 x half> %state.0.lcssa)
1593  %33 = extractelement <8 x half> %32, i32 0
1594  %.splat17 = shufflevector <8 x half> %32, <8 x half> poison, <8 x i32> zeroinitializer
1595  %34 = tail call fast <8 x half> @llvm.fma.v8f16(<8 x half> %6, <8 x half> %.splat17, <8 x half> %32)
1596  store half %33, half* %pOut.1.lcssa, align 2
1597  %35 = extractelement <8 x half> %34, i32 1
1598  store half %35, half* %pState.0, align 2
1599  %36 = extractelement <8 x half> %34, i32 2
1600  br label %if.end
1601
1602if.else:                                          ; preds = %while.end
1603  %37 = extractelement <8 x half> %state.0.lcssa, i32 0
1604  store half %37, half* %pState.0, align 2
1605  %38 = extractelement <8 x half> %state.0.lcssa, i32 1
1606  br label %if.end
1607
1608if.end:                                           ; preds = %if.else, %if.then
1609  %.sink = phi half [ %38, %if.else ], [ %36, %if.then ]
1610  %39 = getelementptr inbounds half, half* %pState.0, i32 1
1611  store half %.sink, half* %39, align 2
1612  %pState.1 = getelementptr inbounds half, half* %pState.0, i32 2
1613  %dec23 = add i32 %stage.0, -1
1614  %cmp24.not = icmp eq i32 %dec23, 0
1615  br i1 %cmp24.not, label %do.end, label %do.body
1616
1617do.end:                                           ; preds = %if.end
1618  ret void
1619}
1620
1621define arm_aapcs_vfpcc half @vecAddAcrossF16Mve(<8 x half> %in) {
1622; CHECK-LABEL: vecAddAcrossF16Mve:
1623; CHECK:       @ %bb.0: @ %entry
1624; CHECK-NEXT:    vrev32.16 q1, q0
1625; CHECK-NEXT:    vadd.f16 q0, q1, q0
1626; CHECK-NEXT:    vrev64.32 q1, q0
1627; CHECK-NEXT:    vadd.f16 q0, q0, q1
1628; CHECK-NEXT:    vadd.f16 s0, s0, s2
1629; CHECK-NEXT:    bx lr
1630entry:
1631  %0 = shufflevector <8 x half> %in, <8 x half> poison, <8 x i32> <i32 1, i32 0, i32 3, i32 2, i32 5, i32 4, i32 7, i32 6>
1632  %1 = fadd fast <8 x half> %0, %in
1633  %2 = bitcast <8 x half> %1 to <4 x i32>
1634  %3 = shufflevector <4 x i32> %2, <4 x i32> poison, <4 x i32> <i32 1, i32 undef, i32 3, i32 undef>
1635  %4 = bitcast <4 x i32> %3 to <8 x half>
1636  %5 = fadd fast <8 x half> %1, %4
1637  %6 = extractelement <8 x half> %5, i32 0
1638  %7 = extractelement <8 x half> %5, i32 4
1639  %add = fadd fast half %6, %7
1640  ret half %add
1641}
1642
1643declare { i32, <8 x i16> } @llvm.arm.mve.vshlc.v8i16(<8 x i16>, i32, i32)
1644declare void @llvm.assume(i1)
1645declare <8 x i1> @llvm.arm.mve.vctp16(i32)
1646declare <8 x half> @llvm.fma.v8f16(<8 x half>, <8 x half>, <8 x half>)
1647declare void @llvm.masked.store.v8f16.p0v8f16(<8 x half>, <8 x half>*, i32 immarg, <8 x i1>)
1648