blob: d340ff6d0ccece8f1d1a0c27d7d806eb8798212a [file] [log] [blame]
Krzysztof Parzyszek046090d2018-03-12 14:01:28 +00001; RUN: llc -march=hexagon -enable-pipeliner=true -stats -o /dev/null < %s \
2; RUN: 2>&1 | FileCheck %s --check-prefix=STATS
3
4; Test that we do not schedule chained references too far apart,
5; which enables the loop to be pipelined. In this test, the loop should
6; not be pipelined when the chained references are constrained correctly.
7
8; STATS-NOT: 1 pipeliner - Number of loops software pipelined
9
10; Function Attrs: nounwind
11define void @f0() #0 {
12b0:
13 br label %b2
14
15b1: ; preds = %b6
16 br label %b7
17
18b2: ; preds = %b6, %b0
19 br label %b3
20
21b3: ; preds = %b5, %b2
22 br i1 undef, label %b4, label %b5
23
24b4: ; preds = %b3
25 br label %b5
26
27b5: ; preds = %b4, %b3
28 br i1 undef, label %b3, label %b6
29
30b6: ; preds = %b5
31 br i1 undef, label %b1, label %b2
32
33b7: ; preds = %b7, %b1
34 %v0 = phi i32 [ 0, %b1 ], [ %v4, %b7 ]
35 %v1 = load i16, i16* undef, align 8, !tbaa !0
36 %v2 = icmp sgt i16 %v1, undef
37 %v3 = select i1 %v2, i16 4, i16 undef
38 store i16 %v3, i16* undef, align 2, !tbaa !0
39 store i16 -32768, i16* undef, align 2, !tbaa !0
40 %v4 = add i32 %v0, 1
41 %v5 = icmp eq i32 %v4, 5
42 br i1 %v5, label %b8, label %b7
43
44b8: ; preds = %b7
45 br i1 undef, label %b9, label %b10
46
47b9: ; preds = %b8
48 br label %b10
49
50b10: ; preds = %b9, %b8
51 br i1 undef, label %b11, label %b12
52
53b11: ; preds = %b10
54 unreachable
55
56b12: ; preds = %b10
57 ret void
58}
59
60attributes #0 = { nounwind "target-cpu"="hexagonv55" }
61
62!0 = !{!1, !1, i64 0}
63!1 = !{!"short", !2}
64!2 = !{!"omnipotent char", !3}
65!3 = !{!"Simple C/C++ TBAA"}