Krzysztof Parzyszek | 046090d | 2018-03-12 14:01:28 +0000 | [diff] [blame^] | 1 | ; 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 |
| 11 | define void @f0() #0 { |
| 12 | b0: |
| 13 | br label %b2 |
| 14 | |
| 15 | b1: ; preds = %b6 |
| 16 | br label %b7 |
| 17 | |
| 18 | b2: ; preds = %b6, %b0 |
| 19 | br label %b3 |
| 20 | |
| 21 | b3: ; preds = %b5, %b2 |
| 22 | br i1 undef, label %b4, label %b5 |
| 23 | |
| 24 | b4: ; preds = %b3 |
| 25 | br label %b5 |
| 26 | |
| 27 | b5: ; preds = %b4, %b3 |
| 28 | br i1 undef, label %b3, label %b6 |
| 29 | |
| 30 | b6: ; preds = %b5 |
| 31 | br i1 undef, label %b1, label %b2 |
| 32 | |
| 33 | b7: ; 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 | |
| 44 | b8: ; preds = %b7 |
| 45 | br i1 undef, label %b9, label %b10 |
| 46 | |
| 47 | b9: ; preds = %b8 |
| 48 | br label %b10 |
| 49 | |
| 50 | b10: ; preds = %b9, %b8 |
| 51 | br i1 undef, label %b11, label %b12 |
| 52 | |
| 53 | b11: ; preds = %b10 |
| 54 | unreachable |
| 55 | |
| 56 | b12: ; preds = %b10 |
| 57 | ret void |
| 58 | } |
| 59 | |
| 60 | attributes #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"} |