67 lines · plain
1; RUN: opt %loadNPMPolly '-passes=polly-custom<scops>' -polly-print-scops -disable-output < %s 2>&1 | FileCheck %s2;3; The SCoP contains a loop with multiple exit blocks (BBs after leaving4; the loop). The current implementation of deriving their domain derives5; only a common domain for all of the exit blocks. We disabled loops with6; multiple exit blocks until this is fixed.7; XFAIL: *8;9; CHECK: Domain :=10; CHECK: [N, P, Q] -> { Stmt_if_end[i0] : 0 <= i0 <= 1 + Q and i0 < N and (i0 < P or (P < 0 and i0 >= 2 + P)); Stmt_if_end[0] : N > 0 and ((P <= -2 and Q <= -2) or (P > 0 and Q <= -2) or P = -1) };11;12; void f(int *A, int N, int P, int Q) {13; for (int i = 0; i < N; i++) {14; if (i == P)15; break;16; A[i]++;17; if (i > Q)18; break;19; }20; }21;22target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"23 24define void @f(ptr %A, i32 %N, i32 %P, i32 %Q) {25entry:26 %tmp = sext i32 %N to i6427 %tmp1 = sext i32 %Q to i6428 br label %for.cond29 30for.cond: ; preds = %for.inc, %entry31 %indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 0, %entry ]32 %cmp = icmp slt i64 %indvars.iv, %tmp33 br i1 %cmp, label %for.body, label %for.end.loopexit34 35for.body: ; preds = %for.cond36 %tmp2 = trunc i64 %indvars.iv to i3237 %cmp1 = icmp eq i32 %tmp2, %P38 br i1 %cmp1, label %if.then, label %if.end39 40if.then: ; preds = %for.body41 br label %for.end42 43if.end: ; preds = %for.body44 %arrayidx = getelementptr inbounds i32, ptr %A, i64 %indvars.iv45 %tmp3 = load i32, ptr %arrayidx, align 446 %inc = add nsw i32 %tmp3, 147 store i32 %inc, ptr %arrayidx, align 448 %cmp2 = icmp sgt i64 %indvars.iv, %tmp149 br i1 %cmp2, label %if.then.3, label %if.end.450 51if.then.3: ; preds = %if.end52 br label %for.end53 54if.end.4: ; preds = %if.end55 br label %for.inc56 57for.inc: ; preds = %if.end.458 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 159 br label %for.cond60 61for.end.loopexit: ; preds = %for.cond62 br label %for.end63 64for.end: ; preds = %for.end.loopexit, %if.then.3, %if.then65 ret void66}67