1; RUN: llc -march=hexagon -enable-pipeliner -stats \
2; RUN:     -pipeliner-prune-loop-carried=false -fp-contract=fast \
3; RUN:     -o /dev/null < %s 2>&1 | FileCheck %s --check-prefix=STATS
4; REQUIRES: asserts
5
6; That that we do not pipeline this loop. The recurrence is too large. If
7; we pipeline this example, that means we're not checking the complete
8; chain of dependences.
9
10; STATS-NOT: 1 pipeliner   - Number of loops software pipelined
11
12; Function Attrs: nounwind
13define void @f0(i32 %a0, i32 %a1, double %a2, double %a3, i8* %a4, i8* %a5, i8* %a6, i8* %a7, i8* %a8, [1000 x i8]* %a9, [1000 x i8]* %a10, [1000 x i8]* %a11) #0 {
14b0:
15  br i1 undef, label %b1, label %b4
16
17b1:                                               ; preds = %b3, %b0
18  br label %b2
19
20b2:                                               ; preds = %b2, %b1
21  %v0 = phi i8* [ %v22, %b2 ], [ %a5, %b1 ]
22  %v1 = phi i8* [ %v23, %b2 ], [ %a6, %b1 ]
23  %v2 = phi i8* [ %v24, %b2 ], [ %a7, %b1 ]
24  %v3 = phi i32 [ %v20, %b2 ], [ 0, %b1 ]
25  %v4 = load i8, i8* %v0, align 1, !tbaa !0
26  %v5 = zext i8 %v4 to i32
27  %v6 = load i8, i8* %v1, align 1, !tbaa !0
28  %v7 = sext i8 %v6 to i32
29  %v8 = load i8, i8* %v2, align 1, !tbaa !0
30  %v9 = sext i8 %v8 to i32
31  %v10 = mul nsw i32 %v9, %v7
32  %v11 = add nsw i32 %v10, %v5
33  %v12 = trunc i32 %v11 to i8
34  store i8 %v12, i8* undef, align 1, !tbaa !0
35  %v13 = load i8, i8* %v2, align 1, !tbaa !0
36  %v14 = sext i8 %v13 to i32
37  %v15 = load i8, i8* undef, align 1, !tbaa !0
38  %v16 = sext i8 %v15 to i32
39  %v17 = mul nsw i32 %v16, %v14
40  %v18 = add i32 %v17, %v11
41  %v19 = trunc i32 %v18 to i8
42  store i8 %v19, i8* %v0, align 1, !tbaa !0
43  %v20 = add nsw i32 %v3, 1
44  store i8 0, i8* undef, align 1, !tbaa !0
45  %v21 = icmp eq i32 %v20, undef
46  %v22 = getelementptr i8, i8* %v0, i32 1
47  %v23 = getelementptr i8, i8* %v1, i32 1
48  %v24 = getelementptr i8, i8* %v2, i32 1
49  br i1 %v21, label %b3, label %b2
50
51b3:                                               ; preds = %b2
52  tail call void @f1(i32 %a1, i8* %a4, i8* %a5, i8* %a6, i8* %a7, i8* %a8, [1000 x i8]* %a9, [1000 x i8]* %a10, [1000 x i8]* %a11, i8 signext 1) #2
53  br i1 undef, label %b4, label %b1
54
55b4:                                               ; preds = %b3, %b0
56  ret void
57}
58
59declare void @f1(i32, i8*, i8*, i8*, i8*, i8*, [1000 x i8]*, [1000 x i8]*, [1000 x i8]*, i8 signext) #1
60
61attributes #0 = { nounwind "target-cpu"="hexagonv55" }
62attributes #1 = { "target-cpu"="hexagonv55" }
63attributes #2 = { nounwind }
64
65!0 = !{!1, !1, i64 0}
66!1 = !{!"omnipotent char", !2, i64 0}
67!2 = !{!"Simple C/C++ TBAA"}
68