1 ; RUN: opt %loadNPMPolly -polly-allow-nonaffine -S < %s 2>&1 | FileCheck %s --check-prefix=CODE
2 ; RUN: opt %loadNPMPolly -polly-allow-nonaffine '-passes=print<polly-function-scops>' -disable-output < %s 2>&1 | FileCheck %s
4 ; Verify there is a phi in the non-affine region but it is not represented in
5 ; the SCoP as all operands as well as the uses are inside the region too.
8 ; for (int i = 0; i < 1024; i++) {
19 ; CODE: %x.0 = phi i32
21 ; We have 3 accesses to A that should be present in the SCoP but no scalar access.
23 ; CHECK-NOT: [Scalar: 1]
25 ; CHECK-NOT: [Scalar: 1]
27 ; CHECK-NOT: [Scalar: 1]
29 ; CHECK-NOT: [Scalar: 1]
31 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
33 define void @f(ptr %A) {
37 bb1: ; preds = %bb14, %bb
38 %indvars.iv = phi i64 [ %indvars.iv.next, %bb14 ], [ 0, %bb ]
39 %exitcond = icmp ne i64 %indvars.iv, 1024
40 br i1 %exitcond, label %bb2, label %bb15
43 %tmp = getelementptr inbounds i32, ptr %A, i64 %indvars.iv
44 %tmp3 = load i32, ptr %tmp, align 4
45 %tmp4 = icmp eq i32 %tmp3, 0
46 br i1 %tmp4, label %bb13, label %bb5
49 %tmp6 = icmp sgt i64 %indvars.iv, 512
50 br i1 %tmp6, label %bb7, label %bb11
53 %tmp8 = getelementptr inbounds i32, ptr %A, i64 %indvars.iv
54 %tmp9 = load i32, ptr %tmp8, align 4
55 %tmp10 = add nsw i32 %tmp9, 1
58 bb11: ; preds = %bb7, %bb5
59 %x.0 = phi i32 [ %tmp10, %bb7 ], [ 0, %bb5 ]
60 %tmp12 = getelementptr inbounds i32, ptr %A, i64 %indvars.iv
61 store i32 %x.0, ptr %tmp12, align 4
64 bb13: ; preds = %bb2, %bb11
68 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1