1 ; RUN: opt %loadPolly -polly-reschedule=0 -polly-loopfusion-greedy=1 -polly-postopts=0 -polly-print-opt-isl -disable-output < %s | FileCheck %s --check-prefixes=CHECK,RAW
2 ; RUN: opt %loadPolly -polly-reschedule=1 -polly-loopfusion-greedy=1 -polly-postopts=0 -polly-print-opt-isl -disable-output < %s | FileCheck %s --check-prefixes=CHECK
4 define void @func(i32 %n, ptr noalias nonnull %A, ptr noalias nonnull %B, i32 %k) {
10 %j1 = phi i32 [0, %entry], [%j1.inc, %inc1]
11 %j1.cmp = icmp slt i32 %j1, %n
12 br i1 %j1.cmp, label %body1, label %exit1
15 %arrayidx1 = getelementptr inbounds double, ptr %A, i32 %j1
16 store double 21.0, ptr %arrayidx1
20 %j1.inc = add nuw nsw i32 %j1, 1
28 %j2 = phi i32 [0, %exit1], [%j2.inc, %inc2]
29 %j2.cmp = icmp slt i32 %j2, %n
30 br i1 %j2.cmp, label %body2, label %exit2
33 %arrayidx2 = getelementptr inbounds double, ptr %B, i32 %j1
34 store double 42.0, ptr %arrayidx2
38 %j2.inc = add nuw nsw i32 %j2, 1
46 %j3 = phi i32 [0, %exit2], [%j3.inc, %inc3]
47 %j3.cmp = icmp slt i32 %j3, %n
48 br i1 %j3.cmp, label %body3, label %exit3
51 %idx3 = add i32 %j3, %k
52 %arrayidx3 = getelementptr inbounds double, ptr %B, i32 %idx3
53 store double 84.0, ptr %arrayidx3
57 %j3.inc = add nuw nsw i32 %j3, 1
58 br label %for3, !llvm.loop !1
69 !1 = distinct !{!1, !2}
70 !2 = !{!"llvm.loop.id", !"Hello World!"}
73 ; CHECK: Calculated schedule:
74 ; CHECK-NEXT: domain: "[n, k] -> { Stmt_body2[i0] : 0 <= i0 < n; Stmt_body1[i0] : 0 <= i0 < n; Stmt_body3[i0] : 0 <= i0 < n }"
76 ; CHECK-NEXT: sequence:
77 ; CHECK-NEXT: - filter: "[n, k] -> { Stmt_body2[i0]; Stmt_body1[i0] }"
79 ; CHECK-NEXT: schedule: "[n, k] -> [{ Stmt_body2[i0] -> [(i0)]; Stmt_body1[i0] -> [(i0)] }]"
81 ; CHECK-NEXT: sequence:
82 ; CHECK-NEXT: - filter: "[n, k] -> { Stmt_body1[i0] }"
83 ; CHECK-NEXT: - filter: "[n, k] -> { Stmt_body2[i0] }"
84 ; CHECK-NEXT: - filter: "[n, k] -> { Stmt_body3[i0] }"
86 ; RAW-NEXT: mark: "Loop with Metadata"
88 ; CHECK-NEXT: schedule: "[n, k] -> [{ Stmt_body3[i0] -> [(i0)] }]"