brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.9 KiB · 22a60c7 Raw
48 lines · plain
1; RUN: opt %loadNPMPolly '-passes=polly-custom<scops>' -polly-print-detect -polly-print-scops -disable-output < %s 2>&1 | FileCheck %s -check-prefix=NONAFFINE2; RUN: opt %loadNPMPolly '-passes=polly-custom<scops>' -polly-print-detect -polly-print-scops -disable-output -polly-allow-nonaffine-branches=false < %s 2>&1 | FileCheck %s -check-prefix=NO-NONEAFFINE3 4; NONAFFINE-NOT: Statements5 6; NO-NONEAFFINE: Statements {7; NO-NONEAFFINE-NEXT: 	Stmt_then8; NO-NONEAFFINE-NEXT:         Domain :=9; NO-NONEAFFINE-NEXT:             [p_0] -> { Stmt_then[] : p_0 <= -2 or p_0 >= 0 };10; NO-NONEAFFINE-NEXT:         Schedule :=11; NO-NONEAFFINE-NEXT:             [p_0] -> { Stmt_then[] -> [] };12; NO-NONEAFFINE-NEXT:         MustWriteAccess :=	[Reduction Type: NONE] [Scalar: 0]13; NO-NONEAFFINE-NEXT:             [p_0] -> { Stmt_then[] -> MemRef_A[0] };14; NO-NONEAFFINE-NEXT: }15 16; Verify that this test case does not crash -polly-scops. The problem in17; this test case is that the branch instruction in %branch references18; a scalar evolution expression for which no useful value can be computed at the19; location %branch, as the loop %loop does not terminate. At some point, we20; did not identify the branch condition as non-affine during scop detection.21; This test verifies that we either model the branch condition as non-affine22; region (and return an empty scop) or only detect a smaller region if23; non-affine conditions are not allowed.24 25target datalayout = "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128"26target triple = "aarch64--linux-android"27 28define void @f(i16 %event, ptr %A) {29entry:30  br label %loop31 32loop:33  %indvar = phi i8 [ 0, %entry ], [ %indvar.next, %loop ]34  %indvar.next = add i8 %indvar, 135  %cmp = icmp eq i8 %indvar.next, 036  br i1 false, label %branch, label %loop37 38branch:39  br i1 %cmp, label %end, label %then40 41then:42  store float 1.0, ptr %A43  br label %end44 45end:46  ret void47}48