1 ; RUN: opt %loadPolly -polly-print-scops -disable-output < %s | FileCheck %s
3 ; The SCoP contains a loop with multiple exit blocks (BBs after leaving
4 ; the loop). The current implementation of deriving their domain derives
5 ; only a common domain for all of the exit blocks. We disabled loops with
6 ; multiple exit blocks until this is fixed.
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) };
12 ; void f(int *A, int N, int P, int Q) {
13 ; for (int i = 0; i < N; i++) {
22 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
24 define void @f(ptr %A, i32 %N, i32 %P, i32 %Q) {
26 %tmp = sext i32 %N to i64
27 %tmp1 = sext i32 %Q to i64
30 for.cond: ; preds = %for.inc, %entry
31 %indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 0, %entry ]
32 %cmp = icmp slt i64 %indvars.iv, %tmp
33 br i1 %cmp, label %for.body, label %for.end.loopexit
35 for.body: ; preds = %for.cond
36 %tmp2 = trunc i64 %indvars.iv to i32
37 %cmp1 = icmp eq i32 %tmp2, %P
38 br i1 %cmp1, label %if.then, label %if.end
40 if.then: ; preds = %for.body
43 if.end: ; preds = %for.body
44 %arrayidx = getelementptr inbounds i32, ptr %A, i64 %indvars.iv
45 %tmp3 = load i32, ptr %arrayidx, align 4
46 %inc = add nsw i32 %tmp3, 1
47 store i32 %inc, ptr %arrayidx, align 4
48 %cmp2 = icmp sgt i64 %indvars.iv, %tmp1
49 br i1 %cmp2, label %if.then.3, label %if.end.4
51 if.then.3: ; preds = %if.end
54 if.end.4: ; preds = %if.end
57 for.inc: ; preds = %if.end.4
58 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
61 for.end.loopexit: ; preds = %for.cond
64 for.end: ; preds = %for.end.loopexit, %if.then.3, %if.then