1 ; RUN: llc -march=hexagon -pipeliner-ignore-recmii -pipeliner-max-stages=2 -enable-pipeliner < %s -pipeliner-experimental-cg=true | FileCheck %s
3 ; This is a loop we pipeline to three packets, though we could do bettter.
5 ; CHECK: loop0(.LBB0_[[LOOP:.]],
6 ; CHECK: .LBB0_[[LOOP]]:
12 ; CHECK: }{{[ \t]*}}:endloop0
14 ; Function Attrs: nounwind
15 define void @f0(ptr nocapture %a0, i16 signext %a1) #0 {
17 %v0 = sext i16 %a1 to i32
19 %v2 = icmp sgt i32 %v1, 0
20 br i1 %v2, label %b1, label %b4
23 %v3 = getelementptr i32, ptr %a0, i32 %v1
24 %v4 = load i32, ptr %v3, align 4
27 b2: ; preds = %b2, %b1
28 %v5 = phi i32 [ %v16, %b2 ], [ %v1, %b1 ]
29 %v6 = phi i32 [ %v5, %b2 ], [ %v0, %b1 ]
30 %v7 = phi i32 [ %v10, %b2 ], [ %v4, %b1 ]
31 %v8 = add nsw i32 %v6, -2
32 %v9 = getelementptr inbounds i32, ptr %a0, i32 %v8
33 %v10 = load i32, ptr %v9, align 4, !tbaa !0
34 %v11 = tail call i64 @llvm.hexagon.M2.dpmpyss.s0(i32 %v10, i32 7946)
35 %v12 = tail call i64 @llvm.hexagon.S2.asl.r.p(i64 %v11, i32 -13)
36 %v13 = getelementptr inbounds i32, ptr %a0, i32 %v5
37 %v14 = tail call i32 @llvm.hexagon.A2.sat(i64 %v12)
38 %v15 = tail call i32 @llvm.hexagon.A2.subsat(i32 %v7, i32 %v14)
39 store i32 %v15, ptr %v13, align 4, !tbaa !0
40 %v16 = add nsw i32 %v5, -1
41 %v17 = icmp sgt i32 %v16, 0
42 br i1 %v17, label %b2, label %b3
47 b4: ; preds = %b3, %b0
51 ; Function Attrs: nounwind readnone
52 declare i64 @llvm.hexagon.S2.asl.r.p(i64, i32) #1
54 ; Function Attrs: nounwind readnone
55 declare i64 @llvm.hexagon.M2.dpmpyss.s0(i32, i32) #1
57 ; Function Attrs: nounwind readnone
58 declare i32 @llvm.hexagon.A2.subsat(i32, i32) #1
60 ; Function Attrs: nounwind readnone
61 declare i32 @llvm.hexagon.A2.sat(i64) #1
63 attributes #0 = { nounwind "target-cpu"="hexagonv55" }
64 attributes #1 = { nounwind readnone }
68 !2 = !{!"omnipotent char", !3}
69 !3 = !{!"Simple C/C++ TBAA"}