1 ; RUN: opt %loadPolly -polly-scops -analyze < %s | \
2 ; RUN: FileCheck %s -check-prefix=NONAFFINE
3 ; RUN: opt %loadPolly -polly-scops -analyze \
4 ; RUN: -polly-allow-nonaffine-branches=false < %s | \
5 ; RUN: FileCheck %s -check-prefix=NO-NONEAFFINE
7 ; NONAFFINE-NOT: Statements
9 ; NO-NONEAFFINE: Statements {
10 ; NO-NONEAFFINE-NEXT: Stmt_then
11 ; NO-NONEAFFINE-NEXT: Domain :=
12 ; NO-NONEAFFINE-NEXT: [p_0] -> { Stmt_then[] : p_0 <= -2 or p_0 >= 0 };
13 ; NO-NONEAFFINE-NEXT: Schedule :=
14 ; NO-NONEAFFINE-NEXT: [p_0] -> { Stmt_then[] -> [] };
15 ; NO-NONEAFFINE-NEXT: MustWriteAccess := [Reduction Type: NONE] [Scalar: 0]
16 ; NO-NONEAFFINE-NEXT: [p_0] -> { Stmt_then[] -> MemRef_A[0] };
17 ; NO-NONEAFFINE-NEXT: }
19 ; Verify that this test case does not crash -polly-scops. The problem in
20 ; this test case is that the branch instruction in %branch references
21 ; a scalar evolution expression for which no useful value can be computed at the
22 ; location %branch, as the loop %loop does not terminate. At some point, we
23 ; did not identify the branch condition as non-affine during scop detection.
24 ; This test verifies that we either model the branch condition as non-affine
25 ; region (and return an empty scop) or only detect a smaller region if
26 ; non-affine conditions are not allowed.
28 target datalayout = "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128"
29 target triple = "aarch64--linux-android"
31 define void @f(i16 %event, float* %A) {
36 %indvar = phi i8 [ 0, %entry ], [ %indvar.next, %loop ]
37 %indvar.next = add i8 %indvar, 1
38 %cmp = icmp eq i8 %indvar.next, 0
39 br i1 false, label %branch, label %loop
42 br i1 %cmp, label %end, label %then
45 store float 1.0, float* %A