1; RUN: opt %loadPolly -polly-scops \
2; RUN:                -analyze < %s | FileCheck %s
3;
4; Check that we do not generate any scalar dependences regarding x. It is
5; defined and used on the non-affine subregion only, thus we do not need
6; to represent the definition and uses in the model.
7;
8; CHECK:          Stmt_bb2__TO__bb11
9; CHECK-NOT:        [Scalar: 1]
10; CHECK-NOT:        MemRef_x
11;
12;    void f(int *A) {
13;      int x;
14;      for (int i = 0; i < 1024; i++) {
15;        if (A[i]) {
16;          if (i > 512)
17;            x = 1;
18;          else
19;            x = 2;
20;          A[i] = x;
21;        }
22;      }
23;    }
24;
25target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
26
27define void @f(i32* %A) {
28bb:
29  br label %bb1
30
31bb1:                                              ; 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
35
36bb2:                                              ; preds = %bb1
37  %tmp = getelementptr inbounds i32, i32* %A, i64 %indvars.iv
38  %tmp3 = load i32,  i32* %tmp, align 4
39  %tmp4 = icmp eq i32 %tmp3, 0
40  br i1 %tmp4, label %bb11, label %bb5
41
42bb5:                                              ; preds = %bb2
43  %tmp6 = icmp sgt i64 %indvars.iv, 512
44  br i1 %tmp6, label %bb7, label %bb8
45
46bb7:                                              ; preds = %bb5
47  br label %bb9
48
49bb8:                                              ; preds = %bb5
50  br label %bb9
51
52bb9:                                              ; preds = %bb8, %bb7
53  %x.0 = phi i32 [ 1, %bb7 ], [ 2, %bb8 ]
54  %tmp10 = getelementptr inbounds i32, i32* %A, i64 %indvars.iv
55  store i32 %x.0, i32* %tmp10, align 4
56  br label %bb11
57
58bb11:                                             ; preds = %bb2, %bb9
59  br label %bb12
60
61bb12:                                             ; preds = %bb11
62  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
63  br label %bb1
64
65bb13:                                             ; preds = %bb1
66  ret void
67}
68