Imported Upstream version 6.10.0.49

Former-commit-id: 1d6753294b2993e1fbf92de9366bb9544db4189b
This commit is contained in:
Xamarin Public Jenkins (auto-signing)
2020-01-16 16:38:04 +00:00
parent d94e79959b
commit 468663ddbb
48518 changed files with 2789335 additions and 61176 deletions

View File

@@ -0,0 +1,36 @@
; RUN: not opt %loadPolly -polly-import-jscop -analyze 2>&1 < %s | FileCheck %s
;
; Check that we do not allow to access elements not accessed before because the
; alignment information would become invalid.
;
; CHECK: JScop file changes the accessed memory
;
; void bad_alignment(int *A) {
; for (int i = 0; i < 1024; i += 2)
; A[i] = i;
; }
;
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
define void @bad_alignment(i32* %A) {
entry:
br label %for.cond
for.cond: ; preds = %for.inc, %entry
%indvars.iv = phi i64 [ %indvars.iv.next, %for.inc ], [ 0, %entry ]
%cmp = icmp slt i64 %indvars.iv, 1024
br i1 %cmp, label %for.body, label %for.end
for.body: ; preds = %for.cond
%arrayidx = getelementptr inbounds i32, i32* %A, i64 %indvars.iv
%tmp = trunc i64 %indvars.iv to i32
store i32 %tmp, i32* %arrayidx, align 8
br label %for.inc
for.inc: ; preds = %for.body
%indvars.iv.next = add nuw nsw i64 %indvars.iv, 2
br label %for.cond
for.end: ; preds = %for.cond
ret void
}

View File

@@ -0,0 +1,17 @@
{
"context" : "{ : }",
"name" : "for.cond => polly.merge_new_and_old",
"statements" : [
{
"accesses" : [
{
"kind" : "write",
"relation" : "{ Stmt_for_body[i0] -> MemRef_A[1] }"
}
],
"domain" : "{ Stmt_for_body[i0] : i0 >= 0 and i0 <= 511 }",
"name" : "Stmt_for_body",
"schedule" : "{ Stmt_for_body[i0] -> [0, i0, 0] }"
}
]
}

View File

@@ -0,0 +1,44 @@
;RUN: opt %loadPolly -polly-import-jscop -polly-import-jscop-postfix=transformed -polly-codegen -instnamer < %s -S | FileCheck %s
;int 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"
define i32 @codegen_simple([100 x i32] addrspace(5)* %A) nounwind {
entry:
%arrayidx.write = getelementptr [100 x i32], [100 x i32] addrspace(5)* %A, i32 0, i32 13
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 i32], [100 x i32] addrspace(5)* %A, i32 0, i32 %tmp
%arrayidx = getelementptr [100 x i32], [100 x i32] addrspace(5)* %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 i32, i32 addrspace(5)* %arrayidx, align 4
%tmp5 = load i32, i32 addrspace(5)* %arrayidx4, align 4
%add = add nsw i32 %tmp2, %tmp5
store i32 %add, i32 addrspace(5)* %arrayidx.write
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: %polly.access.cast.A = bitcast [100 x i32] addrspace(5)* %A to i32 addrspace(5)*
; CHECK: %polly.access.A = getelementptr i32, i32 addrspace(5)* %polly.access.cast.A, i64 0
; CHECK: %tmp2_p_scalar_ = load i32, i32 addrspace(5)* %polly.access.A, align 4, !alias.scope !0, !noalias !2

View File

@@ -0,0 +1,42 @@
;RUN: opt %loadPolly -polly-import-jscop -polly-import-jscop-postfix=transformed -polly-codegen -instnamer < %s -S | FileCheck %s
;int A[100];
;
;int codegen_constant_offset() {
; 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"
@A = common global [100 x i32] zeroinitializer, align 4
define i32 @codegen_constant_offset() 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 i32], [100 x i32]* @A, i32 0, i32 %tmp
%arrayidx = getelementptr [100 x i32], [100 x i32]* @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 i32, i32* %arrayidx, align 4
%tmp5 = load i32, i32* %arrayidx4, align 4
%add = add nsw i32 %tmp2, %tmp5
store i32 %add, i32* getelementptr inbounds ([100 x i32], [100 x i32]* @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 i32, i32* getelementptr inbounds ([100 x i32], [100 x i32]* @A, i{{(32|64)}} 0, i{{(32|64)}} 10)

View File

@@ -0,0 +1,25 @@
{
"context" : "{ : }",
"name" : "for.cond => for.end",
"statements" : [
{
"accesses" : [
{
"kind" : "read",
"relation" : "{ Stmt_for_body[i0] -> MemRef_A[i0] }"
},
{
"kind" : "read",
"relation" : "{ Stmt_for_body[i0] -> MemRef_A[-1 + i0] }"
},
{
"kind" : "write",
"relation" : "{ Stmt_for_body[i0] -> MemRef_A[13] }"
}
],
"domain" : "{ Stmt_for_body[i0] : i0 >= 0 and i0 <= 11 }",
"name" : "Stmt_for_body",
"schedule" : "{ Stmt_for_body[i0] -> [0, i0, 0] }"
}
]
}

View File

@@ -0,0 +1,25 @@
{
"context" : "{ : }",
"name" : "for.cond => for.end",
"statements" : [
{
"accesses" : [
{
"kind" : "read",
"relation" : "{ Stmt_for_body[i0] -> MemRef_A[10] }"
},
{
"kind" : "read",
"relation" : "{ Stmt_for_body[i0] -> MemRef_A[-1 + i0] }"
},
{
"kind" : "write",
"relation" : "{ Stmt_for_body[i0] -> MemRef_A[13] }"
}
],
"domain" : "{ Stmt_for_body[i0] : i0 >= 0 and i0 <= 11 }",
"name" : "Stmt_for_body",
"schedule" : "{ Stmt_for_body[i0] -> [0, i0, 0] }"
}
]
}

View File

@@ -0,0 +1,42 @@
;RUN: opt %loadPolly -polly-import-jscop -polly-import-jscop-postfix=transformed -polly-codegen -instnamer < %s -S | FileCheck %s
;int 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"
@A = common global [100 x i32] 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 i32], [100 x i32]* @A, i32 0, i32 %tmp
%arrayidx = getelementptr [100 x i32], [100 x i32]* @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 i32, i32* %arrayidx, align 4
%tmp5 = load i32, i32* %arrayidx4, align 4
%add = add nsw i32 %tmp2, %tmp5
store i32 %add, i32* getelementptr inbounds ([100 x i32], [100 x i32]* @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 i32, i32* getelementptr inbounds ([100 x i32], [100 x i32]* @A, i{{(32|64)}} 0, i{{(32|64)}} 0)

View File

@@ -0,0 +1,25 @@
{
"context" : "{ : }",
"name" : "for.cond => for.end",
"statements" : [
{
"accesses" : [
{
"kind" : "read",
"relation" : "{ Stmt_for_body[i0] -> MemRef_A[i0] }"
},
{
"kind" : "read",
"relation" : "{ Stmt_for_body[i0] -> MemRef_A[-1 + i0] }"
},
{
"kind" : "write",
"relation" : "{ Stmt_for_body[i0] -> MemRef_A[13] }"
}
],
"domain" : "{ Stmt_for_body[i0] : i0 >= 0 and i0 <= 11 }",
"name" : "Stmt_for_body",
"schedule" : "{ Stmt_for_body[i0] -> [0, i0, 0] }"
}
]
}

View File

@@ -0,0 +1,25 @@
{
"context" : "{ : }",
"name" : "for.cond => for.end",
"statements" : [
{
"accesses" : [
{
"kind" : "read",
"relation" : "{ Stmt_for_body[i0] -> MemRef_A[0] }"
},
{
"kind" : "read",
"relation" : "{ Stmt_for_body[i0] -> MemRef_A[-1 + i0] }"
},
{
"kind" : "write",
"relation" : "{ Stmt_for_body[i0] -> MemRef_A[13] }"
}
],
"domain" : "{ Stmt_for_body[i0] : i0 >= 0 and i0 <= 11 }",
"name" : "Stmt_for_body",
"schedule" : "{ Stmt_for_body[i0] -> [0, i0, 0] }"
}
]
}

View File

@@ -0,0 +1,41 @@
;RUN: opt %loadPolly -polly-import-jscop -polly-import-jscop-postfix=transformed -polly-codegen -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"
@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], [100 x float]* @A, i32 0, i32 %tmp
%arrayidx = getelementptr [100 x float], [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, float* %arrayidx, align 4
%tmp5 = load float, float* %arrayidx4, align 4
%add = fadd float %tmp2, %tmp5
store float %add, float* getelementptr inbounds ([100 x float], [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, float* getelementptr inbounds ([100 x float], [100 x float]* @A, i{{(32|64)}} 0, i{{(32|64)}} 0)

View File

@@ -0,0 +1,72 @@
;RUN: opt %loadPolly -polly-import-jscop -polly-import-jscop-postfix=transformed+withconst -polly-codegen < %s -S | FileCheck -check-prefix=WITHCONST %s
;RUN: opt %loadPolly -polly-import-jscop -polly-import-jscop-postfix=transformed+withoutconst -polly-codegen < %s -S | FileCheck -check-prefix=WITHOUTCONST %s
;int 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;
;
; 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-S128"
@A = common global [1040 x i32] zeroinitializer, align 4
define i32 @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 i32], [1040 x i32]* @A, i32 0, i32 %add
store i32 100, i32* %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 i32 0
}
; 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 i32, i32* getelementptr inbounds ([1040 x i32], [1040 x i32]* @A, i{{(32|64)}} 0, i{{(32|64)}} 0), i64 %[[SUM2]]
; WITHCONST: store i32 100, i32* %[[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 i32, i32* getelementptr inbounds ([1040 x i32], [1040 x i32]* @A, i{{(32|64)}} 0, i{{(32|64)}} 0), i64 %[[SUM1]]
; WITHOUTCONST: store i32 100, i32* %[[ACC]]

View File

@@ -0,0 +1,17 @@
{
"context" : "{ : }",
"name" : "for.cond => for.end6",
"statements" : [
{
"accesses" : [
{
"kind" : "write",
"relation" : "{ Stmt_for_body3[i0, i1] -> MemRef_A[32i0 + i1] }"
}
],
"domain" : "{ Stmt_for_body3[i0, i1] : i0 >= 0 and i0 <= 31 and i1 >= 0 and i1 <= 31 }",
"name" : "Stmt_for_body3",
"schedule" : "{ Stmt_for_body3[i0, i1] -> [0, i0, 0, i1, 0] }"
}
]
}

View File

@@ -0,0 +1,17 @@
{
"context" : "{ : }",
"name" : "for.cond => for.end6",
"statements" : [
{
"accesses" : [
{
"kind" : "write",
"relation" : "{ Stmt_for_body3[i0, i1] -> MemRef_A[16i0 + 2i1 + 5] }"
}
],
"domain" : "{ Stmt_for_body3[i0, i1] : i0 >= 0 and i0 <= 31 and i1 >= 0 and i1 <= 31 }",
"name" : "Stmt_for_body3",
"schedule" : "{ Stmt_for_body3[i0, i1] -> [0, i0, 0, i1, 0] }"
}
]
}

View File

@@ -0,0 +1,17 @@
{
"context" : "{ : }",
"name" : "for.cond => for.end6",
"statements" : [
{
"accesses" : [
{
"kind" : "write",
"relation" : "{ Stmt_for_body3[i0, i1] -> MemRef_A[16i0 + 2i1] }"
}
],
"domain" : "{ Stmt_for_body3[i0, i1] : i0 >= 0 and i0 <= 31 and i1 >= 0 and i1 <= 31 }",
"name" : "Stmt_for_body3",
"schedule" : "{ Stmt_for_body3[i0, i1] -> [0, i0, 0, i1, 0] }"
}
]
}

View File

@@ -0,0 +1,69 @@
;RUN: opt %loadPolly -polly-import-jscop -polly-import-jscop-postfix=transformed+withconst -polly-codegen < %s -S | FileCheck -check-prefix=WITHCONST %s
;RUN: opt %loadPolly -polly-import-jscop -polly-import-jscop-postfix=transformed+withoutconst -polly-codegen < %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"
@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], [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 float, float* getelementptr inbounds ([1040 x float], [1040 x float]* @A, i{{(32|64)}} 0, i{{(32|64)}} 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 float, float* getelementptr inbounds ([1040 x float], [1040 x float]* @A, i{{(32|64)}} 0, i{{(32|64)}} 0), i64 %[[SUM1]]
; WITHOUTCONST: store float 1.000000e+02, float* %[[ACC]]

View File

@@ -0,0 +1,88 @@
; RUN: opt %loadPolly -polly-scops -analyze -polly-import-jscop -polly-import-jscop-postfix=transformed < %s 2>&1 | FileCheck %s
; RUN: opt %loadPolly -polly-import-jscop -polly-import-jscop-postfix=transformed -polly-codegen -S < %s 2>&1 | FileCheck %s --check-prefix=CODEGEN
;
; for (i = 0; i < _PB_NI; i++)
; for (j = 0; j < _PB_NJ; j++)
; for (k = 0; k < _PB_NK; ++k)
; B[i][j] = beta * A[i][k];
;
;
; CHECK: Arrays {
; CHECK: double MemRef_B[*][1024]; // Element size 8
; CHECK: double MemRef_beta; // Element size 8
; CHECK: double MemRef_A[*][1056]; // Element size 8
; CHECK: double D[270336]; // Element size 8
; CHECK: double E[270336][200000]; // Element size 8
; CHECK: i64 F[270336]; // Element size 8
;
; CHECK:New access function '{ Stmt_bb12[i0, i1, i2] -> E[i2, i0] }' detected in JSCOP file
;
; CODEGEN:define internal void @create_arrays(i32 %arg, i32 %arg1, i32 %arg2, double %arg3, double %beta, [1056 x double]* %A, [1024 x double]* %B, [1056 x double]* %arg7) #0 {
; CODEGEN:bb:
; CODEGEN: %beta.s2a = alloca double
; CODEGEN: %D = alloca [270336 x double]
; CODEGEN: %E = alloca [270336 x [200000 x double]]
; CODEGEN: %F = alloca [270336 x i64]
; CODEGEN: br label %bb8
;
; CODEGEN: %beta.s2a.reload = load double, double* %beta.s2a
; CODEGEN: %polly.access.cast.E = bitcast [270336 x [200000 x double]]* %E to double*
; CODEGEN: %polly.access.mul.E = mul nsw i64 %polly.indvar33, 200000
; CODEGEN: %polly.access.add.E = add nsw i64 %polly.access.mul.E, %polly.indvar
; CODEGEN: {{%.*}} = load double, double* %polly.access.E, align 8, !alias.scope [[TAG0:![0-9]+]], !noalias [[TAG2:![0-9]+]]
; CODEGEN: store double {{%.*}}, double* %scevgep36, align 8, !alias.scope [[TAG5:![0-9]+]], !noalias [[TAG8:![0-9]+]]
;
; CODEGEN: [[TAG0]] = distinct !{[[TAG0]], [[TAG1:![0-9]+]], !"polly.alias.scope.E"}
; CODEGEN: [[TAG1]] = distinct !{[[TAG1]], !"polly.alias.scope.domain"}
; CODEGEN: [[TAG2]] = !{[[TAG3:![0-9]+]], [[TAG4:![0-9]+]], [[TAG5:![0-9]+]], [[TAG6:![0-9]+]]}
; CODEGEN: [[TAG3]] = distinct !{[[TAG3]], [[TAG1]], !"polly.alias.scope.MemRef_B"}
; CODEGEN: [[TAG4]] = distinct !{[[TAG4]], [[TAG1]], !"polly.alias.scope.MemRef_A"}
; CODEGEN: [[TAG5]] = distinct !{[[TAG5]], [[TAG1]], !"polly.alias.scope.D"}
; CODEGEN: [[TAG6]] = distinct !{[[TAG6]], [[TAG1]], !"polly.alias.scope.F"}
; CODEGEN: [[TAG7:![0-9]+]] = !{[[TAG3]], [[TAG5]], [[TAG0]], [[TAG6]]}
;
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-unknown"
; Function Attrs: nounwind uwtable
define internal void @create_arrays(i32 %arg, i32 %arg1, i32 %arg2, double %arg3, double %beta, [1056 x double]* %A, [1024 x double]* %B, [1056 x double]* %arg7) #0 {
bb:
br label %bb8
bb8: ; preds = %bb
br label %bb9
bb9: ; preds = %bb23, %bb8
%tmp = phi i64 [ 0, %bb8 ], [ %tmp24, %bb23 ]
br label %bb10
bb10: ; preds = %bb20, %bb9
%tmp11 = phi i64 [ 0, %bb9 ], [ %tmp21, %bb20 ]
br label %bb12
bb12: ; preds = %bb12, %bb10
%tmp13 = phi i64 [ 0, %bb10 ], [ %tmp18, %bb12 ]
%tmp14 = getelementptr inbounds [1024 x double], [1024 x double]* %B, i64 %tmp, i64 %tmp13
%tmp15 = load double, double* %tmp14, align 8
%tmp16 = fmul double %tmp15, %beta
%tmp17 = getelementptr inbounds [1056 x double], [1056 x double]* %A, i64 %tmp, i64 %tmp11
store double %tmp16, double* %tmp17, align 8
%tmp18 = add nuw nsw i64 %tmp13, 1
%tmp19 = icmp ne i64 %tmp18, 1024
br i1 %tmp19, label %bb12, label %bb20
bb20: ; preds = %bb12
%tmp21 = add nuw nsw i64 %tmp11, 1
%tmp22 = icmp ne i64 %tmp21, 1056
br i1 %tmp22, label %bb10, label %bb23
bb23: ; preds = %bb20
%tmp24 = add nuw nsw i64 %tmp, 1
%tmp25 = icmp ne i64 %tmp24, 1056
br i1 %tmp25, label %bb9, label %bb26
bb26: ; preds = %bb23
ret void
}
attributes #0 = { nounwind uwtable "target-cpu"="x86-64" "target-features"="+aes,+avx,+cmov,+cx16,+fxsr,+mmx,+pclmul,+popcnt,+sse,+sse2,+sse3,+sse4.1,+sse4.2,+ssse3,+x87,+xsave,+xsaveopt" }

View File

@@ -0,0 +1,37 @@
{
"arrays" : [
{
"name" : "MemRef_B",
"sizes" : [ "*", "1024" ],
"type" : "double"
},
{
"name" : "MemRef_A",
"sizes" : [ "*", "1056" ],
"type" : "double"
}
],
"context" : "{ : }",
"name" : "%bb9---%bb26",
"statements" : [
{
"accesses" : [
{
"kind" : "read",
"relation" : "{ Stmt_bb12[i0, i1, i2] -> MemRef_B[i0, i2] }"
},
{
"kind" : "read",
"relation" : "{ Stmt_bb12[i0, i1, i2] -> MemRef_beta[] }"
},
{
"kind" : "write",
"relation" : "{ Stmt_bb12[i0, i1, i2] -> MemRef_A[i0, i1] }"
}
],
"domain" : "{ Stmt_bb12[i0, i1, i2] : 0 <= i0 <= 1055 and 0 <= i1 <= 1055 and 0 <= i2 <= 1023 }",
"name" : "Stmt_bb12",
"schedule" : "{ Stmt_bb12[i0, i1, i2] -> [i0, i1, i2] }"
}
]
}

View File

@@ -0,0 +1,52 @@
{
"arrays" : [
{
"name" : "MemRef_B",
"sizes" : [ "*", "1024" ],
"type" : "double"
},
{
"name" : "MemRef_A",
"sizes" : [ "*", "1056" ],
"type" : "double"
},
{
"name" : "D",
"sizes" : [ "270336" ],
"type" : "double"
},
{
"name" : "E",
"sizes" : [ "270336", "200000" ],
"type" : "double"
},
{
"name" : "F",
"sizes" : [ "270336" ],
"type" : "i64"
}
],
"context" : "{ : }",
"name" : "%bb9---%bb26",
"statements" : [
{
"accesses" : [
{
"kind" : "read",
"relation" : "{ Stmt_bb12[i0, i1, i2] -> E[i2, i0] }"
},
{
"kind" : "read",
"relation" : "{ Stmt_bb12[i0, i1, i2] -> MemRef_beta[] }"
},
{
"kind" : "write",
"relation" : "{ Stmt_bb12[i0, i1, i2] -> MemRef_A[i0, i1] }"
}
],
"domain" : "{ Stmt_bb12[i0, i1, i2] : 0 <= i0 <= 1055 and 0 <= i1 <= 1055 and 0 <= i2 <= 1023 }",
"name" : "Stmt_bb12",
"schedule" : "{ Stmt_bb12[i0, i1, i2] -> [i0, i1, i2] }"
}
]
}

View File

@@ -0,0 +1,113 @@
; RUN: opt %loadPolly -polly-scops -analyze -polly-import-jscop -polly-import-jscop-postfix=transformed < %s | FileCheck %s
; RUN: opt %loadPolly -polly-import-jscop -polly-import-jscop-postfix=transformed -polly-codegen -S < %s | FileCheck %s --check-prefix=CODEGEN
;
; #define Ni 1056
; #define Nj 1056
; #define Nk 1024
;
; void create_arrays_heap(double beta, double A[Ni][Nk], double B[Ni][Nj]) {
; int i,j,k;
;
; for (i = 0; i < Ni; i++) {
; for (j = 0; j < Nj; j++) {
; for (k = 0; k < Nk; ++k) {
; B[i][j] = beta * A[i][k];
; }
; }
; }
; }
;
; Check if the info from the JSON file has been analysed without errors.
; CHECK: Arrays {
; CHECK: double MemRef_A[*][1024]; // Element size 8
; CHECK: double MemRef_beta; // Element size 8
; CHECK: double MemRef_B[*][1056]; // Element size 8
; CHECK: double D[270336]; // Element size 8
; CHECK: double E[270336][200000]; // Element size 8
; CHECK: i64 F[270336]; // Element size 8
;
; Check if there are the 3 expected malloc calls with the right parameters at polly.start.
; %D : size(D) = product_all_dimensions*sizeof(type) = 270336*8 = 2162688 cast to double*
; %E : size(E) = 270336*200000*8 = 432537600000 cast to double*
; %F : size(F) = 270336*8 = 2162688 cast to i64*
; CODEGEN: polly.start:
; CODEGEN: %malloccall = tail call i8* @malloc(i64 2162688)
; CODEGEN: %D = bitcast i8* %malloccall to double*
; CODEGEN: %malloccall1 = tail call i8* @malloc(i64 432537600000)
; CODEGEN: %E = bitcast i8* %malloccall1 to double*
; CODEGEN: %malloccall2 = tail call i8* @malloc(i64 2162688)
; CODEGEN: %F = bitcast i8* %malloccall2 to i64*
;
; Check if there are the 3 expected malloc calls with the right parameters at polly.exiting.
; Cast to i8* before freeing because malloc give us a i8 and free is waiting for a i8*
; CODEGEN: polly.exiting:
; CODEGEN: %12 = bitcast double* %D to i8*
; CODEGEN: tail call void @free(i8* %12)
; CODEGEN: %13 = bitcast double* %E to i8*
; CODEGEN: tail call void @free(i8* %13)
; CODEGEN: %14 = bitcast i64* %F to i8*
; CODEGEN: tail call void @free(i8* %14)
;
; Check if the new access for array E is present.
; CODEGEN: %polly.access.mul.E = mul nsw i64 %polly.indvar, 200000
; CODEGEN: %polly.access.add.E = add nsw i64 %polly.access.mul.E, %
; CODEGEN: %polly.access.E = getelementptr double, double* %E, i64 %polly.access.add.E
;
; ModuleID = 'create_arrays_heap.ll'
;
target datalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"
; Function Attrs: nounwind uwtable
define void @create_arrays_heap(double %beta, [1024 x double]* nocapture readonly %A, [1056 x double]* nocapture %B) local_unnamed_addr {
entry:
br label %for.cond1.preheader
for.cond1.preheader: ; preds = %for.inc16, %entry
%indvars.iv35 = phi i64 [ 0, %entry ], [ %indvars.iv.next36, %for.inc16 ]
br label %for.cond4.preheader
for.cond4.preheader: ; preds = %for.inc13, %for.cond1.preheader
%indvars.iv32 = phi i64 [ 0, %for.cond1.preheader ], [ %indvars.iv.next33, %for.inc13 ]
%arrayidx12 = getelementptr inbounds [1056 x double], [1056 x double]* %B, i64 %indvars.iv35, i64 %indvars.iv32
br label %for.body6
for.body6: ; preds = %for.body6, %for.cond4.preheader
%indvars.iv = phi i64 [ 0, %for.cond4.preheader ], [ %indvars.iv.next.3, %for.body6 ]
%arrayidx8 = getelementptr inbounds [1024 x double], [1024 x double]* %A, i64 %indvars.iv35, i64 %indvars.iv
%0 = load double, double* %arrayidx8, align 8
%mul = fmul double %0, %beta
store double %mul, double* %arrayidx12, align 8
%indvars.iv.next = or i64 %indvars.iv, 1
%arrayidx8.1 = getelementptr inbounds [1024 x double], [1024 x double]* %A, i64 %indvars.iv35, i64 %indvars.iv.next
%1 = load double, double* %arrayidx8.1, align 8
%mul.1 = fmul double %1, %beta
store double %mul.1, double* %arrayidx12, align 8
%indvars.iv.next.1 = or i64 %indvars.iv, 2
%arrayidx8.2 = getelementptr inbounds [1024 x double], [1024 x double]* %A, i64 %indvars.iv35, i64 %indvars.iv.next.1
%2 = load double, double* %arrayidx8.2, align 8
%mul.2 = fmul double %2, %beta
store double %mul.2, double* %arrayidx12, align 8
%indvars.iv.next.2 = or i64 %indvars.iv, 3
%arrayidx8.3 = getelementptr inbounds [1024 x double], [1024 x double]* %A, i64 %indvars.iv35, i64 %indvars.iv.next.2
%3 = load double, double* %arrayidx8.3, align 8
%mul.3 = fmul double %3, %beta
store double %mul.3, double* %arrayidx12, align 8
%indvars.iv.next.3 = add nsw i64 %indvars.iv, 4
%exitcond.3 = icmp eq i64 %indvars.iv.next.3, 1024
br i1 %exitcond.3, label %for.inc13, label %for.body6
for.inc13: ; preds = %for.body6
%indvars.iv.next33 = add nuw nsw i64 %indvars.iv32, 1
%exitcond34 = icmp eq i64 %indvars.iv.next33, 1056
br i1 %exitcond34, label %for.inc16, label %for.cond4.preheader
for.inc16: ; preds = %for.inc13
%indvars.iv.next36 = add nuw nsw i64 %indvars.iv35, 1
%exitcond37 = icmp eq i64 %indvars.iv.next36, 1056
br i1 %exitcond37, label %for.end18, label %for.cond1.preheader
for.end18: ; preds = %for.inc16
ret void
}

View File

@@ -0,0 +1,62 @@
{
"arrays" : [
{
"name" : "MemRef_A",
"sizes" : [ "*", "1024" ],
"type" : "double"
},
{
"name" : "MemRef_B",
"sizes" : [ "*", "1056" ],
"type" : "double"
}
],
"context" : "{ : }",
"location" : "pure_c_main.c:11-16",
"name" : "%for.cond1.preheader---%for.end18",
"statements" : [
{
"accesses" : [
{
"kind" : "read",
"relation" : "{ Stmt2[i0, i1, i2] -> MemRef_A[i0, 4i2] }"
},
{
"kind" : "read",
"relation" : "{ Stmt2[i0, i1, i2] -> MemRef_beta[] }"
},
{
"kind" : "write",
"relation" : "{ Stmt2[i0, i1, i2] -> MemRef_B[i0, i1] }"
},
{
"kind" : "read",
"relation" : "{ Stmt2[i0, i1, i2] -> MemRef_A[i0, 1 + 4i2] }"
},
{
"kind" : "write",
"relation" : "{ Stmt2[i0, i1, i2] -> MemRef_B[i0, i1] }"
},
{
"kind" : "read",
"relation" : "{ Stmt2[i0, i1, i2] -> MemRef_A[i0, 2 + 4i2] }"
},
{
"kind" : "write",
"relation" : "{ Stmt2[i0, i1, i2] -> MemRef_B[i0, i1] }"
},
{
"kind" : "read",
"relation" : "{ Stmt2[i0, i1, i2] -> MemRef_A[i0, 3 + 4i2] }"
},
{
"kind" : "write",
"relation" : "{ Stmt2[i0, i1, i2] -> MemRef_B[i0, i1] }"
}
],
"domain" : "{ Stmt2[i0, i1, i2] : 0 <= i0 <= 1055 and 0 <= i1 <= 1055 and 0 <= i2 <= 255 }",
"name" : "Stmt2",
"schedule" : "{ Stmt2[i0, i1, i2] -> [i0, i1, i2] }"
}
]
}

Some files were not shown because too many files have changed in this diff Show More