[polly] r218047 - [RTC] Runtime Alias Checks for the ISL backend (missing tests)
Johannes Doerfert
doerfert at cs.uni-saarland.de
Thu Sep 18 04:20:37 PDT 2014
Author: jdoerfert
Date: Thu Sep 18 06:20:36 2014
New Revision: 218047
URL: http://llvm.org/viewvc/llvm-project?rev=218047&view=rev
Log:
[RTC] Runtime Alias Checks for the ISL backend (missing tests)
Test files missing in r218046.
Added:
polly/trunk/test/Isl/Ast/alias_simple_1.ll
polly/trunk/test/Isl/Ast/alias_simple_2.ll
polly/trunk/test/Isl/Ast/alias_simple_3.ll
polly/trunk/test/Isl/Ast/aliasing_multiple_alias_groups.ll
polly/trunk/test/Isl/Ast/aliasing_parametric_simple_1.ll
polly/trunk/test/Isl/Ast/aliasing_parametric_simple_2.ll
polly/trunk/test/Isl/CodeGen/MemAccess/codegen_simple_float.ll
polly/trunk/test/Isl/CodeGen/MemAccess/codegen_simple_md_float.ll
polly/trunk/test/Isl/CodeGen/MemAccess/simple___%for.cond---%for.end14.jscop
polly/trunk/test/Isl/CodeGen/MemAccess/simple___%for.cond---%for.end14.jscop.transformed
polly/trunk/test/Isl/CodeGen/aliasing_parametric_simple_1.ll
polly/trunk/test/Isl/CodeGen/aliasing_parametric_simple_2.ll
polly/trunk/test/ScopDetect/aliasing_parametric_simple_1.ll
polly/trunk/test/ScopDetect/aliasing_parametric_simple_2.ll
polly/trunk/test/ScopDetect/aliasing_simple_1.ll
polly/trunk/test/ScopDetect/aliasing_simple_2.ll
polly/trunk/test/ScopInfo/aliasing_multiple_alias_groups.ll
Added: polly/trunk/test/Isl/Ast/alias_simple_1.ll
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/test/Isl/Ast/alias_simple_1.ll?rev=218047&view=auto
==============================================================================
--- polly/trunk/test/Isl/Ast/alias_simple_1.ll (added)
+++ polly/trunk/test/Isl/Ast/alias_simple_1.ll Thu Sep 18 06:20:36 2014
@@ -0,0 +1,58 @@
+; RUN: opt %loadPolly -polly-code-generator=isl -polly-ast -analyze < %s | FileCheck %s --check-prefix=NOAA
+; RUN: opt %loadPolly -polly-code-generator=isl -polly-ast -analyze -basicaa < %s | FileCheck %s --check-prefix=BASI
+; RUN: opt %loadPolly -polly-code-generator=isl -polly-ast -analyze -tbaa < %s | FileCheck %s --check-prefix=TBAA
+; RUN: opt %loadPolly -polly-code-generator=isl -polly-ast -analyze -scev-aa < %s | FileCheck %s --check-prefix=SCEV
+; RUN: opt %loadPolly -polly-code-generator=isl -polly-ast -analyze -globalsmodref-aa < %s | FileCheck %s --check-prefix=GLOB
+;
+; int A[1024];
+;
+;
+; void jd(float *B, int N) {
+; for (int i = 0; i < N; i++)
+; A[i] = B[i];
+; }
+;
+; NOAA: if (1 && (&MemRef_A[N] <= &MemRef_B[0] || &MemRef_B[N] <= &MemRef_A[0]))
+; BASI: if (1 && (&MemRef_A[N] <= &MemRef_B[0] || &MemRef_B[N] <= &MemRef_A[0]))
+; TBAA: if (1)
+; SCEV: if (1 && (&MemRef_A[N] <= &MemRef_B[0] || &MemRef_B[N] <= &MemRef_A[0]))
+; GLOB: if (1 && (&MemRef_A[N] <= &MemRef_B[0] || &MemRef_B[N] <= &MemRef_A[0]))
+;
+target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
+
+ at A = common global [1024 x i32] zeroinitializer, align 16
+
+define void @jd(float* nocapture readonly %B, i32 %N) {
+entry:
+ %cmp6 = icmp sgt i32 %N, 0
+ br i1 %cmp6, label %for.body.preheader, label %for.end
+
+for.body.preheader: ; preds = %entry
+ br label %for.body
+
+for.body: ; preds = %for.body.preheader, %for.body
+ %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %for.body.preheader ]
+ %arrayidx = getelementptr inbounds float* %B, i64 %indvars.iv
+ %tmp = load float* %arrayidx, align 4, !tbaa !1
+ %conv = fptosi float %tmp to i32
+ %arrayidx2 = getelementptr inbounds [1024 x i32]* @A, i64 0, i64 %indvars.iv
+ store i32 %conv, i32* %arrayidx2, align 4, !tbaa !5
+ %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
+ %lftr.wideiv1 = trunc i64 %indvars.iv.next to i32
+ %exitcond2 = icmp eq i32 %lftr.wideiv1, %N
+ br i1 %exitcond2, label %for.end.loopexit, label %for.body
+
+for.end.loopexit: ; preds = %for.body
+ br label %for.end
+
+for.end: ; preds = %for.end.loopexit, %entry
+ ret void
+}
+
+!0 = metadata !{metadata !""}
+!1 = metadata !{metadata !2, metadata !2, i64 0}
+!2 = metadata !{metadata !"float", metadata !3, i64 0}
+!3 = metadata !{metadata !"omnipotent char", metadata !4, i64 0}
+!4 = metadata !{metadata !"Simple C/C++ TBAA"}
+!5 = metadata !{metadata !6, metadata !6, i64 0}
+!6 = metadata !{metadata !"int", metadata !3, i64 0}
Added: polly/trunk/test/Isl/Ast/alias_simple_2.ll
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/test/Isl/Ast/alias_simple_2.ll?rev=218047&view=auto
==============================================================================
--- polly/trunk/test/Isl/Ast/alias_simple_2.ll (added)
+++ polly/trunk/test/Isl/Ast/alias_simple_2.ll Thu Sep 18 06:20:36 2014
@@ -0,0 +1,58 @@
+; RUN: opt %loadPolly -polly-code-generator=isl -polly-ast -analyze < %s | FileCheck %s --check-prefix=NOAA
+; RUN: opt %loadPolly -polly-code-generator=isl -polly-ast -analyze -basicaa < %s | FileCheck %s --check-prefix=BASI
+; RUN: opt %loadPolly -polly-code-generator=isl -polly-ast -analyze -tbaa < %s | FileCheck %s --check-prefix=TBAA
+; RUN: opt %loadPolly -polly-code-generator=isl -polly-ast -analyze -scev-aa < %s | FileCheck %s --check-prefix=SCEV
+; RUN: opt %loadPolly -polly-code-generator=isl -polly-ast -analyze -globalsmodref-aa < %s | FileCheck %s --check-prefix=GLOB
+;
+; int A[1024], B[1024];
+;
+;
+; void jd(int N) {
+; for (int i = 0; i < N; i++)
+; A[i] = B[i];
+; }
+;
+; NOAA: if (1 && (&MemRef_A[N] <= &MemRef_B[0] || &MemRef_B[N] <= &MemRef_A[0]))
+; BASI: if (1)
+; TBAA: if (1 && (&MemRef_A[N] <= &MemRef_B[0] || &MemRef_B[N] <= &MemRef_A[0]))
+; SCEV: if (1 && (&MemRef_A[N] <= &MemRef_B[0] || &MemRef_B[N] <= &MemRef_A[0]))
+; GLOB: if (1 && (&MemRef_A[N] <= &MemRef_B[0] || &MemRef_B[N] <= &MemRef_A[0]))
+;
+target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
+
+ at A = common global [1024 x i32] zeroinitializer, align 16
+ at B = common global [1024 x i32] zeroinitializer, align 16
+
+define void @jd(i32 %N) {
+entry:
+ %cmp6 = icmp sgt i32 %N, 0
+ br i1 %cmp6, label %for.body.preheader, label %for.end
+
+for.body.preheader: ; preds = %entry
+ br label %for.body
+
+for.body: ; preds = %for.body.preheader, %for.body
+ %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %for.body.preheader ]
+ %arrayidx = getelementptr inbounds [1024 x i32]* @B, i64 0, i64 %indvars.iv
+ %tmp = load i32* %arrayidx, align 4, !tbaa !5
+ %arrayidx2 = getelementptr inbounds [1024 x i32]* @A, i64 0, i64 %indvars.iv
+ store i32 %tmp, i32* %arrayidx2, align 4, !tbaa !5
+ %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
+ %lftr.wideiv1 = trunc i64 %indvars.iv.next to i32
+ %exitcond2 = icmp eq i32 %lftr.wideiv1, %N
+ br i1 %exitcond2, label %for.end.loopexit, label %for.body
+
+for.end.loopexit: ; preds = %for.body
+ br label %for.end
+
+for.end: ; preds = %for.end.loopexit, %entry
+ ret void
+}
+
+!0 = metadata !{metadata !""}
+!1 = metadata !{metadata !2, metadata !2, i64 0}
+!2 = metadata !{metadata !"float", metadata !3, i64 0}
+!3 = metadata !{metadata !"omnipotent char", metadata !4, i64 0}
+!4 = metadata !{metadata !"Simple C/C++ TBAA"}
+!5 = metadata !{metadata !6, metadata !6, i64 0}
+!6 = metadata !{metadata !"int", metadata !3, i64 0}
Added: polly/trunk/test/Isl/Ast/alias_simple_3.ll
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/test/Isl/Ast/alias_simple_3.ll?rev=218047&view=auto
==============================================================================
--- polly/trunk/test/Isl/Ast/alias_simple_3.ll (added)
+++ polly/trunk/test/Isl/Ast/alias_simple_3.ll Thu Sep 18 06:20:36 2014
@@ -0,0 +1,59 @@
+; RUN: opt %loadPolly -polly-code-generator=isl -polly-ast -analyze < %s | FileCheck %s --check-prefix=NOAA
+; RUN: opt %loadPolly -polly-code-generator=isl -polly-ast -analyze -basicaa < %s | FileCheck %s --check-prefix=BASI
+; RUN: opt %loadPolly -polly-code-generator=isl -polly-ast -analyze -tbaa < %s | FileCheck %s --check-prefix=TBAA
+; RUN: opt %loadPolly -polly-code-generator=isl -polly-ast -analyze -scev-aa < %s | FileCheck %s --check-prefix=SCEV
+; RUN: opt %loadPolly -polly-code-generator=isl -polly-ast -analyze -globalsmodref-aa < %s | FileCheck %s --check-prefix=GLOB
+;
+; int A[1024];
+; float B[1024];
+;
+; void jd(int N) {
+; for (int i = 0; i < N; i++)
+; A[i] = B[i];
+; }
+;
+; NOAA: if (1 && (&MemRef_A[N] <= &MemRef_B[0] || &MemRef_B[N] <= &MemRef_A[0]))
+; BASI: if (1)
+; TBAA: if (1)
+; SCEV: if (1 && (&MemRef_A[N] <= &MemRef_B[0] || &MemRef_B[N] <= &MemRef_A[0]))
+; GLOB: if (1 && (&MemRef_A[N] <= &MemRef_B[0] || &MemRef_B[N] <= &MemRef_A[0]))
+;
+target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
+
+ at A = common global [1024 x i32] zeroinitializer, align 16
+ at B = common global [1024 x float] zeroinitializer, align 16
+
+define void @jd(i32 %N) {
+entry:
+ %cmp6 = icmp sgt i32 %N, 0
+ br i1 %cmp6, label %for.body.preheader, label %for.end
+
+for.body.preheader: ; preds = %entry
+ br label %for.body
+
+for.body: ; preds = %for.body.preheader, %for.body
+ %indvars.iv = phi i64 [ %indvars.iv.next, %for.body ], [ 0, %for.body.preheader ]
+ %arrayidx = getelementptr inbounds [1024 x float]* @B, i64 0, i64 %indvars.iv
+ %tmp = load float* %arrayidx, align 4, !tbaa !1
+ %conv = fptosi float %tmp to i32
+ %arrayidx2 = getelementptr inbounds [1024 x i32]* @A, i64 0, i64 %indvars.iv
+ store i32 %conv, i32* %arrayidx2, align 4, !tbaa !5
+ %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
+ %lftr.wideiv1 = trunc i64 %indvars.iv.next to i32
+ %exitcond2 = icmp eq i32 %lftr.wideiv1, %N
+ br i1 %exitcond2, label %for.end.loopexit, label %for.body
+
+for.end.loopexit: ; preds = %for.body
+ br label %for.end
+
+for.end: ; preds = %for.end.loopexit, %entry
+ ret void
+}
+
+!0 = metadata !{metadata !""}
+!1 = metadata !{metadata !2, metadata !2, i64 0}
+!2 = metadata !{metadata !"float", metadata !3, i64 0}
+!3 = metadata !{metadata !"omnipotent char", metadata !4, i64 0}
+!4 = metadata !{metadata !"Simple C/C++ TBAA"}
+!5 = metadata !{metadata !6, metadata !6, i64 0}
+!6 = metadata !{metadata !"int", metadata !3, i64 0}
Added: polly/trunk/test/Isl/Ast/aliasing_multiple_alias_groups.ll
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/test/Isl/Ast/aliasing_multiple_alias_groups.ll?rev=218047&view=auto
==============================================================================
--- polly/trunk/test/Isl/Ast/aliasing_multiple_alias_groups.ll (added)
+++ polly/trunk/test/Isl/Ast/aliasing_multiple_alias_groups.ll Thu Sep 18 06:20:36 2014
@@ -0,0 +1,54 @@
+; RUN: opt %loadPolly -polly-code-generator=isl -polly-ast -analyze < %s | FileCheck %s --check-prefix=NOAA
+; RUN: opt %loadPolly -polly-code-generator=isl -polly-ast -analyze -tbaa < %s | FileCheck %s --check-prefix=TBAA
+;
+; void jd(int *Int0, int *Int1, float *Float0, float *Float1) {
+; for (int i = 0; i < 1024; i++) {
+; Int0[i] = Int1[i];
+; Float0[i] = Float1[i];
+; }
+; }
+;
+; NOAA: if (1 && (
+; NOAA-DAG: &MemRef_Float0[1024] <= &MemRef_Int0[0] || &MemRef_Int0[1024] <= &MemRef_Float0[0]
+; NOAA-DAG: &MemRef_Float1[1024] <= &MemRef_Int0[0] || &MemRef_Int0[1024] <= &MemRef_Float1[0]
+; NOAA-DAG: &MemRef_Int1[1024] <= &MemRef_Int0[0] || &MemRef_Int0[1024] <= &MemRef_Int1[0]
+; NOAA-DAG: &MemRef_Float1[1024] <= &MemRef_Float0[0] || &MemRef_Float0[1024] <= &MemRef_Float1[0]
+; NOAA-DAG: &MemRef_Int1[1024] <= &MemRef_Float0[0] || &MemRef_Float0[1024] <= &MemRef_Int1[0]
+; NOAA-DAG: &MemRef_Int1[1024] <= &MemRef_Float1[0] || &MemRef_Float1[1024] <= &MemRef_Int1[0]
+; NOAA: ))
+;
+; TBAA: if (1 && (
+; TBAA-DAG: &MemRef_Int0[1024] <= &MemRef_Int1[0] || &MemRef_Int1[1024] <= &MemRef_Int0[0]
+; TBAA-DAG: &MemRef_Float1[1024] <= &MemRef_Float0[0] || &MemRef_Float0[1024] <= &MemRef_Float1[0]
+; TBAA: ))
+;
+target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
+
+define void @jd(i32* nocapture %Int0, i32* nocapture readonly %Int1, float* nocapture %Float0, float* nocapture readonly %Float1) {
+entry:
+ br label %for.body
+
+for.body: ; preds = %for.body, %entry
+ %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ]
+ %arrayidx = getelementptr inbounds i32* %Int1, i64 %indvars.iv
+ %tmp = load i32* %arrayidx, align 4, !tbaa !0
+ %arrayidx2 = getelementptr inbounds i32* %Int0, i64 %indvars.iv
+ store i32 %tmp, i32* %arrayidx2, align 4, !tbaa !0
+ %arrayidx4 = getelementptr inbounds float* %Float1, i64 %indvars.iv
+ %tmp1 = load float* %arrayidx4, align 4, !tbaa !4
+ %arrayidx6 = getelementptr inbounds float* %Float0, i64 %indvars.iv
+ store float %tmp1, float* %arrayidx6, align 4, !tbaa !4
+ %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
+ %exitcond = icmp eq i64 %indvars.iv.next, 1024
+ br i1 %exitcond, label %for.end, label %for.body
+
+for.end: ; preds = %for.body
+ ret void
+}
+
+!0 = metadata !{metadata !1, metadata !1, i64 0}
+!1 = metadata !{metadata !"int", metadata !2, i64 0}
+!2 = metadata !{metadata !"omnipotent char", metadata !3, i64 0}
+!3 = metadata !{metadata !"Simple C/C++ TBAA"}
+!4 = metadata !{metadata !5, metadata !5, i64 0}
+!5 = metadata !{metadata !"float", metadata !2, i64 0}
Added: polly/trunk/test/Isl/Ast/aliasing_parametric_simple_1.ll
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/test/Isl/Ast/aliasing_parametric_simple_1.ll?rev=218047&view=auto
==============================================================================
--- polly/trunk/test/Isl/Ast/aliasing_parametric_simple_1.ll (added)
+++ polly/trunk/test/Isl/Ast/aliasing_parametric_simple_1.ll Thu Sep 18 06:20:36 2014
@@ -0,0 +1,39 @@
+; RUN: opt %loadPolly -polly-code-generator=isl -polly-ast -analyze %s | FileCheck %s
+;
+; void jd(int *A, int *B, int c) {
+; for (int i = 0; i < 1024; i++)
+; A[i] = B[c];
+; }
+;
+; CHECK: if (1 && (&MemRef_A[1024] <= &MemRef_B[c] || &MemRef_B[c + 1] <= &MemRef_A[0]))
+; CHECK: for (int c1 = 0; c1 <= 1023; c1 += 1)
+; CHECK: Stmt_for_body(c1);
+; CHECK: else
+; CHECK: /* original code */
+;
+target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
+
+define void @jd(i32* %A, i32* %B, i32 %c) {
+entry:
+ br label %for.cond
+
+for.cond: ; preds = %for.inc, %entry
+ %indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 0, %entry ]
+ %exitcond = icmp ne i64 %indvars.iv, 1024
+ br i1 %exitcond, label %for.body, label %for.end
+
+for.body: ; preds = %for.cond
+ %idxprom = sext i32 %c to i64
+ %arrayidx = getelementptr inbounds i32* %B, i64 %idxprom
+ %tmp = load i32* %arrayidx, align 4
+ %arrayidx2 = getelementptr inbounds i32* %A, i64 %indvars.iv
+ store i32 %tmp, i32* %arrayidx2, align 4
+ br label %for.inc
+
+for.inc: ; preds = %for.body
+ %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
+ br label %for.cond
+
+for.end: ; preds = %for.cond
+ ret void
+}
Added: polly/trunk/test/Isl/Ast/aliasing_parametric_simple_2.ll
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/test/Isl/Ast/aliasing_parametric_simple_2.ll?rev=218047&view=auto
==============================================================================
--- polly/trunk/test/Isl/Ast/aliasing_parametric_simple_2.ll (added)
+++ polly/trunk/test/Isl/Ast/aliasing_parametric_simple_2.ll Thu Sep 18 06:20:36 2014
@@ -0,0 +1,43 @@
+; RUN: opt %loadPolly -polly-code-generator=isl -polly-ast -analyze < %s | FileCheck %s
+;
+; void jd(int *A, int *B, int c) {
+; for (int i = 0; i < 1024; i++)
+; A[i] = B[c - 10] + B[5];
+; }
+;
+; CHECK: if (1 && (&MemRef_A[1024] <= &MemRef_B[c >= 15 ? 5 : c - 10] || &MemRef_B[c <= 15 ? 6 : c - 9] <= &MemRef_A[0]))
+; CHECK: for (int c1 = 0; c1 <= 1023; c1 += 1)
+; CHECK: Stmt_for_body(c1);
+; CHECK: else
+; CHECK: /* original code */
+;
+target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
+
+define void @jd(i32* %A, i32* %B, i32 %c) {
+entry:
+ br label %for.cond
+
+for.cond: ; preds = %for.inc, %entry
+ %indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 0, %entry ]
+ %exitcond = icmp ne i64 %indvars.iv, 1024
+ br i1 %exitcond, label %for.body, label %for.end
+
+for.body: ; preds = %for.cond
+ %sub = add nsw i32 %c, -10
+ %idxprom = sext i32 %sub to i64
+ %arrayidx = getelementptr inbounds i32* %B, i64 %idxprom
+ %tmp = load i32* %arrayidx, align 4
+ %arrayidx1 = getelementptr inbounds i32* %B, i64 5
+ %tmp1 = load i32* %arrayidx1, align 4
+ %add = add nsw i32 %tmp, %tmp1
+ %arrayidx3 = getelementptr inbounds i32* %A, i64 %indvars.iv
+ store i32 %add, i32* %arrayidx3, align 4
+ br label %for.inc
+
+for.inc: ; preds = %for.body
+ %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
+ br label %for.cond
+
+for.end: ; preds = %for.cond
+ ret void
+}
Added: polly/trunk/test/Isl/CodeGen/MemAccess/codegen_simple_float.ll
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/test/Isl/CodeGen/MemAccess/codegen_simple_float.ll?rev=218047&view=auto
==============================================================================
--- polly/trunk/test/Isl/CodeGen/MemAccess/codegen_simple_float.ll (added)
+++ polly/trunk/test/Isl/CodeGen/MemAccess/codegen_simple_float.ll Thu Sep 18 06:20:36 2014
@@ -0,0 +1,41 @@
+;RUN: opt %loadPolly -polly-import-jscop -polly-import-jscop-dir=%S -polly-import-jscop-postfix=transformed -polly-codegen-isl -instnamer < %s -S | FileCheck %s
+;
+;float A[100];
+;
+;int codegen_simple () {
+; for (int i = 0; i < 12; i++)
+; A[13] = A[i] + A[i-1];
+;
+; return 0;
+;}
+target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:32:32-n8:16:32"
+
+ at A = common global [100 x float] zeroinitializer, align 4
+
+define i32 @codegen_simple() nounwind {
+entry:
+ br label %for.cond
+
+for.cond: ; preds = %for.inc, %entry
+ %tmp1 = phi i32 [ 0, %entry ], [ %inc, %for.inc ]
+ %tmp = add i32 %tmp1, -1
+ %arrayidx4 = getelementptr [100 x float]* @A, i32 0, i32 %tmp
+ %arrayidx = getelementptr [100 x float]* @A, i32 0, i32 %tmp1
+ %exitcond = icmp ne i32 %tmp1, 12
+ br i1 %exitcond, label %for.body, label %for.end
+
+for.body: ; preds = %for.cond
+ %tmp2 = load float* %arrayidx, align 4
+ %tmp5 = load float* %arrayidx4, align 4
+ %add = fadd float %tmp2, %tmp5
+ store float %add, float* getelementptr inbounds ([100 x float]* @A, i32 0, i32 13), align 4
+ br label %for.inc
+
+for.inc: ; preds = %for.body
+ %inc = add nsw i32 %tmp1, 1
+ br label %for.cond
+
+for.end: ; preds = %for.cond
+ ret i32 0
+}
+; CHECK: load float* getelementptr inbounds ([100 x float]* @A, i64 0, i64 0)
Added: polly/trunk/test/Isl/CodeGen/MemAccess/codegen_simple_md_float.ll
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/test/Isl/CodeGen/MemAccess/codegen_simple_md_float.ll?rev=218047&view=auto
==============================================================================
--- polly/trunk/test/Isl/CodeGen/MemAccess/codegen_simple_md_float.ll (added)
+++ polly/trunk/test/Isl/CodeGen/MemAccess/codegen_simple_md_float.ll Thu Sep 18 06:20:36 2014
@@ -0,0 +1,71 @@
+;RUN: opt %loadPolly -polly-import-jscop -polly-import-jscop-dir=%S -polly-import-jscop-postfix=transformed+withconst -polly-codegen-isl < %s -S | FileCheck -check-prefix=WITHCONST %s
+;RUN: opt %loadPolly -polly-import-jscop -polly-import-jscop-dir=%S -polly-import-jscop-postfix=transformed+withoutconst -polly-codegen-isl < %s -S | FileCheck -check-prefix=WITHOUTCONST %s
+;RUN: opt %loadPolly -polly-import-jscop -polly-import-jscop-dir=%S -polly-import-jscop-postfix=transformed+withconst -polly-codegen-isl -polly-codegen-scev < %s -S | FileCheck -check-prefix=WITHCONST %s
+;RUN: opt %loadPolly -polly-import-jscop -polly-import-jscop-dir=%S -polly-import-jscop-postfix=transformed+withoutconst -polly-codegen-isl -polly-codegen-scev < %s -S | FileCheck -check-prefix=WITHOUTCONST %s
+;
+;float A[1040];
+;
+;int codegen_simple_md() {
+; for (int i = 0; i < 32; ++i)
+; for (int j = 0; j < 32; ++j)
+; A[32*i+j] = 100;
+;}
+target datalayout = "e-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f80:32:32-n8:16:32-S128"
+
+ at A = common global [1040 x float] zeroinitializer, align 4
+
+define void @codegen_simple_md() nounwind {
+entry:
+ br label %for.cond
+
+for.cond: ; preds = %for.inc4, %entry
+ %i.0 = phi i32 [ 0, %entry ], [ %inc5, %for.inc4 ]
+ %exitcond1 = icmp ne i32 %i.0, 32
+ br i1 %exitcond1, label %for.body, label %for.end6
+
+for.body: ; preds = %for.cond
+ br label %for.cond1
+
+for.cond1: ; preds = %for.inc, %for.body
+ %j.0 = phi i32 [ 0, %for.body ], [ %inc, %for.inc ]
+ %exitcond = icmp ne i32 %j.0, 32
+ br i1 %exitcond, label %for.body3, label %for.end
+
+for.body3: ; preds = %for.cond1
+ %mul = shl nsw i32 %i.0, 5
+ %add = add nsw i32 %mul, %j.0
+ %arrayidx = getelementptr inbounds [1040 x float]* @A, i32 0, i32 %add
+ store float 100.0, float* %arrayidx, align 4
+ br label %for.inc
+
+for.inc: ; preds = %for.body3
+ %inc = add nsw i32 %j.0, 1
+ br label %for.cond1
+
+for.end: ; preds = %for.cond1
+ br label %for.inc4
+
+for.inc4: ; preds = %for.end
+ %inc5 = add nsw i32 %i.0, 1
+ br label %for.cond
+
+for.end6: ; preds = %for.cond
+ ret void
+}
+
+; WITHCONST: %[[IVOut:polly.indvar[0-9]*]] = phi i64 [ 0, %polly.loop_preheader{{[0-9]*}} ], [ %polly.indvar_next{{[0-9]*}}, %polly.{{[._a-zA-Z0-9]*}} ]
+; WITHCONST: %[[IVIn:polly.indvar[0-9]*]] = phi i64 [ 0, %polly.loop_preheader{{[0-9]*}} ], [ %polly.indvar_next{{[0-9]*}}, %polly.{{[._a-zA-Z0-9]*}} ]
+; WITHCONST: %[[MUL1:[._a-zA-Z0-9]+]] = mul nsw i64 16, %[[IVOut]]
+; WITHCONST: %[[MUL2:[._a-zA-Z0-9]+]] = mul nsw i64 2, %[[IVIn]]
+; WITHCONST: %[[SUM1:[._a-zA-Z0-9]+]] = add nsw i64 %[[MUL1]], %[[MUL2]]
+; WITHCONST: %[[SUM2:[._a-zA-Z0-9]+]] = add nsw i64 %[[SUM1]], 5
+; WITHCONST: %[[ACC:[._a-zA-Z0-9]*]] = getelementptr [1040 x float]* @A, i64 0, i64 %[[SUM2]]
+; WITHCONST: store float 1.000000e+02, float* %[[ACC]]
+
+; WITHOUTCONST: %[[IVOut:polly.indvar[0-9]*]] = phi i64 [ 0, %polly.loop_preheader{{[0-9]*}} ], [ %polly.indvar_next{{[0-9]*}}, %polly.{{[._a-zA-Z0-9]*}} ]
+; WITHOUTCONST: %[[IVIn:polly.indvar[0-9]*]] = phi i64 [ 0, %polly.loop_preheader{{[0-9]*}} ], [ %polly.indvar_next{{[0-9]*}}, %polly.{{[._a-zA-Z0-9]*}} ]
+; WITHOUTCONST: %[[MUL1:[._a-zA-Z0-9]+]] = mul nsw i64 16, %[[IVOut]]
+; WITHOUTCONST: %[[MUL2:[._a-zA-Z0-9]+]] = mul nsw i64 2, %[[IVIn]]
+; WITHOUTCONST: %[[SUM1:[._a-zA-Z0-9]+]] = add nsw i64 %[[MUL1]], %[[MUL2]]
+; WITHOUTCONST: %[[ACC:[._a-zA-Z0-9]*]] = getelementptr [1040 x float]* @A, i64 0, i64 %[[SUM1]]
+; WITHOUTCONST: store float 1.000000e+02, float* %[[ACC]]
Added: polly/trunk/test/Isl/CodeGen/MemAccess/simple___%for.cond---%for.end14.jscop
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/test/Isl/CodeGen/MemAccess/simple___%25for.cond---%25for.end14.jscop?rev=218047&view=auto
==============================================================================
--- polly/trunk/test/Isl/CodeGen/MemAccess/simple___%for.cond---%for.end14.jscop (added)
+++ polly/trunk/test/Isl/CodeGen/MemAccess/simple___%for.cond---%for.end14.jscop Thu Sep 18 06:20:36 2014
@@ -0,0 +1,28 @@
+{
+ "context" : "{ : }",
+ "name" : "for.cond => for.end14",
+ "statements" : [
+ {
+ "accesses" : [
+ {
+ "kind" : "write",
+ "relation" : "{ Stmt_for_body[i0] -> MemRef_A[i0] }"
+ }
+ ],
+ "domain" : "{ Stmt_for_body[i0] : i0 >= 0 and i0 <= 11 }",
+ "name" : "Stmt_for_body",
+ "schedule" : "{ Stmt_for_body[i0] -> scattering[0, i0, 0] }"
+ },
+ {
+ "accesses" : [
+ {
+ "kind" : "write",
+ "relation" : "{ Stmt_for_body7[i0] -> MemRef_B[i0] }"
+ }
+ ],
+ "domain" : "{ Stmt_for_body7[i0] : i0 >= 0 and i0 <= 11 }",
+ "name" : "Stmt_for_body7",
+ "schedule" : "{ Stmt_for_body7[i0] -> scattering[0, i0, 0] }"
+ }
+ ]
+}
Added: polly/trunk/test/Isl/CodeGen/MemAccess/simple___%for.cond---%for.end14.jscop.transformed
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/test/Isl/CodeGen/MemAccess/simple___%25for.cond---%25for.end14.jscop.transformed?rev=218047&view=auto
==============================================================================
--- polly/trunk/test/Isl/CodeGen/MemAccess/simple___%for.cond---%for.end14.jscop.transformed (added)
+++ polly/trunk/test/Isl/CodeGen/MemAccess/simple___%for.cond---%for.end14.jscop.transformed Thu Sep 18 06:20:36 2014
@@ -0,0 +1,28 @@
+{
+ "context" : "{ : }",
+ "name" : "for.cond => for.end14",
+ "statements" : [
+ {
+ "accesses" : [
+ {
+ "kind" : "write",
+ "relation" : "{ Stmt_for_body[i0] -> MemRef_A[0] }"
+ }
+ ],
+ "domain" : "{ Stmt_for_body[i0] : i0 >= 0 and i0 <= 11 }",
+ "name" : "Stmt_for_body",
+ "schedule" : "{ Stmt_for_body[i0] -> scattering[0, i0, 0] }"
+ },
+ {
+ "accesses" : [
+ {
+ "kind" : "write",
+ "relation" : "{ Stmt_for_body7[i0] -> MemRef_B[0] }"
+ }
+ ],
+ "domain" : "{ Stmt_for_body7[i0] : i0 >= 0 and i0 <= 11 }",
+ "name" : "Stmt_for_body7",
+ "schedule" : "{ Stmt_for_body7[i0] -> scattering[0, i0, 0] }"
+ }
+ ]
+}
Added: polly/trunk/test/Isl/CodeGen/aliasing_parametric_simple_1.ll
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/test/Isl/CodeGen/aliasing_parametric_simple_1.ll?rev=218047&view=auto
==============================================================================
--- polly/trunk/test/Isl/CodeGen/aliasing_parametric_simple_1.ll (added)
+++ polly/trunk/test/Isl/CodeGen/aliasing_parametric_simple_1.ll Thu Sep 18 06:20:36 2014
@@ -0,0 +1,45 @@
+; RUN: opt %loadPolly -polly-code-generator=isl -polly-codegen-isl -S < %s | FileCheck %s
+;
+; void jd(int *A, int *B, int c) {
+; for (int i = 0; i < 1024; i++)
+; A[i] = B[c];
+; }
+;
+; CHECK: %[[AMax:[._a-zA-Z0-9]*]] = getelementptr i32* %A, i64 1024
+; CHECK: %[[BMin:[._a-zA-Z0-9]*]] = getelementptr i32* %B, i32 %c
+; CHECK: %[[AltB:[._a-zA-Z0-9]*]] = icmp ule i32* %[[AMax]], %[[BMin]]
+; CHECK: %[[Cext:[._a-zA-Z0-9]*]] = sext i32 %c to i64
+; CHECK: %[[Cp1:[._a-zA-Z0-9]*]] = add nsw i64 %[[Cext]], 1
+; CHECK: %[[BMax:[._a-zA-Z0-9]*]] = getelementptr i32* %B, i64 %[[Cp1]]
+; CHECK: %[[AMin:[._a-zA-Z0-9]*]] = getelementptr i32* %A, i64 0
+; CHECK: %[[BltA:[._a-zA-Z0-9]*]] = icmp ule i32* %[[BMax]], %[[AMin]]
+; CHECK: %[[NoAlias:[._a-zA-Z0-9]*]] = or i1 %[[AltB]], %[[BltA]]
+; CHECK: %[[RTC:[._a-zA-Z0-9]*]] = and i1 true, %[[NoAlias]]
+; CHECK: br i1 %[[RTC]], label %polly.start, label %for.cond
+;
+target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
+
+define void @jd(i32* %A, i32* %B, i32 %c) {
+entry:
+ br label %for.cond
+
+for.cond: ; preds = %for.inc, %entry
+ %indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 0, %entry ]
+ %exitcond = icmp ne i64 %indvars.iv, 1024
+ br i1 %exitcond, label %for.body, label %for.end
+
+for.body: ; preds = %for.cond
+ %idxprom = sext i32 %c to i64
+ %arrayidx = getelementptr inbounds i32* %B, i64 %idxprom
+ %tmp = load i32* %arrayidx, align 4
+ %arrayidx2 = getelementptr inbounds i32* %A, i64 %indvars.iv
+ store i32 %tmp, i32* %arrayidx2, align 4
+ br label %for.inc
+
+for.inc: ; preds = %for.body
+ %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
+ br label %for.cond
+
+for.end: ; preds = %for.cond
+ ret void
+}
Added: polly/trunk/test/Isl/CodeGen/aliasing_parametric_simple_2.ll
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/test/Isl/CodeGen/aliasing_parametric_simple_2.ll?rev=218047&view=auto
==============================================================================
--- polly/trunk/test/Isl/CodeGen/aliasing_parametric_simple_2.ll (added)
+++ polly/trunk/test/Isl/CodeGen/aliasing_parametric_simple_2.ll Thu Sep 18 06:20:36 2014
@@ -0,0 +1,57 @@
+; RUN: opt %loadPolly -polly-code-generator=isl -polly-codegen-isl -S < %s | FileCheck %s
+;
+; void jd(int *A, int *B, int c) {
+; for (int i = 0; i < 1024; i++)
+; A[i] = B[c - 10] + B[5];
+; }
+;
+; CHECK: %[[AMax:[._a-zA-Z0-9]*]] = getelementptr i32* %A, i64 1024
+; CHECK: %[[m0:[._a-zA-Z0-9]*]] = sext i32 %c to i64
+; CHECK: %[[m1:[._a-zA-Z0-9]*]] = icmp sge i64 %[[m0]], 15
+; CHECK: %[[m2:[._a-zA-Z0-9]*]] = sext i32 %c to i64
+; CHECK: %[[m3:[._a-zA-Z0-9]*]] = sub nsw i64 %[[m2]], 10
+; CHECK: %[[m4:[._a-zA-Z0-9]*]] = select i1 %[[m1]], i64 5, i64 %[[m3]]
+; CHECK: %[[BMin:[._a-zA-Z0-9]*]] = getelementptr i32* %B, i64 %[[m4]]
+; CHECK: %[[AltB:[._a-zA-Z0-9]*]] = icmp ule i32* %[[AMax]], %[[BMin]]
+; CHECK: %[[M0:[._a-zA-Z0-9]*]] = sext i32 %c to i64
+; CHECK: %[[M1:[._a-zA-Z0-9]*]] = icmp sle i64 %[[M0]], 15
+; CHECK: %[[M2:[._a-zA-Z0-9]*]] = sext i32 %c to i64
+; CHECK: %[[M3:[._a-zA-Z0-9]*]] = sub nsw i64 %[[M2]], 9
+; CHECK: %[[M4:[._a-zA-Z0-9]*]] = select i1 %[[M1]], i64 6, i64 %[[M3]]
+; CHECK: %[[BMax:[._a-zA-Z0-9]*]] = getelementptr i32* %B, i64 %[[M4]]
+; CHECK: %[[AMin:[._a-zA-Z0-9]*]] = getelementptr i32* %A, i64 0
+; CHECK: %[[BltA:[._a-zA-Z0-9]*]] = icmp ule i32* %[[BMax]], %[[AMin]]
+; CHECK: %[[NoAlias:[._a-zA-Z0-9]*]] = or i1 %[[AltB]], %[[BltA]]
+; CHECK: %[[RTC:[._a-zA-Z0-9]*]] = and i1 true, %[[NoAlias]]
+; CHECK: br i1 %[[RTC]], label %polly.start, label %for.cond
+;
+target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
+
+define void @jd(i32* %A, i32* %B, i32 %c) {
+entry:
+ br label %for.cond
+
+for.cond: ; preds = %for.inc, %entry
+ %indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 0, %entry ]
+ %exitcond = icmp ne i64 %indvars.iv, 1024
+ br i1 %exitcond, label %for.body, label %for.end
+
+for.body: ; preds = %for.cond
+ %sub = add nsw i32 %c, -10
+ %idxprom = sext i32 %sub to i64
+ %arrayidx = getelementptr inbounds i32* %B, i64 %idxprom
+ %tmp = load i32* %arrayidx, align 4
+ %arrayidx1 = getelementptr inbounds i32* %B, i64 5
+ %tmp1 = load i32* %arrayidx1, align 4
+ %add = add nsw i32 %tmp, %tmp1
+ %arrayidx3 = getelementptr inbounds i32* %A, i64 %indvars.iv
+ store i32 %add, i32* %arrayidx3, align 4
+ br label %for.inc
+
+for.inc: ; preds = %for.body
+ %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
+ br label %for.cond
+
+for.end: ; preds = %for.cond
+ ret void
+}
Added: polly/trunk/test/ScopDetect/aliasing_parametric_simple_1.ll
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/test/ScopDetect/aliasing_parametric_simple_1.ll?rev=218047&view=auto
==============================================================================
--- polly/trunk/test/ScopDetect/aliasing_parametric_simple_1.ll (added)
+++ polly/trunk/test/ScopDetect/aliasing_parametric_simple_1.ll Thu Sep 18 06:20:36 2014
@@ -0,0 +1,35 @@
+; RUN: opt %loadPolly -polly-code-generator=isl -polly-detect -analyze < %s | FileCheck %s
+;
+; CHECK: Valid Region for Scop:
+;
+; void jd(int *A, int *B, int c) {
+; for (int i = 0; i < 1024; i++)
+; A[i] = B[c];
+; }
+;
+target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
+
+define void @jd(i32* %A, i32* %B, i32 %c) {
+entry:
+ br label %for.cond
+
+for.cond: ; preds = %for.inc, %entry
+ %indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 0, %entry ]
+ %exitcond = icmp ne i64 %indvars.iv, 1024
+ br i1 %exitcond, label %for.body, label %for.end
+
+for.body: ; preds = %for.cond
+ %idxprom = sext i32 %c to i64
+ %arrayidx = getelementptr inbounds i32* %B, i64 %idxprom
+ %tmp = load i32* %arrayidx, align 4
+ %arrayidx2 = getelementptr inbounds i32* %A, i64 %indvars.iv
+ store i32 %tmp, i32* %arrayidx2, align 4
+ br label %for.inc
+
+for.inc: ; preds = %for.body
+ %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
+ br label %for.cond
+
+for.end: ; preds = %for.cond
+ ret void
+}
Added: polly/trunk/test/ScopDetect/aliasing_parametric_simple_2.ll
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/test/ScopDetect/aliasing_parametric_simple_2.ll?rev=218047&view=auto
==============================================================================
--- polly/trunk/test/ScopDetect/aliasing_parametric_simple_2.ll (added)
+++ polly/trunk/test/ScopDetect/aliasing_parametric_simple_2.ll Thu Sep 18 06:20:36 2014
@@ -0,0 +1,39 @@
+; RUN: opt %loadPolly -polly-code-generator=isl -polly-detect -analyze < %s | FileCheck %s
+;
+; CHECK: Valid Region for Scop:
+;
+; void jd(int *A, int *B, int c) {
+; for (int i = 0; i < 1024; i++)
+; A[i] = B[c - 10] + B[5];
+; }
+;
+target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
+
+define void @jd(i32* %A, i32* %B, i32 %c) {
+entry:
+ br label %for.cond
+
+for.cond: ; preds = %for.inc, %entry
+ %indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 0, %entry ]
+ %exitcond = icmp ne i64 %indvars.iv, 1024
+ br i1 %exitcond, label %for.body, label %for.end
+
+for.body: ; preds = %for.cond
+ %sub = add nsw i32 %c, -10
+ %idxprom = sext i32 %sub to i64
+ %arrayidx = getelementptr inbounds i32* %B, i64 %idxprom
+ %tmp = load i32* %arrayidx, align 4
+ %arrayidx1 = getelementptr inbounds i32* %B, i64 5
+ %tmp1 = load i32* %arrayidx1, align 4
+ %add = add nsw i32 %tmp, %tmp1
+ %arrayidx3 = getelementptr inbounds i32* %A, i64 %indvars.iv
+ store i32 %add, i32* %arrayidx3, align 4
+ br label %for.inc
+
+for.inc: ; preds = %for.body
+ %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
+ br label %for.cond
+
+for.end: ; preds = %for.cond
+ ret void
+}
Added: polly/trunk/test/ScopDetect/aliasing_simple_1.ll
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/test/ScopDetect/aliasing_simple_1.ll?rev=218047&view=auto
==============================================================================
--- polly/trunk/test/ScopDetect/aliasing_simple_1.ll (added)
+++ polly/trunk/test/ScopDetect/aliasing_simple_1.ll Thu Sep 18 06:20:36 2014
@@ -0,0 +1,33 @@
+; RUN: opt %loadPolly -polly-code-generator=isl -polly-detect -analyze < %s | FileCheck %s
+;
+; CHECK: Valid Region for Scop:
+;
+; void jd(int *A, int *B) {
+; for (int i = 0; i < 1024; i++)
+; A[i] = B[0];
+; }
+;
+target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
+
+define void @jd(i32* %A, i32* %B) {
+entry:
+ br label %for.cond
+
+for.cond: ; preds = %for.inc, %entry
+ %indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 0, %entry ]
+ %exitcond = icmp ne i64 %indvars.iv, 1024
+ br i1 %exitcond, label %for.body, label %for.end
+
+for.body: ; preds = %for.cond
+ %tmp = load i32* %B, align 4
+ %arrayidx2 = getelementptr inbounds i32* %A, i64 %indvars.iv
+ store i32 %tmp, i32* %arrayidx2, align 4
+ br label %for.inc
+
+for.inc: ; preds = %for.body
+ %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
+ br label %for.cond
+
+for.end: ; preds = %for.cond
+ ret void
+}
Added: polly/trunk/test/ScopDetect/aliasing_simple_2.ll
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/test/ScopDetect/aliasing_simple_2.ll?rev=218047&view=auto
==============================================================================
--- polly/trunk/test/ScopDetect/aliasing_simple_2.ll (added)
+++ polly/trunk/test/ScopDetect/aliasing_simple_2.ll Thu Sep 18 06:20:36 2014
@@ -0,0 +1,36 @@
+; RUN: opt %loadPolly -polly-code-generator=isl -polly-detect -analyze < %s | FileCheck %s
+;
+; CHECK: Valid Region for Scop:
+;
+; void jd(int *A, int *B) {
+; for (int i = 0; i < 1024; i++)
+; A[i] = B[0] + B[1023];
+; }
+;
+target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
+
+define void @jd(i32* %A, i32* %B) {
+entry:
+ br label %for.cond
+
+for.cond: ; preds = %for.inc, %entry
+ %indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 0, %entry ]
+ %exitcond = icmp ne i64 %indvars.iv, 1024
+ br i1 %exitcond, label %for.body, label %for.end
+
+for.body: ; preds = %for.cond
+ %tmp = load i32* %B, align 4
+ %arrayidx1 = getelementptr inbounds i32* %B, i64 1023
+ %tmp1 = load i32* %arrayidx1, align 4
+ %add = add nsw i32 %tmp, %tmp1
+ %arrayidx2 = getelementptr inbounds i32* %A, i64 %indvars.iv
+ store i32 %add, i32* %arrayidx2, align 4
+ br label %for.inc
+
+for.inc: ; preds = %for.body
+ %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
+ br label %for.cond
+
+for.end: ; preds = %for.cond
+ ret void
+}
Added: polly/trunk/test/ScopInfo/aliasing_multiple_alias_groups.ll
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/test/ScopInfo/aliasing_multiple_alias_groups.ll?rev=218047&view=auto
==============================================================================
--- polly/trunk/test/ScopInfo/aliasing_multiple_alias_groups.ll (added)
+++ polly/trunk/test/ScopInfo/aliasing_multiple_alias_groups.ll Thu Sep 18 06:20:36 2014
@@ -0,0 +1,52 @@
+; RUN: opt %loadPolly -polly-code-generator=isl -polly-scops -analyze < %s | FileCheck %s --check-prefix=NOAA
+; RUN: opt %loadPolly -polly-code-generator=isl -polly-scops -analyze -tbaa < %s | FileCheck %s --check-prefix=TBAA
+;
+; void jd(int *Int0, int *Int1, float *Float0, float *Float1) {
+; for (int i = 0; i < 1024; i++) {
+; Int0[i] = Int1[i];
+; Float0[i] = Float1[i];
+; }
+; }
+;
+target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
+
+define void @jd(i32* nocapture %Int0, i32* nocapture readonly %Int1, float* nocapture %Float0, float* nocapture readonly %Float1) {
+entry:
+ br label %for.body
+
+for.body: ; preds = %for.body, %entry
+ %indvars.iv = phi i64 [ 0, %entry ], [ %indvars.iv.next, %for.body ]
+ %arrayidx = getelementptr inbounds i32* %Int1, i64 %indvars.iv
+ %tmp = load i32* %arrayidx, align 4, !tbaa !0
+ %arrayidx2 = getelementptr inbounds i32* %Int0, i64 %indvars.iv
+ store i32 %tmp, i32* %arrayidx2, align 4, !tbaa !0
+ %arrayidx4 = getelementptr inbounds float* %Float1, i64 %indvars.iv
+ %tmp1 = load float* %arrayidx4, align 4, !tbaa !4
+ %arrayidx6 = getelementptr inbounds float* %Float0, i64 %indvars.iv
+ store float %tmp1, float* %arrayidx6, align 4, !tbaa !4
+ %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
+ %exitcond = icmp eq i64 %indvars.iv.next, 1024
+ br i1 %exitcond, label %for.end, label %for.body
+
+for.end: ; preds = %for.body
+ ret void
+}
+
+!0 = metadata !{metadata !1, metadata !1, i64 0}
+!1 = metadata !{metadata !"int", metadata !2, i64 0}
+!2 = metadata !{metadata !"omnipotent char", metadata !3, i64 0}
+!3 = metadata !{metadata !"Simple C/C++ TBAA"}
+!4 = metadata !{metadata !5, metadata !5, i64 0}
+!5 = metadata !{metadata !"float", metadata !2, i64 0}
+
+; NOAA: Alias Groups (1):
+; NOAA-DAG: <{ MemRef_Int0[(0)] }, { MemRef_Int0[(1024)] }>
+; NOAA-DAG: <{ MemRef_Int1[(0)] }, { MemRef_Int1[(1024)] }>
+; NOAA-DAG: <{ MemRef_Float0[(0)] }, { MemRef_Float0[(1024)] }>
+; NOAA-DAG: <{ MemRef_Float1[(0)] }, { MemRef_Float1[(1024)] }>
+
+; TBAA-DAG: Alias Groups (2):
+; TBAA-DAG: <{ MemRef_Int0[(0)] }, { MemRef_Int0[(1024)] }>
+; TBAA-DAG: <{ MemRef_Int1[(0)] }, { MemRef_Int1[(1024)] }>
+; TBAA-DAG: <{ MemRef_Float0[(0)] }, { MemRef_Float0[(1024)] }>
+; TBAA-DAG: <{ MemRef_Float1[(0)] }, { MemRef_Float1[(1024)] }>
More information about the llvm-commits
mailing list