1 ; RUN: llc -O3 -mv67t -march=hexagon < %s | FileCheck %s
3 ; Test that the inner loop in the tiny core version of bkfir has the assembler
4 ; directive "p2align 4".
6 ; CHECK: loop0(.LBB0_[[LOOP:.]],
11 define void @bkfir(ptr nocapture readonly %in, ptr nocapture readonly %coefs, i32 %tap, i32 %length, ptr nocapture %out) local_unnamed_addr #0 {
13 %cmp141 = icmp sgt i32 %length, 0
14 br i1 %cmp141, label %for.body.lr.ph, label %for.end52
17 %cmp8127 = icmp sgt i32 %tap, 0
18 br i1 %cmp8127, label %for.body.us.preheader, label %for.body.lr.ph.split
20 for.body.us.preheader:
24 %add.ptr.us.phi = phi ptr [ %add.ptr.us.inc, %for.cond7.for.end_crit_edge.us ], [ %in, %for.body.us.preheader ]
25 %i.0143.us = phi i32 [ %add51.us, %for.cond7.for.end_crit_edge.us ], [ 0, %for.body.us.preheader ]
26 %optr.0142.us = phi ptr [ %incdec.ptr49.us, %for.cond7.for.end_crit_edge.us ], [ %out, %for.body.us.preheader ]
27 %incdec.ptr.us = getelementptr inbounds i32, ptr %add.ptr.us.phi, i32 2
28 %0 = load i64, ptr %add.ptr.us.phi, align 8
29 %incdec.ptr1.us = getelementptr inbounds i32, ptr %add.ptr.us.phi, i32 4
30 %1 = load i64, ptr %incdec.ptr.us, align 8
31 %_Q6V64_internal_union.sroa.0.0.extract.trunc.us = trunc i64 %1 to i32
32 %_Q6V64_internal_union2.sroa.3.0.extract.shift.us = lshr i64 %0, 32
33 %_Q6V64_internal_union2.sroa.3.0.extract.trunc.us = trunc i64 %_Q6V64_internal_union2.sroa.3.0.extract.shift.us to i32
34 %2 = tail call i64 @llvm.hexagon.A2.combinew(i32 %_Q6V64_internal_union.sroa.0.0.extract.trunc.us, i32 %_Q6V64_internal_union2.sroa.3.0.extract.trunc.us)
35 %add.ptr.us.inc = getelementptr i32, ptr %add.ptr.us.phi, i32 4
36 br label %for.body9.us
39 %j.0137.us = phi i32 [ 0, %for.body.us ], [ %add.us, %for.body9.us ]
40 %x0x1.0136.us = phi i64 [ %0, %for.body.us ], [ %5, %for.body9.us ]
41 %x2x3.0135.us = phi i64 [ %1, %for.body.us ], [ %6, %for.body9.us ]
42 %x1x2.0134.us = phi i64 [ %2, %for.body.us ], [ %8, %for.body9.us ]
43 %iptrD.0133.us = phi ptr [ %incdec.ptr1.us, %for.body.us ], [ %incdec.ptr13.us, %for.body9.us ]
44 %iptrC.0132.us = phi ptr [ %coefs, %for.body.us ], [ %incdec.ptr11.us, %for.body9.us ]
45 %sum0.0131.us = phi i64 [ 0, %for.body.us ], [ %13, %for.body9.us ]
46 %sum1.0130.us = phi i64 [ 0, %for.body.us ], [ %14, %for.body9.us ]
47 %sum2.0129.us = phi i64 [ 0, %for.body.us ], [ %15, %for.body9.us ]
48 %sum3.0128.us = phi i64 [ 0, %for.body.us ], [ %16, %for.body9.us ]
49 %incdec.ptr10.us = getelementptr inbounds i64, ptr %iptrC.0132.us, i32 1
50 %3 = load i64, ptr %iptrC.0132.us, align 8
51 %incdec.ptr11.us = getelementptr inbounds i64, ptr %iptrC.0132.us, i32 2
52 %4 = load i64, ptr %incdec.ptr10.us, align 8
53 %incdec.ptr12.us = getelementptr inbounds i64, ptr %iptrD.0133.us, i32 1
54 %5 = load i64, ptr %iptrD.0133.us, align 8
55 %incdec.ptr13.us = getelementptr inbounds i64, ptr %iptrD.0133.us, i32 2
56 %6 = load i64, ptr %incdec.ptr12.us, align 8
57 %_Q6V64_internal_union14.sroa.0.0.extract.trunc.us = trunc i64 %5 to i32
58 %_Q6V64_internal_union14.sroa.4.0.extract.shift.us = lshr i64 %5, 32
59 %_Q6V64_internal_union19.sroa.3.0.extract.shift.us = lshr i64 %x2x3.0135.us, 32
60 %_Q6V64_internal_union19.sroa.3.0.extract.trunc.us = trunc i64 %_Q6V64_internal_union19.sroa.3.0.extract.shift.us to i32
61 %7 = tail call i64 @llvm.hexagon.A2.combinew(i32 %_Q6V64_internal_union14.sroa.0.0.extract.trunc.us, i32 %_Q6V64_internal_union19.sroa.3.0.extract.trunc.us)
62 %_Q6V64_internal_union24.sroa.0.0.extract.trunc.us = trunc i64 %6 to i32
63 %_Q6V64_internal_union29.sroa.3.0.extract.trunc.us = trunc i64 %_Q6V64_internal_union14.sroa.4.0.extract.shift.us to i32
64 %8 = tail call i64 @llvm.hexagon.A2.combinew(i32 %_Q6V64_internal_union24.sroa.0.0.extract.trunc.us, i32 %_Q6V64_internal_union29.sroa.3.0.extract.trunc.us)
65 %9 = tail call i64 @llvm.hexagon.M7.dcmpyrwc.acc(i64 %sum0.0131.us, i64 %x0x1.0136.us, i64 %3)
66 %10 = tail call i64 @llvm.hexagon.M7.dcmpyrwc.acc(i64 %sum1.0130.us, i64 %x1x2.0134.us, i64 %3)
67 %11 = tail call i64 @llvm.hexagon.M7.dcmpyrwc.acc(i64 %sum2.0129.us, i64 %x2x3.0135.us, i64 %3)
68 %12 = tail call i64 @llvm.hexagon.M7.dcmpyrwc.acc(i64 %sum3.0128.us, i64 %7, i64 %3)
69 %13 = tail call i64 @llvm.hexagon.M7.dcmpyrwc.acc(i64 %9, i64 %x2x3.0135.us, i64 %4)
70 %14 = tail call i64 @llvm.hexagon.M7.dcmpyrwc.acc(i64 %10, i64 %7, i64 %4)
71 %15 = tail call i64 @llvm.hexagon.M7.dcmpyrwc.acc(i64 %11, i64 %5, i64 %4)
72 %16 = tail call i64 @llvm.hexagon.M7.dcmpyrwc.acc(i64 %12, i64 %8, i64 %4)
73 %add.us = add nuw nsw i32 %j.0137.us, 4
74 %cmp8.us = icmp slt i32 %add.us, %tap
75 br i1 %cmp8.us, label %for.body9.us, label %for.cond7.for.end_crit_edge.us
77 for.cond7.for.end_crit_edge.us:
78 %17 = ashr i64 %13, 39
79 %18 = ashr i64 %14, 39
80 %19 = ashr i64 %15, 39
81 %20 = ashr i64 %16, 39
82 %21 = tail call i32 @llvm.hexagon.A2.sat(i64 %17)
83 %22 = tail call i32 @llvm.hexagon.A2.sat(i64 %18)
84 %23 = tail call i32 @llvm.hexagon.A2.sat(i64 %19)
85 %24 = tail call i32 @llvm.hexagon.A2.sat(i64 %20)
86 %_Q6V64_internal_union34.sroa.4.0.insert.ext.us = zext i32 %22 to i64
87 %_Q6V64_internal_union34.sroa.4.0.insert.shift.us = shl nuw i64 %_Q6V64_internal_union34.sroa.4.0.insert.ext.us, 32
88 %_Q6V64_internal_union34.sroa.0.0.insert.ext.us = zext i32 %21 to i64
89 %_Q6V64_internal_union34.sroa.0.0.insert.insert.us = or i64 %_Q6V64_internal_union34.sroa.4.0.insert.shift.us, %_Q6V64_internal_union34.sroa.0.0.insert.ext.us
90 %incdec.ptr41.us = getelementptr inbounds i64, ptr %optr.0142.us, i32 1
91 store i64 %_Q6V64_internal_union34.sroa.0.0.insert.insert.us, ptr %optr.0142.us, align 8
92 %_Q6V64_internal_union42.sroa.4.0.insert.ext.us = zext i32 %24 to i64
93 %_Q6V64_internal_union42.sroa.4.0.insert.shift.us = shl nuw i64 %_Q6V64_internal_union42.sroa.4.0.insert.ext.us, 32
94 %_Q6V64_internal_union42.sroa.0.0.insert.ext.us = zext i32 %23 to i64
95 %_Q6V64_internal_union42.sroa.0.0.insert.insert.us = or i64 %_Q6V64_internal_union42.sroa.4.0.insert.shift.us, %_Q6V64_internal_union42.sroa.0.0.insert.ext.us
96 %incdec.ptr49.us = getelementptr inbounds i64, ptr %optr.0142.us, i32 2
97 store i64 %_Q6V64_internal_union42.sroa.0.0.insert.insert.us, ptr %incdec.ptr41.us, align 8
98 %add51.us = add nuw nsw i32 %i.0143.us, 4
99 %cmp.us = icmp slt i32 %add51.us, %length
100 br i1 %cmp.us, label %for.body.us, label %for.end52
102 for.body.lr.ph.split:
103 %25 = tail call i32 @llvm.hexagon.A2.sat(i64 0)
104 %_Q6V64_internal_union34.sroa.4.0.insert.ext = zext i32 %25 to i64
105 %_Q6V64_internal_union34.sroa.4.0.insert.shift = shl nuw i64 %_Q6V64_internal_union34.sroa.4.0.insert.ext, 32
106 %_Q6V64_internal_union34.sroa.0.0.insert.insert = or i64 %_Q6V64_internal_union34.sroa.4.0.insert.shift, %_Q6V64_internal_union34.sroa.4.0.insert.ext
110 %i.0143 = phi i32 [ 0, %for.body.lr.ph.split ], [ %add51, %for.body ]
111 %optr.0142 = phi ptr [ %out, %for.body.lr.ph.split ], [ %incdec.ptr49, %for.body ]
112 %incdec.ptr41 = getelementptr inbounds i64, ptr %optr.0142, i32 1
113 store i64 %_Q6V64_internal_union34.sroa.0.0.insert.insert, ptr %optr.0142, align 8
114 %incdec.ptr49 = getelementptr inbounds i64, ptr %optr.0142, i32 2
115 store i64 %_Q6V64_internal_union34.sroa.0.0.insert.insert, ptr %incdec.ptr41, align 8
116 %add51 = add nuw nsw i32 %i.0143, 4
117 %cmp = icmp slt i32 %add51, %length
118 br i1 %cmp, label %for.body, label %for.end52
124 declare i64 @llvm.hexagon.A2.combinew(i32, i32) #1
125 declare i64 @llvm.hexagon.M7.dcmpyrwc.acc(i64, i64, i64) #1
126 declare i32 @llvm.hexagon.A2.sat(i64) #1
128 attributes #0 = { nounwind "target-cpu"="hexagonv67t" "target-features"="+audio" }
129 attributes #1 = { nounwind readnone }