93 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, i32 %n) {16entry:17 br label %outer.for18 19outer.for:20 %j = phi i32 [0, %entry], [%j.inc, %for.end]21 %j.cmp = icmp slt i32 %j, %n22 br i1 %j.cmp, label %for.body, label %exit23 24 25 26for.body:27 %indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ %p, %outer.for ]28 %octets.addr.02 = phi i32 [ undef, %for.inc ], [ %octets, %outer.for ]29 br i1 false, label %for.inc, label %if.else30 31if.else:32 %cond = icmp eq i32 %octets.addr.02, 233 br i1 %cond, label %if.then84, label %for.end34 35if.then84:36 %0 = add nsw i64 %indvars.iv, 137 %arrayidx101 = getelementptr inbounds i8, ptr %input, i64 %038 store i8 42, ptr %arrayidx101, align 139 br label %for.end40 41for.inc:42 %cmp = icmp sgt i32 %octets.addr.02, 343 %indvars.iv.next = add nsw i64 %indvars.iv, 344 br i1 %cmp, label %for.body, label %for.end45 46 47 48for.end:49 %j.inc = add nuw nsw i32 %j, 150 br label %outer.for51 52exit:53 br label %return54 55return:56 ret void57}58 59 60; AFFINE: Region: %if.else---%for.end61 62; AFFINE: Statements {63; AFFINE-NEXT: Stmt_if_then8464; AFFINE-NEXT: Domain :=65; AFFINE-NEXT: [octets, p_1, p] -> { Stmt_if_then84[] : octets = 2 };66; AFFINE-NEXT: Schedule :=67; AFFINE-NEXT: [octets, p_1, p] -> { Stmt_if_then84[] -> [] };68; AFFINE-NEXT: MustWriteAccess := [Reduction Type: NONE] [Scalar: 0]69; AFFINE-NEXT: [octets, p_1, p] -> { Stmt_if_then84[] -> MemRef_input[1 + p] };70; AFFINE-NEXT: }71 72 73; NONAFFINE: Region: %outer.for---%return74 75; NONAFFINE: Statements {76; NONAFFINE-NEXT: Stmt_for_body77; NONAFFINE-NEXT: Domain :=78; NONAFFINE-NEXT: [n, octets] -> { Stmt_for_body[i0, 0] : 0 <= i0 < n };79; NONAFFINE-NEXT: Schedule :=80; NONAFFINE-NEXT: [n, octets] -> { Stmt_for_body[i0, i1] -> [i0, 0, 0] };81; NONAFFINE-NEXT: MustWriteAccess := [Reduction Type: NONE] [Scalar: 1]82; NONAFFINE-NEXT: [n, octets] -> { Stmt_for_body[i0, i1] -> MemRef_indvars_iv[] };83; NONAFFINE-NEXT: Stmt_if_then8484; NONAFFINE-NEXT: Domain :=85; NONAFFINE-NEXT: [n, octets] -> { Stmt_if_then84[i0] : octets = 2 and 0 <= i0 < n };86; NONAFFINE-NEXT: Schedule :=87; NONAFFINE-NEXT: [n, octets] -> { Stmt_if_then84[i0] -> [i0, 1, 0] };88; NONAFFINE-NEXT: ReadAccess := [Reduction Type: NONE] [Scalar: 1]89; NONAFFINE-NEXT: [n, octets] -> { Stmt_if_then84[i0] -> MemRef_indvars_iv[] };90; NONAFFINE-NEXT: MayWriteAccess := [Reduction Type: NONE] [Scalar: 0]91; NONAFFINE-NEXT: [n, octets] -> { Stmt_if_then84[i0] -> MemRef_input[o0] };92; NONAFFINE-NEXT: }93