1 ; RUN: opt %loadPolly -polly-detect-unprofitable -polly-code-generator=isl -polly-ast -analyze -polly-no-early-exit < %s | FileCheck %s --check-prefix=NOAA
2 ; RUN: opt %loadPolly -polly-detect-unprofitable -polly-code-generator=isl -polly-ast -analyze -polly-no-early-exit -basicaa < %s | FileCheck %s --check-prefix=BASI
3 ; RUN: opt %loadPolly -polly-detect-unprofitable -polly-code-generator=isl -polly-ast -analyze -polly-no-early-exit -tbaa < %s | FileCheck %s --check-prefix=TBAA
4 ; RUN: opt %loadPolly -polly-detect-unprofitable -polly-code-generator=isl -polly-ast -analyze -polly-no-early-exit -scev-aa < %s | FileCheck %s --check-prefix=SCEV
5 ; RUN: opt %loadPolly -polly-detect-unprofitable -polly-code-generator=isl -polly-ast -analyze -polly-no-early-exit -globalsmodref-aa < %s | FileCheck %s --check-prefix=GLOB
7 ; int A[1024], B[1024];
11 ; for (int i = 0; i < N; i++)
15 ; NOAA: if (N <= 1024 && (&MemRef_A[N] <= &MemRef_B[0] || &MemRef_B[N] <= &MemRef_A[0]))
16 ; BASI: if (N <= 1024)
17 ; TBAA: if (N <= 1024 && (&MemRef_A[N] <= &MemRef_B[0] || &MemRef_B[N] <= &MemRef_A[0]))
18 ; SCEV: if (N <= 1024 && (&MemRef_A[N] <= &MemRef_B[0] || &MemRef_B[N] <= &MemRef_A[0]))
19 ; GLOB: if (N <= 1024 && (&MemRef_A[N] <= &MemRef_B[0] || &MemRef_B[N] <= &MemRef_A[0]))
21 target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
23 @A = common global [1024 x i32] zeroinitializer, align 16
24 @B = common global [1024 x i32] zeroinitializer, align 16
26 define void @jd(i32 %N) {
28 %cmp6 = icmp sgt i32 %N, 0
29 br i1 %cmp6, label %for.body.preheader, label %for.end
31 for.body.preheader: ; preds = %entry
34 for.body: ; preds = %for.body.preheader, %for.body
35 %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %for.body.preheader ]
36 %arrayidx = getelementptr inbounds [1024 x i32], [1024 x i32]* @B, i64 0, i64 %indvars.iv
37 %tmp = load i32* %arrayidx, align 4, !tbaa !5
38 %arrayidx2 = getelementptr inbounds [1024 x i32], [1024 x i32]* @A, i64 0, i64 %indvars.iv
39 store i32 %tmp, i32* %arrayidx2, align 4, !tbaa !5
40 %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
41 %lftr.wideiv1 = trunc i64 %indvars.iv.next to i32
42 %exitcond2 = icmp eq i32 %lftr.wideiv1, %N
43 br i1 %exitcond2, label %for.end.loopexit, label %for.body
45 for.end.loopexit: ; preds = %for.body
48 for.end: ; preds = %for.end.loopexit, %entry
54 !2 = !{!"float", !3, i64 0}
55 !3 = !{!"omnipotent char", !4, i64 0}
56 !4 = !{!"Simple C/C++ TBAA"}
58 !6 = !{!"int", !3, i64 0}