79 lines · plain
1; RUN: opt %loadNPMPolly -polly-reschedule=0 -polly-loopfusion-greedy=1 -polly-postopts=0 '-passes=polly-custom<opt-isl>' -polly-print-opt-isl -disable-output < %s | FileCheck %s2; RUN: opt %loadNPMPolly -polly-reschedule=1 -polly-loopfusion-greedy=1 -polly-postopts=0 '-passes=polly-custom<opt-isl>' -polly-print-opt-isl -disable-output < %s | FileCheck %s3 4define void @func(i32 %n, ptr noalias nonnull %A, ptr noalias nonnull %B) {5entry:6 br label %outer.for17 8outer.for1:9 %k1 = phi i32 [0, %entry], [%k1.inc, %outer.inc1]10 %k1.cmp = icmp slt i32 %k1, %n11 br i1 %k1.cmp, label %for1, label %outer.exit112 13 for1:14 %j1 = phi i32 [0, %outer.for1], [%j1.inc, %inc1]15 %j1.cmp = icmp slt i32 %j1, %n16 br i1 %j1.cmp, label %body1, label %exit117 18 body1:19 %arrayidx1 = getelementptr inbounds [1024 x double], ptr %A, i32 %k1, i32 %j120 store double 21.0, ptr %arrayidx121 br label %inc122 23 inc1:24 %j1.inc = add nuw nsw i32 %j1, 125 br label %for126 27 exit1:28 br label %outer.inc129 30outer.inc1:31 %k1.inc = add nuw nsw i32 %k1, 132 br label %outer.for133 34outer.exit1:35 br label %outer.for236 37outer.for2:38 %k2 = phi i32 [0, %outer.exit1], [%k2.inc, %outer.inc2]39 %k2.cmp = icmp slt i32 %k2, %n40 br i1 %k2.cmp, label %for2, label %outer.exit241 42 for2:43 %j2 = phi i32 [0, %outer.for2], [%j2.inc, %inc2]44 %j2.cmp = icmp slt i32 %j2, %n45 br i1 %j2.cmp, label %body2, label %exit246 47 body2:48 %arrayidx2 = getelementptr inbounds [1024 x double], ptr %A, i32 %k2, i32 %j249 store double 42.0, ptr %arrayidx250 br label %inc251 52 inc2:53 %j2.inc = add nuw nsw i32 %j2, 154 br label %for255 56 exit2:57 br label %outer.inc258 59outer.inc2:60 %k2.inc = add nuw nsw i32 %k2, 161 br label %outer.for262 63outer.exit2:64 br label %return65 66return:67 ret void68}69 70 71; CHECK: Calculated schedule:72; 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 }"73; CHECK-NEXT: child:74; CHECK-NEXT: schedule: "[n] -> [{ Stmt_body2[i0, i1] -> [(i0)]; Stmt_body1[i0, i1] -> [(i0)] }, { Stmt_body2[i0, i1] -> [(i1)]; Stmt_body1[i0, i1] -> [(i1)] }]"75; CHECK-NEXT: child:76; CHECK-NEXT: sequence:77; CHECK-NEXT: - filter: "[n] -> { Stmt_body1[i0, i1] }"78; CHECK-NEXT: - filter: "[n] -> { Stmt_body2[i0, i1] }"79