1 ; RUN: opt %loadPolly -polly-reschedule=0 -polly-loopfusion-greedy=1 -polly-postopts=0 -polly-print-opt-isl -disable-output < %s | FileCheck %s
2 ; RUN: opt %loadPolly -polly-reschedule=1 -polly-loopfusion-greedy=1 -polly-postopts=0 -polly-print-opt-isl -disable-output < %s | FileCheck %s
4 ; This could theoretically be fused by adjusting the offset of the second loop by %k (instead of relying on schedule dimensions).
6 define void @func(i32 %n, ptr noalias nonnull %A, i32 %k) {
11 %j1 = phi i32 [0, %entry], [%j1.inc, %inc1]
12 %j1.cmp = icmp slt i32 %j1, %n
13 br i1 %j1.cmp, label %body1, label %exit1
16 %arrayidx1 = getelementptr inbounds double, ptr %A, i32 %j1
17 store double 21.0, ptr %arrayidx1
21 %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 %idx2 = add i32 %j2, %k
34 %arrayidx2 = getelementptr inbounds double, ptr %A, i32 %idx2
35 store double 42.0, ptr %arrayidx2
39 %j2.inc = add nuw nsw i32 %j2, 1
50 ; CHECK: Calculated schedule: