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,OPT
4 define void @func(i32 %n, ptr noalias nonnull %A) {
9 %k = phi i32 [0, %entry], [%k.inc, %outer.inc]
10 %k.cmp = icmp slt i32 %k, %n
11 br i1 %k.cmp, label %for1, label %outer.exit
14 %j1 = phi i32 [0, %outer.for], [%j1.inc, %inc1]
15 %j1.cmp = icmp slt i32 %j1, %n
16 br i1 %j1.cmp, label %body1, label %exit1
19 %arrayidx1 = getelementptr inbounds double, ptr %A, i32 %j1
20 store double 21.0, ptr %arrayidx1
24 %j1.inc = add nuw nsw i32 %j1, 1
31 %j2 = phi i32 [0, %exit1], [%j2.inc, %inc2]
32 %j2.cmp = icmp slt i32 %j2, %n
33 br i1 %j2.cmp, label %body2, label %exit2
36 %arrayidx2 = getelementptr inbounds double, ptr %A, i32 %j2
37 store double 42.0, ptr %arrayidx2
41 %j2.inc = add nuw nsw i32 %j2, 1
48 %k.inc = add nuw nsw i32 %k, 1
59 ; CHECK: Calculated schedule:
60 ; CHECK-NEXT: domain: "[n] -> { Stmt_body2[i0, i1] : 0 <= i0 < n and 0 <= i1 < n; Stmt_body1[i0, i1] : 0 <= i0 < n and 0 <= i1 < n }"
62 ; RAW-NEXT: schedule: "[n] -> [{ Stmt_body2[i0, i1] -> [(i0)]; Stmt_body1[i0, i1] -> [(i0)] }, { Stmt_body2[i0, i1] -> [(i1)]; Stmt_body1[i0, i1] -> [(i1)] }]"
63 ; OPT-NEXT: schedule: "[n] -> [{ Stmt_body2[i0, i1] -> [(i1)]; Stmt_body1[i0, i1] -> [(i1)] }, { Stmt_body2[i0, i1] -> [(i0)]; Stmt_body1[i0, i1] -> [(i0)] }]"
64 ; OPT-NEXT: permutable: 1
65 ; OPT-NEXT: coincident: [ 1, 0 ]
67 ; CHECK-NEXT: sequence:
68 ; CHECK-NEXT: - filter: "[n] -> { Stmt_body1[i0, i1] }"
69 ; CHECK-NEXT: - filter: "[n] -> { Stmt_body2[i0, i1] }"