1; RUN: opt %loadPolly -polly-scops -analyze < %s | FileCheck %s
2;
3; Check that we create two alias groups since the mininmal/maximal accesses
4; depend on %b.
5;
6; CHECK: Alias Groups (2):
7;
8;    void jd(int b, int *A, int *B) {
9;      for (int i = 0; i < 1024; i++) {
10;        if (b)
11;          A[i] = B[5];
12;        else
13;          B[i] = A[7];
14;      }
15;    }
16;
17target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
18
19define void @jd(i32 %b, i32* %A, i32* %B) {
20entry:
21  br label %for.cond
22
23for.cond:                                         ; preds = %for.inc, %entry
24  %indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 0, %entry ]
25  %exitcond = icmp ne i64 %indvars.iv, 1024
26  br i1 %exitcond, label %for.body, label %for.end
27
28for.body:                                         ; preds = %for.cond
29  %tobool = icmp eq i32 %b, 0
30  br i1 %tobool, label %if.else, label %if.then
31
32if.then:                                          ; preds = %for.body
33  %arrayidx = getelementptr inbounds i32, i32* %B, i64 5
34  %tmp = load i32, i32* %arrayidx, align 4
35  %arrayidx1 = getelementptr inbounds i32, i32* %A, i64 %indvars.iv
36  store i32 %tmp, i32* %arrayidx1, align 4
37  br label %if.end
38
39if.else:                                          ; preds = %for.body
40  %arrayidx2 = getelementptr inbounds i32, i32* %A, i64 7
41  %tmp1 = load i32, i32* %arrayidx2, align 4
42  %arrayidx4 = getelementptr inbounds i32, i32* %B, i64 %indvars.iv
43  store i32 %tmp1, i32* %arrayidx4, align 4
44  br label %if.end
45
46if.end:                                           ; preds = %if.else, %if.then
47  br label %for.inc
48
49for.inc:                                          ; preds = %if.end
50  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
51  br label %for.cond
52
53for.end:                                          ; preds = %for.cond
54  ret void
55}
56