85 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; void foo(long n, float A[100]) {10; for (long j = 0; j < n; j++) {11; for (long i = j; i < n; i++) {12; if (i < 0)13; goto end;14;15; if (i >= 100)16; goto end;17;18; A[i] += i;19; }20; }21; end:22; return;23; }24;25; CHECK: Domain :=26; CHECK: [n] -> { Stmt_if_end_7[i0, i1] : i0 >= 0 and 0 <= i1 <= 99 - i0 and i1 < n - i0 };27;28target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"29 30define void @foo(i64 %n, ptr %A) {31entry:32 br label %for.cond33 34for.cond: ; preds = %for.inc.8, %entry35 %j.0 = phi i64 [ 0, %entry ], [ %inc9, %for.inc.8 ]36 %cmp = icmp slt i64 %j.0, %n37 br i1 %cmp, label %for.body, label %for.end.1038 39for.body: ; preds = %for.cond40 br label %for.cond.141 42for.cond.1: ; preds = %for.inc, %for.body43 %i.0 = phi i64 [ %j.0, %for.body ], [ %inc, %for.inc ]44 %cmp2 = icmp slt i64 %i.0, %n45 br i1 %cmp2, label %for.body.3, label %for.end46 47for.body.3: ; preds = %for.cond.148 br i1 false, label %if.then, label %if.end49 50if.then: ; preds = %for.body.351 br label %end52 53if.end: ; preds = %for.body.354 %cmp5 = icmp sgt i64 %i.0, 9955 br i1 %cmp5, label %if.then.6, label %if.end.756 57if.then.6: ; preds = %if.end58 br label %end59 60if.end.7: ; preds = %if.end61 %conv = sitofp i64 %i.0 to float62 %arrayidx = getelementptr inbounds float, ptr %A, i64 %i.063 %tmp = load float, ptr %arrayidx, align 464 %add = fadd float %tmp, %conv65 store float %add, ptr %arrayidx, align 466 br label %for.inc67 68for.inc: ; preds = %if.end.769 %inc = add nuw nsw i64 %i.0, 170 br label %for.cond.171 72for.end: ; preds = %for.cond.173 br label %for.inc.874 75for.inc.8: ; preds = %for.end76 %inc9 = add nuw nsw i64 %j.0, 177 br label %for.cond78 79for.end.10: ; preds = %for.cond80 br label %end81 82end: ; preds = %for.end.10, %if.then.6, %if.then83 ret void84}85