75 lines · plain
1; RUN: opt %loadNPMPolly '-passes=polly-custom<scops>' -polly-print-scops -disable-output < %s | FileCheck %s --check-prefix=AFFINE2; RUN: opt %loadNPMPolly -polly-allow-nonaffine '-passes=polly-custom<scops>' -polly-print-scops -disable-output < %s | FileCheck %s --check-prefix=NONAFFINE3 4; The SCoP contains a loop with multiple exit blocks (BBs after leaving5; the loop). The current implementation of deriving their domain derives6; only a common domain for all of the exit blocks. We disabled loops with7; multiple exit blocks until this is fixed.8; XFAIL: *9 10; The loop for.body => for.inc has an unpredictable iteration count could due to11; the undef start value that it is compared to. Therefore the array element12; %arrayidx101 that depends on that exit value cannot be affine.13; Derived from test-suite/MultiSource/Benchmarks/BitBench/uuencode/uuencode.c14 15define void @encode_line(ptr nocapture readonly %input, i32 %octets, i64 %p) {16entry:17 br i1 undef, label %for.body, label %for.end18 19for.body:20 %indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ %p, %entry ]21 %octets.addr.02 = phi i32 [ undef, %for.inc ], [ %octets, %entry ]22 br i1 false, label %for.inc, label %if.else23 24if.else:25 %cond = icmp eq i32 %octets.addr.02, 226 br i1 %cond, label %if.then84, label %for.end27 28if.then84:29 %0 = add nsw i64 %indvars.iv, 130 %arrayidx101 = getelementptr inbounds i8, ptr %input, i64 %031 store i8 42, ptr %arrayidx101, align 132 br label %for.end33 34for.inc:35 %cmp = icmp sgt i32 %octets.addr.02, 336 %indvars.iv.next = add nsw i64 %indvars.iv, 337 br i1 %cmp, label %for.body, label %for.end38 39for.end:40 ret void41}42 43; AFFINE: Region: %if.else---%for.end44 45; AFFINE: Statements {46; AFFINE-NEXT: Stmt_if_then8447; AFFINE-NEXT: Domain :=48; AFFINE-NEXT: [octets, p_1, p] -> { Stmt_if_then84[] : octets = 2 };49; AFFINE-NEXT: Schedule :=50; AFFINE-NEXT: [octets, p_1, p] -> { Stmt_if_then84[] -> [] };51; AFFINE-NEXT: MustWriteAccess := [Reduction Type: NONE] [Scalar: 0]52; AFFINE-NEXT: [octets, p_1, p] -> { Stmt_if_then84[] -> MemRef_input[1 + p] };53; AFFINE-NEXT: }54 55; NONAFFINE: Region: %for.body---%for.end56 57; NONAFFINE: Statements {58; NONAFFINE-NEXT: Stmt_for_body59; NONAFFINE-NEXT: Domain :=60; NONAFFINE-NEXT: [octets] -> { Stmt_for_body[0] };61; NONAFFINE-NEXT: Schedule :=62; NONAFFINE-NEXT: [octets] -> { Stmt_for_body[i0] -> [0, 0] };63; NONAFFINE-NEXT: MustWriteAccess := [Reduction Type: NONE] [Scalar: 1]64; NONAFFINE-NEXT: [octets] -> { Stmt_for_body[i0] -> MemRef_indvars_iv[] };65; NONAFFINE-NEXT: Stmt_if_then8466; NONAFFINE-NEXT: Domain :=67; NONAFFINE-NEXT: [octets] -> { Stmt_if_then84[] : octets = 2 };68; NONAFFINE-NEXT: Schedule :=69; NONAFFINE-NEXT: [octets] -> { Stmt_if_then84[] -> [1, 0] };70; NONAFFINE-NEXT: ReadAccess := [Reduction Type: NONE] [Scalar: 1]71; NONAFFINE-NEXT: [octets] -> { Stmt_if_then84[] -> MemRef_indvars_iv[] };72; NONAFFINE-NEXT: MayWriteAccess := [Reduction Type: NONE] [Scalar: 0]73; NONAFFINE-NEXT: [octets] -> { Stmt_if_then84[] -> MemRef_input[o0] };74; NONAFFINE-NEXT: }75