1 ; RUN: opt %loadPolly -basicaa -polly-detect -polly-allow-nonaffine-branches -polly-allow-nonaffine-loops=false -analyze < %s | FileCheck %s --check-prefix=REJECTNONAFFINELOOPS
2 ; RUN: opt %loadPolly -basicaa -polly-detect -polly-allow-nonaffine-branches -polly-allow-nonaffine-loops=true -analyze < %s | FileCheck %s --check-prefix=ALLOWNONAFFINELOOPS
3 ; RUN: opt %loadPolly -basicaa -polly-detect -polly-allow-nonaffine -polly-allow-nonaffine-branches -polly-allow-nonaffine-loops=true -analyze < %s | FileCheck %s --check-prefix=ALLOWNONAFFINELOOPSANDACCESSES
4 ; RUN: opt %loadPolly -basicaa -polly-detect -polly-process-unprofitable=false \
5 ; RUN: -polly-allow-nonaffine -polly-allow-nonaffine-branches \
6 ; RUN: -polly-allow-nonaffine-loops=true -analyze < %s \
7 ; RUN: | FileCheck %s --check-prefix=PROFIT
9 ; Here we have a non-affine loop but also a non-affine access which should
10 ; be rejected as long as -polly-allow-nonaffine isn't given.
12 ; REJECTNONAFFINELOOPS-NOT: Valid
13 ; ALLOWNONAFFINELOOPS-NOT: Valid
14 ; ALLOWNONAFFINELOOPSANDACCESSES: Valid Region for Scop: bb1 => bb13
17 ; void f(int * restrict A, int * restrict C) {
19 ; for (int i = 0; i < 1024; i++) {
25 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
27 define void @f(i32* noalias %A, i32* noalias %C) {
31 bb1: ; preds = %bb12, %bb
32 %indvars.iv = phi i64 [ %indvars.iv.next, %bb12 ], [ 0, %bb ]
33 %exitcond = icmp ne i64 %indvars.iv, 1024
34 br i1 %exitcond, label %bb2, label %bb13
39 bb3: ; preds = %bb6, %bb2
40 %indvars.j = phi i32 [ %tmp4, %bb6 ], [ 0, %bb2 ]
41 %tmp = getelementptr inbounds i32, i32* %C, i32 %indvars.j
42 %tmp4 = load i32, i32* %tmp, align 4
43 %tmp5 = icmp eq i32 %tmp4, 0
44 br i1 %tmp5, label %bb11, label %bb6
47 %tmp7 = sext i32 %tmp4 to i64
48 %tmp8 = getelementptr inbounds i32, i32* %A, i64 %tmp7
49 %tmp9 = load i32, i32* %tmp8, align 4
50 %tmp10 = add nsw i32 %tmp9, 1
51 store i32 %tmp10, i32* %tmp8, align 4
58 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1