Update Polly tests to handle explicitly typed gep changes in LLVM
[polly-mirror.git] / test / ScopInfo / aliasing_conditional_alias_groups_2.ll
blob76d3cec5d030e9d2d531d261a8c099e1daf0642e
1 ; RUN: opt %loadPolly -polly-detect-unprofitable -polly-code-generator=isl -polly-scops -analyze < %s | FileCheck %s
3 ; Check that we create two alias groups since the mininmal/maximal accesses
4 ; depend on %b.
6 ; CHECK: Alias Groups (2):
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 ;    }
17 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
19 define void @jd(i32 %b, i32* %A, i32* %B) {
20 entry:
21   br label %for.cond
23 for.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
28 for.body:                                         ; preds = %for.cond
29   %tobool = icmp eq i32 %b, 0
30   br i1 %tobool, label %if.else, label %if.then
32 if.then:                                          ; preds = %for.body
33   %arrayidx = getelementptr inbounds i32, i32* %B, i64 5
34   %tmp = load 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
39 if.else:                                          ; preds = %for.body
40   %arrayidx2 = getelementptr inbounds i32, i32* %A, i64 7
41   %tmp1 = load 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
46 if.end:                                           ; preds = %if.else, %if.then
47   br label %for.inc
49 for.inc:                                          ; preds = %if.end
50   %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
51   br label %for.cond
53 for.end:                                          ; preds = %for.cond
54   ret void