1 ; RUN: llc -disable-lsr -march=hexagon -enable-pipeliner \
2 ; RUN: -debug-only=pipeliner < %s 2>&1 > /dev/null -pipeliner-experimental-cg=true | FileCheck %s
5 ; Test that checks that the II set by pragma was reset between loops.
7 ; CHECK: MII = 10 MAX_II = 10
8 ; CHECK: MII = 1 MAX_II = 11 (rec=1, res=1)
9 ; CHECK-NOT: MII = 10 MAX_II = 10
11 ; Function Attrs: nounwind
12 define void @f0(i32* nocapture %a0, i32 %a1) #0 {
14 %v0 = icmp sgt i32 %a1, 1
15 br i1 %v0, label %b1, label %b4
18 %v1 = load i32, i32* %a0, align 4
20 %v3 = getelementptr i32, i32* %a0, i32 1
24 b2: ; preds = %b2, %b1
25 %v5 = phi i32 [ %v12, %b2 ], [ %v4, %b1 ]
26 %v6 = phi i32* [ %v11, %b2 ], [ %v3, %b1 ]
27 %v7 = phi i32 [ %v10, %b2 ], [ %v2, %b1 ]
28 store i32 %v7, i32* %v6, align 4
30 %v9 = getelementptr i32, i32* %v6, i32 -1
31 store i32 %v8, i32* %v9, align 4
32 %v10 = add i32 %v7, 10
33 %v11 = getelementptr i32, i32* %v6, i32 1
34 %v12 = add i32 %v5, -1
35 %v13 = icmp eq i32 %v12, 0
36 br i1 %v13, label %b3, label %b2
39 br label %b4 , !llvm.loop !2
41 b4: ; preds = %b3, %b0
45 ; Function Attrs: nounwind
46 define void @f1(i32* nocapture %a0, i32 %a1) #0 {
48 %v0 = icmp sgt i32 %a1, 1
49 br i1 %v0, label %b1, label %b4
52 %v1 = load i32, i32* %a0, align 4
54 %v3 = getelementptr i32, i32* %a0, i32 1
58 b2: ; preds = %b2, %b1
59 %v5 = phi i32 [ %v12, %b2 ], [ %v4, %b1 ]
60 %v6 = phi i32* [ %v11, %b2 ], [ %v3, %b1 ]
61 %v7 = phi i32 [ %v10, %b2 ], [ %v2, %b1 ]
62 store i32 %v7, i32* %v6, align 4
64 %v9 = getelementptr i32, i32* %v6, i32 -1
65 store i32 %v8, i32* %v9, align 4
66 %v10 = add i32 %v7, 10
67 %v11 = getelementptr i32, i32* %v6, i32 1
68 %v12 = add i32 %v5, -1
69 %v13 = icmp eq i32 %v12, 0
70 br i1 %v13, label %b3, label %b2
75 b4: ; preds = %b3, %b0
79 attributes #0 = { nounwind }
81 !0 = !{i32 1, !"wchar_size", i32 4}
83 !2 = distinct !{!2, !3}
84 !3 = !{!"llvm.loop.pipeline.initiationinterval", i32 10}