forked from OSchip/llvm-project
parent
acc748b2b5
commit
41b20a62c9
|
@ -1,23 +0,0 @@
|
|||
int bar1();
|
||||
int bar2();
|
||||
int bar3();
|
||||
int k;
|
||||
#define N 100
|
||||
int A[N];
|
||||
|
||||
int main() {
|
||||
int i, j, z;
|
||||
|
||||
__sync_synchronize();
|
||||
for (i = 0; i < N; i++) {
|
||||
if (i < 50)
|
||||
A[i] = 8;
|
||||
if (i < 4)
|
||||
A[i] = 9;
|
||||
if (i < 3)
|
||||
A[i] = 10;
|
||||
}
|
||||
__sync_synchronize();
|
||||
|
||||
return A[z];
|
||||
}
|
|
@ -1,5 +1,30 @@
|
|||
; RUN: opt %loadPolly %defaultOpts -polly-cloog -analyze %s
|
||||
; ModuleID = '20100720-MultipleConditions.s'
|
||||
|
||||
;int bar1();
|
||||
;int bar2();
|
||||
;int bar3();
|
||||
;int k;
|
||||
;#define N 100
|
||||
;int A[N];
|
||||
;
|
||||
;int main() {
|
||||
; int i, j, z;
|
||||
;
|
||||
; __sync_synchronize();
|
||||
; for (i = 0; i < N; i++) {
|
||||
; if (i < 50)
|
||||
; A[i] = 8;
|
||||
; if (i < 4)
|
||||
; A[i] = 9;
|
||||
; if (i < 3)
|
||||
; A[i] = 10;
|
||||
; }
|
||||
; __sync_synchronize();
|
||||
;
|
||||
; return A[z];
|
||||
;}
|
||||
|
||||
target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64"
|
||||
target triple = "x86_64-pc-linux-gnu"
|
||||
|
||||
|
|
|
@ -1,16 +0,0 @@
|
|||
int A[128][128];
|
||||
|
||||
int gpu_pure() {
|
||||
int i,j;
|
||||
|
||||
for(i = 0; i < 128; i++)
|
||||
for(j = 0; j < 128; j++)
|
||||
A[i][j] = i*128 + j;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int main() {
|
||||
int b = gpu_pure();
|
||||
return 0;
|
||||
}
|
|
@ -1,5 +1,22 @@
|
|||
; RUN: opt %loadPolly -basicaa -polly-import-jscop -polly-import-jscop-dir=%S -polly-import-jscop-postfix=transformed+gpu -enable-polly-gpgpu -polly-gpgpu-triple=nvptx64-unknown-unknown -polly-codegen %s -S | FileCheck %s
|
||||
; ModuleID = '2d_innermost_parallel.s'
|
||||
|
||||
;int A[128][128];
|
||||
;
|
||||
;int gpu_pure() {
|
||||
; int i,j;
|
||||
;
|
||||
; for(i = 0; i < 128; i++)
|
||||
; for(j = 0; j < 128; j++)
|
||||
; A[i][j] = i*128 + j;
|
||||
;
|
||||
; return 0;
|
||||
;}
|
||||
;
|
||||
;int main() {
|
||||
; int b = gpu_pure();
|
||||
; return 0;
|
||||
;}
|
||||
|
||||
target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128"
|
||||
target triple = "x86_64-unknown-linux-gnu"
|
||||
|
||||
|
|
|
@ -1,17 +0,0 @@
|
|||
int A[128][128];
|
||||
|
||||
int gpu_no_pure() {
|
||||
int i,j,k;
|
||||
|
||||
for(i = 0; i < 128; i++)
|
||||
for(j = 0; j < 128; j++)
|
||||
for(k = 0; k < 256; k++)
|
||||
A[i][j] += i*123/(k+1)+5-j*k-123;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int main() {
|
||||
int b = gpu_no_pure();
|
||||
return 0;
|
||||
}
|
|
@ -1,5 +1,23 @@
|
|||
; RUN: opt %loadPolly -basicaa -polly-import-jscop -polly-import-jscop-dir=%S -polly-import-jscop-postfix=transformed+gpu -enable-polly-gpgpu -polly-gpgpu-triple=nvptx64-unknown-unknown -polly-codegen %s -S | FileCheck %s
|
||||
; ModuleID = '3d_innermost_non_parallel.s'
|
||||
|
||||
;int A[128][128];
|
||||
;
|
||||
;int gpu_no_pure() {
|
||||
; int i,j,k;
|
||||
;
|
||||
; for(i = 0; i < 128; i++)
|
||||
; for(j = 0; j < 128; j++)
|
||||
; for(k = 0; k < 256; k++)
|
||||
; A[i][j] += i*123/(k+1)+5-j*k-123;
|
||||
;
|
||||
; return 0;
|
||||
;}
|
||||
;
|
||||
;int main() {
|
||||
; int b = gpu_no_pure();
|
||||
; return 0;
|
||||
;}
|
||||
|
||||
target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128"
|
||||
target triple = "x86_64-unknown-linux-gnu"
|
||||
|
||||
|
|
|
@ -1,8 +0,0 @@
|
|||
int A[100];
|
||||
|
||||
int codegen_constant_offset() {
|
||||
for (int i = 0; i < 12; i++)
|
||||
A[13] = A[i] + A[i-1];
|
||||
|
||||
return 0;
|
||||
}
|
|
@ -1,5 +1,14 @@
|
|||
;RUN: opt %loadPolly -polly-import-jscop -polly-import-jscop-dir=%S -polly-import-jscop-postfix=transformed -polly-codegen -instnamer %s -S | FileCheck %s
|
||||
; ModuleID = 'codegen_constant_offset.ll'
|
||||
|
||||
;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"
|
||||
target triple = "i386-pc-linux-gnu"
|
||||
|
||||
|
|
|
@ -1,8 +0,0 @@
|
|||
int A[100];
|
||||
|
||||
int codegen_simple () {
|
||||
for (int i = 0; i < 12; i++)
|
||||
A[13] = A[i] + A[i-1];
|
||||
|
||||
return 0;
|
||||
}
|
|
@ -1,5 +1,14 @@
|
|||
;RUN: opt %loadPolly -polly-import-jscop -polly-import-jscop-dir=%S -polly-import-jscop-postfix=transformed -polly-codegen -instnamer %s -S | FileCheck %s
|
||||
; ModuleID = 'codegen_simple.ll'
|
||||
|
||||
;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"
|
||||
target triple = "i386-pc-linux-gnu"
|
||||
|
||||
|
|
|
@ -1,9 +0,0 @@
|
|||
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;
|
||||
}
|
|
@ -1,6 +1,16 @@
|
|||
;RUN: opt %loadPolly -polly-import-jscop -polly-import-jscop-dir=%S -polly-import-jscop-postfix=transformed+withconst -polly-codegen %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 %s -S | FileCheck -check-prefix=WITHOUTCONST %s
|
||||
; ModuleID = 'codegen_simple_md.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"
|
||||
target triple = "i386-pc-linux-gnu"
|
||||
|
||||
|
|
|
@ -1,17 +0,0 @@
|
|||
int A[100];
|
||||
int B[100];
|
||||
|
||||
int simple()
|
||||
{
|
||||
int i, j;
|
||||
for (i = 0; i < 12; i++) {
|
||||
A[i] = i;
|
||||
}
|
||||
|
||||
for (i = 0; i < 12; i++) {
|
||||
B[i] = i;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -1,5 +1,23 @@
|
|||
;RUN: opt %loadPolly -polly-import-jscop -polly-import-jscop-dir=%S -polly-import-jscop-postfix=transformed -stats %s 2>&1 | FileCheck %s
|
||||
; ModuleID = 'simple.ll'
|
||||
|
||||
;int A[100];
|
||||
;int B[100];
|
||||
;
|
||||
;int simple()
|
||||
;{
|
||||
; int i, j;
|
||||
; for (i = 0; i < 12; i++) {
|
||||
; A[i] = i;
|
||||
; }
|
||||
;
|
||||
; for (i = 0; i < 12; i++) {
|
||||
; B[i] = i;
|
||||
; }
|
||||
;
|
||||
; 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"
|
||||
target triple = "i386-pc-linux-gnu"
|
||||
|
||||
|
|
|
@ -1,28 +0,0 @@
|
|||
/*
|
||||
* =============================================================================
|
||||
*
|
||||
* Filename: 20120330-argument-use.c
|
||||
*
|
||||
* Description: Polly OpenMP test case
|
||||
*
|
||||
* Test if the OpenMP subfunction uses the argument copy in
|
||||
* the OpenMP struct not the original one only available in
|
||||
* the original function.
|
||||
*
|
||||
* Run with -polly-codegen -enable-polly-openmp
|
||||
*
|
||||
* Author: Johannes Doerfert johannes@jdoerfert.de
|
||||
*
|
||||
* Created: 2012-03-30
|
||||
* Modified: 2012-03-30
|
||||
*
|
||||
* =============================================================================
|
||||
*/
|
||||
|
||||
void f(int * restrict A, int * restrict B, int n) {
|
||||
int i;
|
||||
|
||||
for (i = 0; i < n; i++) {
|
||||
A[i] = B[i] * 2;
|
||||
}
|
||||
}
|
|
@ -1,5 +1,34 @@
|
|||
; RUN: opt %loadPolly %defaultOpts -polly-codegen -enable-polly-openmp %s -S | FileCheck %s
|
||||
; ModuleID = '20120330-argument-lookup.s'
|
||||
|
||||
;/*
|
||||
; * =============================================================================
|
||||
; *
|
||||
; * Filename: 20120330-argument-use.c
|
||||
; *
|
||||
; * Description: Polly OpenMP test case
|
||||
; *
|
||||
; * Test if the OpenMP subfunction uses the argument copy in
|
||||
; * the OpenMP struct not the original one only available in
|
||||
; * the original function.
|
||||
; *
|
||||
; * Run with -polly-codegen -enable-polly-openmp
|
||||
; *
|
||||
; * Author: Johannes Doerfert johannes@jdoerfert.de
|
||||
; *
|
||||
; * Created: 2012-03-30
|
||||
; * Modified: 2012-03-30
|
||||
; *
|
||||
; * =============================================================================
|
||||
; */
|
||||
;
|
||||
;void f(int * restrict A, int * restrict B, int n) {
|
||||
; int i;
|
||||
;
|
||||
; for (i = 0; i < n; i++) {
|
||||
; A[i] = B[i] * 2;
|
||||
; }
|
||||
;}
|
||||
|
||||
target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128"
|
||||
target triple = "x86_64-unknown-linux-gnu"
|
||||
|
||||
|
|
|
@ -1,10 +0,0 @@
|
|||
#define N 10
|
||||
|
||||
void foo() {
|
||||
float A[N];
|
||||
|
||||
for (int i=0; i < N; i++)
|
||||
A[i] = 10;
|
||||
|
||||
return;
|
||||
}
|
|
@ -1,5 +1,16 @@
|
|||
; ModuleID = 'add_memref.s'
|
||||
; RUN: opt %loadPolly %defaultOpts -polly-codegen -enable-polly-openmp -disable-verify -S < %s | FileCheck %s
|
||||
|
||||
;#define N 10
|
||||
;
|
||||
;void foo() {
|
||||
; float A[N];
|
||||
;
|
||||
; for (int i=0; i < N; i++)
|
||||
; A[i] = 10;
|
||||
;
|
||||
; return;
|
||||
;}
|
||||
|
||||
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"
|
||||
target triple = "i386-pc-linux-gnu"
|
||||
|
||||
|
|
|
@ -1,17 +0,0 @@
|
|||
#define N 10
|
||||
|
||||
void foo() {
|
||||
float A[N];
|
||||
int i = 0;
|
||||
|
||||
for (i=0; i < N; i++)
|
||||
A[i] = 10;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
int main()
|
||||
{
|
||||
foo();
|
||||
}
|
|
@ -1,5 +1,23 @@
|
|||
; ModuleID = 'extract_memref.s'
|
||||
; RUN: opt %loadPolly %defaultOpts -polly-codegen -enable-polly-openmp -S < %s | FileCheck %s
|
||||
|
||||
;#define N 10
|
||||
;
|
||||
;void foo() {
|
||||
; float A[N];
|
||||
; int i = 0;
|
||||
;
|
||||
; for (i=0; i < N; i++)
|
||||
; A[i] = 10;
|
||||
;
|
||||
; return;
|
||||
;}
|
||||
;
|
||||
;
|
||||
;int main()
|
||||
;{
|
||||
; foo();
|
||||
;}
|
||||
|
||||
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"
|
||||
target triple = "i386-pc-linux-gnu"
|
||||
|
||||
|
|
|
@ -1,11 +0,0 @@
|
|||
#define N 500000
|
||||
float A[N];
|
||||
int main() {
|
||||
int j, k;
|
||||
|
||||
for(k = 0; k < N; k++)
|
||||
for (j = 0; j <= N; j++)
|
||||
A[j] = k;
|
||||
|
||||
return 0;
|
||||
}
|
|
@ -1,5 +1,17 @@
|
|||
; ModuleID = 'test.ll'
|
||||
; RUN: opt %loadPolly %defaultOpts -polly-codegen -enable-polly-openmp -analyze %s -debug-only=polly-detect 2>&1 | not FileCheck %s
|
||||
|
||||
;#define N 500000
|
||||
;float A[N];
|
||||
;int main() {
|
||||
; int j, k;
|
||||
;
|
||||
; for(k = 0; k < N; k++)
|
||||
; for (j = 0; j <= N; j++)
|
||||
; A[j] = k;
|
||||
;
|
||||
; 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"
|
||||
target triple = "i386-pc-linux-gnu"
|
||||
|
||||
|
|
|
@ -1,21 +0,0 @@
|
|||
#define M 1024
|
||||
#define N 1024
|
||||
#define K 1024
|
||||
|
||||
float A[M][K], B[K][N], C[M][N], X[K];
|
||||
|
||||
float parallel_loop() {
|
||||
int i, j, k;
|
||||
|
||||
for (i = 0; i < M; i++)
|
||||
for (j = 0; j< N; j++)
|
||||
for (k = 0; k < K; k++)
|
||||
C[i][j] += A[i][k] * B[k][j];
|
||||
|
||||
for (i = 0; i < M; i++)
|
||||
for (j = 0; j < N; j++)
|
||||
for (k = 0; k < K; k++)
|
||||
X[k] += X[k];
|
||||
|
||||
return C[42][42] + X[42];
|
||||
}
|
|
@ -1,8 +1,30 @@
|
|||
; ModuleID = 'parallel_loop.s'
|
||||
; RUN: opt %loadPolly %defaultOpts -polly-cloog -polly-codegen -enable-polly-openmp -analyze < %s | FileCheck %s
|
||||
; RUN: opt %loadPolly %defaultOpts -polly-import-jscop -polly-import-jscop-dir=%S -polly-cloog -polly-codegen -enable-polly-openmp -analyze < %s | FileCheck -check-prefix=IMPORT %s
|
||||
; RUN: opt %loadPolly %defaultOpts -polly-import-jscop -polly-import-jscop-dir=%S -polly-cloog -polly-codegen -enable-polly-openmp -analyze < %s | FileCheck -check-prefix=IMPORT %s
|
||||
; RUN: opt %loadPolly %defaultOpts -polly-import-jscop -polly-import-jscop-postfix=tiled -polly-import-jscop-dir=%S -polly-cloog -polly-codegen -enable-polly-openmp -analyze -disable-polly-legality < %s | FileCheck -check-prefix=TILED %s
|
||||
|
||||
;#define M 1024
|
||||
;#define N 1024
|
||||
;#define K 1024
|
||||
;
|
||||
;float A[M][K], B[K][N], C[M][N], X[K];
|
||||
;
|
||||
;float parallel_loop() {
|
||||
; int i, j, k;
|
||||
;
|
||||
; for (i = 0; i < M; i++)
|
||||
; for (j = 0; j< N; j++)
|
||||
; for (k = 0; k < K; k++)
|
||||
; C[i][j] += A[i][k] * B[k][j];
|
||||
;
|
||||
; for (i = 0; i < M; i++)
|
||||
; for (j = 0; j < N; j++)
|
||||
; for (k = 0; k < K; k++)
|
||||
; X[k] += X[k];
|
||||
;
|
||||
; return C[42][42] + X[42];
|
||||
;}
|
||||
|
||||
target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64"
|
||||
target triple = "x86_64-unknown-linux-gnu"
|
||||
|
||||
|
|
|
@ -1,15 +0,0 @@
|
|||
#define M 1024
|
||||
#define N 1024
|
||||
#define K 1024
|
||||
|
||||
float X[K];
|
||||
|
||||
float parallel_loop_simple() {
|
||||
int i, k;
|
||||
|
||||
for (i = 0; i < M; i++)
|
||||
for (k = 0; k < K; k++)
|
||||
X[k] += X[k];
|
||||
|
||||
return X[42];
|
||||
}
|
|
@ -1,5 +1,21 @@
|
|||
; ModuleID = 'parallel_loop_simple.s'
|
||||
; RUN: opt %loadPolly %defaultOpts -polly-cloog -polly-codegen -enable-polly-openmp -analyze < %s | FileCheck %s
|
||||
|
||||
;#define M 1024
|
||||
;#define N 1024
|
||||
;#define K 1024
|
||||
;
|
||||
;float X[K];
|
||||
;
|
||||
;float parallel_loop_simple() {
|
||||
; int i, k;
|
||||
;
|
||||
; for (i = 0; i < M; i++)
|
||||
; for (k = 0; k < K; k++)
|
||||
; X[k] += X[k];
|
||||
;
|
||||
; return X[42];
|
||||
;}
|
||||
|
||||
target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64"
|
||||
target triple = "x86_64-unknown-linux-gnu"
|
||||
|
||||
|
|
|
@ -1,15 +0,0 @@
|
|||
#define N 1024
|
||||
|
||||
float C[N], X[N];
|
||||
|
||||
float parallel_loop_simple2() {
|
||||
int j;
|
||||
|
||||
for (j = 0; j < N; j++)
|
||||
C[j] = j;
|
||||
|
||||
for (j = 0; j < N; j++)
|
||||
X[j] += X[j];
|
||||
|
||||
return C[42] + X[42];
|
||||
}
|
|
@ -1,5 +1,21 @@
|
|||
; ModuleID = 'parallel_loop_simple2.s'
|
||||
; RUN: opt %loadPolly %defaultOpts -polly-cloog -polly-codegen -enable-polly-openmp -analyze < %s | FileCheck %s
|
||||
|
||||
;#define N 1024
|
||||
;
|
||||
;float C[N], X[N];
|
||||
;
|
||||
;float parallel_loop_simple2() {
|
||||
; int j;
|
||||
;
|
||||
; for (j = 0; j < N; j++)
|
||||
; C[j] = j;
|
||||
;
|
||||
; for (j = 0; j < N; j++)
|
||||
; X[j] += X[j];
|
||||
;
|
||||
; return C[42] + X[42];
|
||||
;}
|
||||
|
||||
target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64"
|
||||
target triple = "x86_64-unknown-linux-gnu"
|
||||
|
||||
|
|
|
@ -1,22 +0,0 @@
|
|||
#include <string.h>
|
||||
#define N 10
|
||||
|
||||
double A[N];
|
||||
double B[N];
|
||||
|
||||
void loop_openmp() {
|
||||
for (int i = 0; i < N; i++) {
|
||||
for (int j = 0; j < N; j++) {
|
||||
A[j] += j;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int main () {
|
||||
memset(A, 0, sizeof(float) * N);
|
||||
|
||||
loop_openmp();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -1,5 +1,28 @@
|
|||
; ModuleID = 'simple_nested_loop.s'
|
||||
; RUN: opt %loadPolly %defaultOpts -polly-codegen -enable-polly-openmp -verify-dom-info -S %s | FileCheck %s
|
||||
|
||||
;#include <string.h>
|
||||
;#define N 10
|
||||
;
|
||||
;double A[N];
|
||||
;double B[N];
|
||||
;
|
||||
;void loop_openmp() {
|
||||
; for (int i = 0; i < N; i++) {
|
||||
; for (int j = 0; j < N; j++) {
|
||||
; A[j] += j;
|
||||
; }
|
||||
; }
|
||||
;}
|
||||
;
|
||||
;int main () {
|
||||
; memset(A, 0, sizeof(float) * N);
|
||||
;
|
||||
; loop_openmp();
|
||||
;
|
||||
; 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"
|
||||
target triple = "i386-pc-linux-gnu"
|
||||
|
||||
|
|
|
@ -1,26 +0,0 @@
|
|||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#define N 5
|
||||
|
||||
float A[N];
|
||||
float B[N];
|
||||
|
||||
void loop1_openmp() {
|
||||
for (int i = 0; i <= N; i++)
|
||||
A[i] = 0;
|
||||
|
||||
for (int j = 0; j <= N; j++)
|
||||
for (int k = 0; k <= N; k++)
|
||||
B[k] += j;
|
||||
}
|
||||
|
||||
int main () {
|
||||
int i;
|
||||
memset(A, 0, sizeof(float) * N);
|
||||
memset(B, 0, sizeof(float) * N);
|
||||
|
||||
loop1_openmp();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -1,4 +1,32 @@
|
|||
; RUN: opt %loadPolly %defaultOpts -polly-codegen -enable-polly-openmp -S %s | FileCheck %s
|
||||
|
||||
;#include <string.h>
|
||||
;#include <stdio.h>
|
||||
;#define N 5
|
||||
;
|
||||
;float A[N];
|
||||
;float B[N];
|
||||
;
|
||||
;void loop1_openmp() {
|
||||
; for (int i = 0; i <= N; i++)
|
||||
; A[i] = 0;
|
||||
;
|
||||
; for (int j = 0; j <= N; j++)
|
||||
; for (int k = 0; k <= N; k++)
|
||||
; B[k] += j;
|
||||
;}
|
||||
;
|
||||
;int main () {
|
||||
; int i;
|
||||
; memset(A, 0, sizeof(float) * N);
|
||||
; memset(B, 0, sizeof(float) * N);
|
||||
;
|
||||
; loop1_openmp();
|
||||
;
|
||||
; 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"
|
||||
target triple = "i386-pc-linux-gnu"
|
||||
|
||||
|
|
|
@ -1,24 +0,0 @@
|
|||
#include <string.h>
|
||||
#define N 10240000
|
||||
|
||||
float A[N];
|
||||
float B[N];
|
||||
|
||||
void loop1_openmp() {
|
||||
for (int i = 0; i <= N; i++)
|
||||
A[i] = 0;
|
||||
for (int j = 0; j <= N; j++)
|
||||
B[j] = 0;
|
||||
}
|
||||
|
||||
|
||||
int main () {
|
||||
int i;
|
||||
memset(A, 0, sizeof(float) * N);
|
||||
memset(B, 1, sizeof(float) * N);
|
||||
|
||||
loop1_openmp();
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -1,5 +1,30 @@
|
|||
; ModuleID = 'two_loop.s'
|
||||
; RUN: opt %loadPolly %defaultOpts -mem2reg -polly-codegen -enable-polly-openmp -S < %s
|
||||
|
||||
;#include <string.h>
|
||||
;#define N 10240000
|
||||
;
|
||||
;float A[N];
|
||||
;float B[N];
|
||||
;
|
||||
;void loop1_openmp() {
|
||||
; for (int i = 0; i <= N; i++)
|
||||
; A[i] = 0;
|
||||
; for (int j = 0; j <= N; j++)
|
||||
; B[j] = 0;
|
||||
;}
|
||||
;
|
||||
;
|
||||
;int main () {
|
||||
; int i;
|
||||
; memset(A, 0, sizeof(float) * N);
|
||||
; memset(B, 1, sizeof(float) * N);
|
||||
;
|
||||
; loop1_openmp();
|
||||
;
|
||||
; 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"
|
||||
target triple = "i386-pc-linux-gnu"
|
||||
|
||||
|
|
|
@ -1,23 +0,0 @@
|
|||
#include <string.h>
|
||||
int A[1];
|
||||
|
||||
void constant_condition () {
|
||||
int a = 0;
|
||||
int b = 0;
|
||||
|
||||
if (a == b)
|
||||
A[0] = 0;
|
||||
else
|
||||
A[0] = 1;
|
||||
}
|
||||
|
||||
int main () {
|
||||
int i;
|
||||
|
||||
A[0] = 2;
|
||||
|
||||
constant_condition();
|
||||
|
||||
return A[0];
|
||||
}
|
||||
|
|
@ -1,4 +1,28 @@
|
|||
;RUN: opt %loadPolly %defaultOpts -polly-cloog -analyze %s | FileCheck %s
|
||||
|
||||
;#include <string.h>
|
||||
;int A[1];
|
||||
;
|
||||
;void constant_condition () {
|
||||
; int a = 0;
|
||||
; int b = 0;
|
||||
;
|
||||
; if (a == b)
|
||||
; A[0] = 0;
|
||||
; else
|
||||
; A[0] = 1;
|
||||
;}
|
||||
;
|
||||
;int main () {
|
||||
; int i;
|
||||
;
|
||||
; A[0] = 2;
|
||||
;
|
||||
; constant_condition();
|
||||
;
|
||||
; return A[0];
|
||||
;}
|
||||
|
||||
target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64"
|
||||
target triple = "x86_64-unknown-linux-gnu"
|
||||
@A = common global [1 x i32] zeroinitializer, align 4 ; <[1 x i32]*> [#uses=1]
|
||||
|
|
|
@ -1,74 +0,0 @@
|
|||
#define M 36
|
||||
#define N 36
|
||||
#define K 36
|
||||
#define alpha 1
|
||||
#define beta 1
|
||||
double A[M][K+13];
|
||||
double B[K][N+13];
|
||||
double C[M][N+13];
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
void init_array()
|
||||
{
|
||||
int i, j;
|
||||
|
||||
for (i=0; i<N; i++) {
|
||||
for (j=0; j<N; j++) {
|
||||
A[i][j] = (i + j);
|
||||
// We do not want to optimize this.
|
||||
__sync_synchronize();
|
||||
B[i][j] = (double)(i*j);
|
||||
C[i][j] = 0.0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void print_array()
|
||||
{
|
||||
int i, j;
|
||||
|
||||
for (i=0; i<N; i++) {
|
||||
for (j=0; j<N; j++) {
|
||||
fprintf(stdout, "%lf ", C[i][j]);
|
||||
if (j%80 == 79) fprintf(stdout, "\n");
|
||||
}
|
||||
fprintf(stdout, "\n");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void do_pluto_matmult(void) {
|
||||
int i, j, k;
|
||||
|
||||
__sync_synchronize();
|
||||
i = 0;
|
||||
do {
|
||||
j = 0;
|
||||
do {
|
||||
k = 0;
|
||||
do {
|
||||
C[i][j] = beta*C[i][j] + alpha*A[i][k] * B[k][j];
|
||||
++k;
|
||||
} while (k < K);
|
||||
++j;
|
||||
} while (j < N);
|
||||
++i;
|
||||
} while (i < M);
|
||||
__sync_synchronize();
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
register double s;
|
||||
|
||||
init_array();
|
||||
|
||||
#pragma scop
|
||||
do_pluto_matmult();
|
||||
#pragma endscop
|
||||
print_array();
|
||||
|
||||
return 0;
|
||||
}
|
|
@ -1,4 +1,80 @@
|
|||
; RUN: opt %loadPolly %defaultOpts -polly-cloog -analyze %s | FileCheck %s
|
||||
|
||||
;#define M 36
|
||||
;#define N 36
|
||||
;#define K 36
|
||||
;#define alpha 1
|
||||
;#define beta 1
|
||||
;double A[M][K+13];
|
||||
;double B[K][N+13];
|
||||
;double C[M][N+13];
|
||||
;
|
||||
;#include <stdio.h>
|
||||
;
|
||||
;void init_array()
|
||||
;{
|
||||
; int i, j;
|
||||
;
|
||||
; for (i=0; i<N; i++) {
|
||||
; for (j=0; j<N; j++) {
|
||||
; A[i][j] = (i + j);
|
||||
; // We do not want to optimize this.
|
||||
; __sync_synchronize();
|
||||
; B[i][j] = (double)(i*j);
|
||||
; C[i][j] = 0.0;
|
||||
; }
|
||||
; }
|
||||
;}
|
||||
;
|
||||
;
|
||||
;void print_array()
|
||||
;{
|
||||
; int i, j;
|
||||
;
|
||||
; for (i=0; i<N; i++) {
|
||||
; for (j=0; j<N; j++) {
|
||||
; fprintf(stdout, "%lf ", C[i][j]);
|
||||
; if (j%80 == 79) fprintf(stdout, "\n");
|
||||
; }
|
||||
; fprintf(stdout, "\n");
|
||||
; }
|
||||
;}
|
||||
;
|
||||
;
|
||||
;void do_pluto_matmult(void) {
|
||||
; int i, j, k;
|
||||
;
|
||||
; __sync_synchronize();
|
||||
; i = 0;
|
||||
; do {
|
||||
; j = 0;
|
||||
; do {
|
||||
; k = 0;
|
||||
; do {
|
||||
; C[i][j] = beta*C[i][j] + alpha*A[i][k] * B[k][j];
|
||||
; ++k;
|
||||
; } while (k < K);
|
||||
; ++j;
|
||||
; } while (j < N);
|
||||
; ++i;
|
||||
; } while (i < M);
|
||||
; __sync_synchronize();
|
||||
;}
|
||||
;
|
||||
;int main()
|
||||
;{
|
||||
; register double s;
|
||||
;
|
||||
; init_array();
|
||||
;
|
||||
;#pragma scop
|
||||
; do_pluto_matmult();
|
||||
;#pragma endscop
|
||||
; print_array();
|
||||
;
|
||||
; return 0;
|
||||
;}
|
||||
|
||||
; RUN: opt %loadPolly %defaultOpts -polly-codegen -disable-output %s
|
||||
; RUN: opt %loadPolly %defaultOpts -polly-import-jscop -polly-import-jscop-dir=%S -polly-cloog -analyze %s | FileCheck -check-prefix=IMPORT %s
|
||||
; RUN: opt %loadPolly %defaultOpts -polly-import-jscop -polly-import-jscop-dir=%S -polly-import-jscop-postfix=valid_reverse -polly-cloog -analyze %s | FileCheck -check-prefix=REVERSE %s > /dev/null
|
||||
|
|
|
@ -1,39 +0,0 @@
|
|||
#include <string.h>
|
||||
#define N 1024
|
||||
int A[N];
|
||||
int B[N];
|
||||
|
||||
void loop_with_condition() {
|
||||
int i;
|
||||
|
||||
__sync_synchronize();
|
||||
for (i = 0; i < N; i++) {
|
||||
if (i <= N / 2)
|
||||
A[i] = 1;
|
||||
else
|
||||
A[i] = 2;
|
||||
B[i] = 3;
|
||||
}
|
||||
__sync_synchronize();
|
||||
}
|
||||
|
||||
int main () {
|
||||
int i;
|
||||
|
||||
memset(A, 0, sizeof(int) * N);
|
||||
memset(B, 0, sizeof(int) * N);
|
||||
|
||||
loop_with_condition();
|
||||
|
||||
for (i = 0; i < N; i++)
|
||||
if (B[i] != 3)
|
||||
return 1;
|
||||
|
||||
for (i = 0; i < N; i++)
|
||||
if (i <= N / 2 && A[i] != 1)
|
||||
return 1;
|
||||
else if (i > N / 2 && A[i] != 2)
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -1,5 +1,44 @@
|
|||
; RUN: opt %loadPolly %defaultOpts -polly-cloog -analyze %s | FileCheck %s
|
||||
|
||||
;#include <string.h>
|
||||
;#define N 1024
|
||||
;int A[N];
|
||||
;int B[N];
|
||||
;
|
||||
;void loop_with_condition() {
|
||||
; int i;
|
||||
;
|
||||
; __sync_synchronize();
|
||||
; for (i = 0; i < N; i++) {
|
||||
; if (i <= N / 2)
|
||||
; A[i] = 1;
|
||||
; else
|
||||
; A[i] = 2;
|
||||
; B[i] = 3;
|
||||
; }
|
||||
; __sync_synchronize();
|
||||
;}
|
||||
;
|
||||
;int main () {
|
||||
; int i;
|
||||
;
|
||||
; memset(A, 0, sizeof(int) * N);
|
||||
; memset(B, 0, sizeof(int) * N);
|
||||
;
|
||||
; loop_with_condition();
|
||||
;
|
||||
; for (i = 0; i < N; i++)
|
||||
; if (B[i] != 3)
|
||||
; return 1;
|
||||
;
|
||||
; for (i = 0; i < N; i++)
|
||||
; if (i <= N / 2 && A[i] != 1)
|
||||
; return 1;
|
||||
; else if (i > N / 2 && A[i] != 2)
|
||||
; return 1;
|
||||
; return 0;
|
||||
;}
|
||||
|
||||
target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64"
|
||||
target triple = "x86_64-pc-linux-gnu"
|
||||
|
||||
|
|
|
@ -1,39 +0,0 @@
|
|||
#include <string.h>
|
||||
#define N 1024
|
||||
int A[N];
|
||||
int B[N];
|
||||
|
||||
void loop_with_condition_ineq() {
|
||||
int i;
|
||||
|
||||
__sync_synchronize();
|
||||
for (i = 0; i < N; i++) {
|
||||
if (i != N / 2)
|
||||
A[i] = 1;
|
||||
else
|
||||
A[i] = 2;
|
||||
B[i] = 3;
|
||||
}
|
||||
__sync_synchronize();
|
||||
}
|
||||
|
||||
int main () {
|
||||
int i;
|
||||
|
||||
memset(A, 0, sizeof(int) * N);
|
||||
memset(B, 0, sizeof(int) * N);
|
||||
|
||||
loop_with_condition_ineq();
|
||||
|
||||
for (i = 0; i < N; i++)
|
||||
if (B[i] != 3)
|
||||
return 1;
|
||||
|
||||
for (i = 0; i < N; i++)
|
||||
if (i != N / 2 && A[i] != 1)
|
||||
return 1;
|
||||
else if (i == N && A[i] != 2)
|
||||
return 1;
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -1,4 +1,44 @@
|
|||
; RUN: opt %loadPolly %defaultOpts -polly-cloog -analyze %s | FileCheck %s
|
||||
|
||||
;#include <string.h>
|
||||
;#define N 1024
|
||||
;int A[N];
|
||||
;int B[N];
|
||||
;
|
||||
;void loop_with_condition_ineq() {
|
||||
; int i;
|
||||
;
|
||||
; __sync_synchronize();
|
||||
; for (i = 0; i < N; i++) {
|
||||
; if (i != N / 2)
|
||||
; A[i] = 1;
|
||||
; else
|
||||
; A[i] = 2;
|
||||
; B[i] = 3;
|
||||
; }
|
||||
; __sync_synchronize();
|
||||
;}
|
||||
;
|
||||
;int main () {
|
||||
; int i;
|
||||
;
|
||||
; memset(A, 0, sizeof(int) * N);
|
||||
; memset(B, 0, sizeof(int) * N);
|
||||
;
|
||||
; loop_with_condition_ineq();
|
||||
;
|
||||
; for (i = 0; i < N; i++)
|
||||
; if (B[i] != 3)
|
||||
; return 1;
|
||||
;
|
||||
; for (i = 0; i < N; i++)
|
||||
; if (i != N / 2 && A[i] != 1)
|
||||
; return 1;
|
||||
; else if (i == N && A[i] != 2)
|
||||
; return 1;
|
||||
; return 0;
|
||||
;}
|
||||
|
||||
target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64"
|
||||
target triple = "x86_64-pc-linux-gnu"
|
||||
|
||||
|
|
|
@ -1,45 +0,0 @@
|
|||
#include <string.h>
|
||||
#define N 1024
|
||||
int A[N];
|
||||
int B[N];
|
||||
|
||||
void loop_with_condition() {
|
||||
int i;
|
||||
|
||||
__sync_synchronize();
|
||||
for (i = 0; i < N; i++) {
|
||||
if (i <= N / 2) {
|
||||
if (i > 20)
|
||||
A[i] = 1;
|
||||
else
|
||||
A[i] = 2;
|
||||
}
|
||||
B[i] = 3;
|
||||
}
|
||||
__sync_synchronize();
|
||||
}
|
||||
|
||||
int main () {
|
||||
int i;
|
||||
|
||||
memset(A, 0, sizeof(int) * N);
|
||||
memset(B, 0, sizeof(int) * N);
|
||||
|
||||
loop_with_condition();
|
||||
|
||||
for (i = 0; i < N; i++)
|
||||
if (B[i] != 3)
|
||||
return 1;
|
||||
|
||||
for (i = 0; i < N; i++)
|
||||
if (i <= N / 2 && i > 20 && A[i] != 1)
|
||||
return 1;
|
||||
else if (i > N / 2) {
|
||||
if (i <= 20 && A[i] != 2)
|
||||
return 1;
|
||||
if (i > 20 && A[i] != 0)
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -1,4 +1,50 @@
|
|||
; RUN: opt %loadPolly %defaultOpts -polly-cloog -analyze %s | FileCheck %s
|
||||
|
||||
;#include <string.h>
|
||||
;#define N 1024
|
||||
;int A[N];
|
||||
;int B[N];
|
||||
;
|
||||
;void loop_with_condition() {
|
||||
; int i;
|
||||
;
|
||||
; __sync_synchronize();
|
||||
; for (i = 0; i < N; i++) {
|
||||
; if (i <= N / 2) {
|
||||
; if (i > 20)
|
||||
; A[i] = 1;
|
||||
; else
|
||||
; A[i] = 2;
|
||||
; }
|
||||
; B[i] = 3;
|
||||
; }
|
||||
; __sync_synchronize();
|
||||
;}
|
||||
;
|
||||
;int main () {
|
||||
; int i;
|
||||
;
|
||||
; memset(A, 0, sizeof(int) * N);
|
||||
; memset(B, 0, sizeof(int) * N);
|
||||
;
|
||||
; loop_with_condition();
|
||||
;
|
||||
; for (i = 0; i < N; i++)
|
||||
; if (B[i] != 3)
|
||||
; return 1;
|
||||
;
|
||||
; for (i = 0; i < N; i++)
|
||||
; if (i <= N / 2 && i > 20 && A[i] != 1)
|
||||
; return 1;
|
||||
; else if (i > N / 2) {
|
||||
; if (i <= 20 && A[i] != 2)
|
||||
; return 1;
|
||||
; if (i > 20 && A[i] != 0)
|
||||
; return 1;
|
||||
; }
|
||||
; return 0;
|
||||
;}
|
||||
|
||||
; ModuleID = 'loop_with_condition_nested.s'
|
||||
target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64"
|
||||
target triple = "x86_64-pc-linux-gnu"
|
||||
|
|
|
@ -1,46 +0,0 @@
|
|||
#define M 1024
|
||||
#define N 1024
|
||||
#define K 1024
|
||||
float A[K][M];
|
||||
float B[N][K];
|
||||
float C[M][N];
|
||||
/*
|
||||
void matmul_vec(void) {
|
||||
int i, j, k;
|
||||
|
||||
|
||||
/* With much unrolling
|
||||
for (i=0;i<=M;i++)
|
||||
for (j=0;j<=N;j+=4)
|
||||
for (k=0;k<=K;k+=8)
|
||||
for (kk=k;kk<=k+7;kk++)
|
||||
for (jj=j;jj<=j+3;jj++)
|
||||
C[i][jj] += A[kk][i] * B[jj][kk];
|
||||
vec_load splat scalar_load
|
||||
*/
|
||||
/* Without unrolling
|
||||
for (i=0;i<=M;i++)
|
||||
for (j=0;j<=N;j+=4)
|
||||
for (k=0;k<=K;k++)
|
||||
for (jj=j;jj<=j+3;jj++)
|
||||
C[i][jj] += A[k][i] * B[jj][kk];
|
||||
vec_load splat scalar_load
|
||||
/
|
||||
|
||||
}
|
||||
i*/
|
||||
int main()
|
||||
{
|
||||
int i, j, k;
|
||||
//matmul_vec();
|
||||
for(i=0; i<M/4; i++)
|
||||
for(k=0; k<K; k++) {
|
||||
for(j=0; j<N; j++)
|
||||
C[i+0][j] += A[k][i+0] * B[j][k];
|
||||
C[i+1][j] += A[k][i+1] * B[j][k];
|
||||
C[i+2][j] += A[k][i+2] * B[j][k];
|
||||
C[i+3][j] += A[k][i+3] * B[j][k];
|
||||
}
|
||||
|
||||
return A[42][42];
|
||||
}
|
|
@ -1,5 +1,52 @@
|
|||
; RUN: opt %loadPolly %defaultOpts -polly-import-jscop -polly-import-jscop-dir=%S -polly-codegen %vector-opt -S -dce %s | FileCheck %s
|
||||
|
||||
;#define M 1024
|
||||
;#define N 1024
|
||||
;#define K 1024
|
||||
;float A[K][M];
|
||||
;float B[N][K];
|
||||
;float C[M][N];
|
||||
;/*
|
||||
;void matmul_vec(void) {
|
||||
; int i, j, k;
|
||||
;
|
||||
;
|
||||
; /* With much unrolling
|
||||
; for (i=0;i<=M;i++)
|
||||
; for (j=0;j<=N;j+=4)
|
||||
; for (k=0;k<=K;k+=8)
|
||||
; for (kk=k;kk<=k+7;kk++)
|
||||
; for (jj=j;jj<=j+3;jj++)
|
||||
; C[i][jj] += A[kk][i] * B[jj][kk];
|
||||
; vec_load splat scalar_load
|
||||
; */
|
||||
; /* Without unrolling
|
||||
; for (i=0;i<=M;i++)
|
||||
; for (j=0;j<=N;j+=4)
|
||||
; for (k=0;k<=K;k++)
|
||||
; for (jj=j;jj<=j+3;jj++)
|
||||
; C[i][jj] += A[k][i] * B[jj][kk];
|
||||
; vec_load splat scalar_load
|
||||
; /
|
||||
;
|
||||
;}
|
||||
;i*/
|
||||
;int main()
|
||||
;{
|
||||
; int i, j, k;
|
||||
; //matmul_vec();
|
||||
; for(i=0; i<M/4; i++)
|
||||
; for(k=0; k<K; k++) {
|
||||
; for(j=0; j<N; j++)
|
||||
; C[i+0][j] += A[k][i+0] * B[j][k];
|
||||
; C[i+1][j] += A[k][i+1] * B[j][k];
|
||||
; C[i+2][j] += A[k][i+2] * B[j][k];
|
||||
; C[i+3][j] += A[k][i+3] * B[j][k];
|
||||
; }
|
||||
;
|
||||
; return A[42][42];
|
||||
;}
|
||||
|
||||
; ModuleID = 'matmul_vec.s'
|
||||
target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64"
|
||||
target triple = "x86_64-unknown-linux-gnu"
|
||||
|
|
|
@ -1,36 +0,0 @@
|
|||
#define M 2048
|
||||
#define N 2048
|
||||
#define K 2048
|
||||
#define alpha 1
|
||||
#define beta 1
|
||||
double A[M][K+13];
|
||||
double B[K][N+13];
|
||||
double C[M][N+13];
|
||||
|
||||
void init_array();
|
||||
void print_array();
|
||||
|
||||
void pluto_matmult(void) {
|
||||
int i, j, k;
|
||||
|
||||
__sync_synchronize();
|
||||
for(i=0; i<M; i++)
|
||||
for(j=0; j<N; j++)
|
||||
for(k=0; k<K; k++)
|
||||
C[i][j] = beta*C[i][j] + alpha*A[i][k] * B[k][j];
|
||||
__sync_synchronize();
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
register double s;
|
||||
|
||||
init_array();
|
||||
|
||||
#pragma scop
|
||||
pluto_matmult();
|
||||
#pragma endscop
|
||||
print_array();
|
||||
|
||||
return 0;
|
||||
}
|
|
@ -1,7 +1,44 @@
|
|||
; RUN: opt %loadPolly %defaultOpts -polly-cloog -analyze %s | FileCheck %s
|
||||
; RUN: opt %loadPolly %defaultOpts -polly-codegen %s > /dev/null
|
||||
; RUN: opt %loadPolly %defaultOpts -polly-import-jscop -polly-import-jscop-dir=%S -polly-cloog -analyze -S %s | FileCheck -check-prefix=IMPORT %s
|
||||
; ModuleID = 'pluto-matmul.s'
|
||||
|
||||
;#define M 2048
|
||||
;#define N 2048
|
||||
;#define K 2048
|
||||
;#define alpha 1
|
||||
;#define beta 1
|
||||
;double A[M][K+13];
|
||||
;double B[K][N+13];
|
||||
;double C[M][N+13];
|
||||
;
|
||||
;void init_array();
|
||||
;void print_array();
|
||||
;
|
||||
;void pluto_matmult(void) {
|
||||
; int i, j, k;
|
||||
;
|
||||
; __sync_synchronize();
|
||||
; for(i=0; i<M; i++)
|
||||
; for(j=0; j<N; j++)
|
||||
; for(k=0; k<K; k++)
|
||||
; C[i][j] = beta*C[i][j] + alpha*A[i][k] * B[k][j];
|
||||
; __sync_synchronize();
|
||||
;}
|
||||
;
|
||||
;int main()
|
||||
;{
|
||||
; register double s;
|
||||
;
|
||||
; init_array();
|
||||
;
|
||||
;#pragma scop
|
||||
; pluto_matmult();
|
||||
;#pragma endscop
|
||||
; print_array();
|
||||
;
|
||||
; return 0;
|
||||
;}
|
||||
|
||||
target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64"
|
||||
target triple = "x86_64-unknown-linux-gnu"
|
||||
|
||||
|
|
|
@ -1,27 +0,0 @@
|
|||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#define N 1021
|
||||
|
||||
int main () {
|
||||
int i;
|
||||
int A[N];
|
||||
int red;
|
||||
|
||||
memset(A, 0, sizeof(int) * N);
|
||||
|
||||
A[0] = 1;
|
||||
A[1] = 1;
|
||||
red = 0;
|
||||
|
||||
__sync_synchronize();
|
||||
|
||||
for (i = 2; i < N; i++) {
|
||||
A[i] = A[i-1] + A[i-2];
|
||||
red += A[i-2];
|
||||
}
|
||||
|
||||
__sync_synchronize();
|
||||
|
||||
if (red != 382399368)
|
||||
return 1;
|
||||
}
|
|
@ -1,4 +1,33 @@
|
|||
; RUN: opt %loadPolly %defaultOpts -polly-codegen -S %s 2>&1 | not FileCheck %s
|
||||
|
||||
;#include <string.h>
|
||||
;#include <stdio.h>
|
||||
;#define N 1021
|
||||
;
|
||||
;int main () {
|
||||
; int i;
|
||||
; int A[N];
|
||||
; int red;
|
||||
;
|
||||
; memset(A, 0, sizeof(int) * N);
|
||||
;
|
||||
; A[0] = 1;
|
||||
; A[1] = 1;
|
||||
; red = 0;
|
||||
;
|
||||
; __sync_synchronize();
|
||||
;
|
||||
; for (i = 2; i < N; i++) {
|
||||
; A[i] = A[i-1] + A[i-2];
|
||||
; red += A[i-2];
|
||||
; }
|
||||
;
|
||||
; __sync_synchronize();
|
||||
;
|
||||
; if (red != 382399368)
|
||||
; return 1;
|
||||
;}
|
||||
|
||||
target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64"
|
||||
target triple = "x86_64-pc-linux-gnu"
|
||||
|
||||
|
|
|
@ -1,23 +0,0 @@
|
|||
#include <string.h>
|
||||
#include <stdio.h>
|
||||
#define N 1021
|
||||
|
||||
int main () {
|
||||
int i;
|
||||
int A[N];
|
||||
int RED[1];
|
||||
|
||||
memset(A, 0, sizeof(int) * N);
|
||||
|
||||
A[0] = 1;
|
||||
A[1] = 1;
|
||||
RED[0] = 0;
|
||||
|
||||
for (i = 2; i < N; i++) {
|
||||
A[i] = A[i-1] + A[i-2];
|
||||
RED[0] += A[i-2];
|
||||
}
|
||||
|
||||
if (RED[0] != 382399368)
|
||||
return 1;
|
||||
}
|
|
@ -1,5 +1,29 @@
|
|||
; RUN: opt %loadPolly %defaultOpts -polly-cloog -analyze %s | FileCheck %s
|
||||
; ModuleID = 'reduction_2.s'
|
||||
|
||||
;#include <string.h>
|
||||
;#include <stdio.h>
|
||||
;#define N 1021
|
||||
;
|
||||
;int main () {
|
||||
; int i;
|
||||
; int A[N];
|
||||
; int RED[1];
|
||||
;
|
||||
; memset(A, 0, sizeof(int) * N);
|
||||
;
|
||||
; A[0] = 1;
|
||||
; A[1] = 1;
|
||||
; RED[0] = 0;
|
||||
;
|
||||
; for (i = 2; i < N; i++) {
|
||||
; A[i] = A[i-1] + A[i-2];
|
||||
; RED[0] += A[i-2];
|
||||
; }
|
||||
;
|
||||
; if (RED[0] != 382399368)
|
||||
; return 1;
|
||||
;}
|
||||
|
||||
target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64"
|
||||
target triple = "x86_64-unknown-linux-gnu"
|
||||
|
||||
|
|
|
@ -1,31 +0,0 @@
|
|||
#include <string.h>
|
||||
#define N 1024
|
||||
|
||||
int A[N];
|
||||
|
||||
void sequential_loops() {
|
||||
int i;
|
||||
for (i = 0; i < N/2; i++) {
|
||||
A[i] = 1;
|
||||
}
|
||||
for (i = N/2 ; i < N; i++) {
|
||||
A[i] = 2;
|
||||
}
|
||||
}
|
||||
|
||||
int main () {
|
||||
int i;
|
||||
memset(A, 0, sizeof(int) * N);
|
||||
|
||||
sequential_loops();
|
||||
|
||||
for (i = 0; i < N; i++) {
|
||||
if (A[i] != 1 && i < N/2)
|
||||
return 1;
|
||||
if (A[i] != 2 && i >= N/2)
|
||||
return 1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -1,4 +1,36 @@
|
|||
; RUN: opt %loadPolly %defaultOpts -polly-cloog -analyze %s | FileCheck %s
|
||||
|
||||
;#include <string.h>
|
||||
;#define N 1024
|
||||
;
|
||||
;int A[N];
|
||||
;
|
||||
;void sequential_loops() {
|
||||
; int i;
|
||||
; for (i = 0; i < N/2; i++) {
|
||||
; A[i] = 1;
|
||||
; }
|
||||
; for (i = N/2 ; i < N; i++) {
|
||||
; A[i] = 2;
|
||||
; }
|
||||
;}
|
||||
;
|
||||
;int main () {
|
||||
; int i;
|
||||
; memset(A, 0, sizeof(int) * N);
|
||||
;
|
||||
; sequential_loops();
|
||||
;
|
||||
; for (i = 0; i < N; i++) {
|
||||
; if (A[i] != 1 && i < N/2)
|
||||
; return 1;
|
||||
; if (A[i] != 2 && i >= N/2)
|
||||
; return 1;
|
||||
; }
|
||||
;
|
||||
; return 0;
|
||||
;}
|
||||
|
||||
; ModuleID = 'sequential_loops.s'
|
||||
target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64"
|
||||
target triple = "x86_64-pc-linux-gnu"
|
||||
|
|
|
@ -1,15 +0,0 @@
|
|||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <math.h>
|
||||
|
||||
int main()
|
||||
{
|
||||
int A[1024*1024];
|
||||
int i;
|
||||
for (i = 0; i < 1024; i++)
|
||||
A[i*i] = 2*i;
|
||||
|
||||
printf("Random Value: %d", A[rand() % 1024*1024]);
|
||||
|
||||
return 0;
|
||||
}
|
|
@ -1,4 +1,21 @@
|
|||
; RUN: opt %loadPolly %defaultOpts -O3 -polly-cloog -polly-allow-nonaffine -analyze %s | FileCheck %s
|
||||
|
||||
;#include <stdio.h>
|
||||
;#include <stdlib.h>
|
||||
;#include <math.h>
|
||||
;
|
||||
;int main()
|
||||
;{
|
||||
; int A[1024*1024];
|
||||
; int i;
|
||||
; for (i = 0; i < 1024; i++)
|
||||
; A[i*i] = 2*i;
|
||||
;
|
||||
; printf("Random Value: %d", A[rand() % 1024*1024]);
|
||||
;
|
||||
; return 0;
|
||||
;}
|
||||
|
||||
; ModuleID = 'simple_nonaffine_loop.c'
|
||||
target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64-S128"
|
||||
target triple = "x86_64-apple-macosx10.7.2"
|
||||
|
|
|
@ -1,15 +0,0 @@
|
|||
#define N 1024
|
||||
float A[N];
|
||||
float B[N];
|
||||
|
||||
void simple_vec_const(void) {
|
||||
int i;
|
||||
|
||||
for (i = 0; i < 4; i++)
|
||||
B[i] = A[i] + 1;
|
||||
}
|
||||
int main()
|
||||
{
|
||||
simple_vec_const();
|
||||
return A[42];
|
||||
}
|
|
@ -1,5 +1,21 @@
|
|||
; RUN: opt %loadPolly %defaultOpts -polly-codegen %vector-opt -dce -S %s | FileCheck %s
|
||||
; ModuleID = 'simple_vec_assign_scalar.s'
|
||||
|
||||
;#define N 1024
|
||||
;float A[N];
|
||||
;float B[N];
|
||||
;
|
||||
;void simple_vec_const(void) {
|
||||
; int i;
|
||||
;
|
||||
; for (i = 0; i < 4; i++)
|
||||
; B[i] = A[i] + 1;
|
||||
;}
|
||||
;int main()
|
||||
;{
|
||||
; simple_vec_const();
|
||||
; return A[42];
|
||||
;}
|
||||
|
||||
target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64"
|
||||
target triple = "x86_64-unknown-linux-gnu"
|
||||
|
||||
|
|
|
@ -1,15 +0,0 @@
|
|||
#define N 1024
|
||||
float A[N];
|
||||
float B[N];
|
||||
|
||||
void simple_vec_const(void) {
|
||||
int i;
|
||||
|
||||
for (i = 0; i < 4; i++)
|
||||
B[i] = A[i] + i;
|
||||
}
|
||||
int main()
|
||||
{
|
||||
simple_vec_const();
|
||||
return A[42];
|
||||
}
|
|
@ -1,4 +1,21 @@
|
|||
; RUN: opt %loadPolly %defaultOpts -polly-codegen %vector-opt -dce -S %s | FileCheck %s
|
||||
|
||||
;#define N 1024
|
||||
;float A[N];
|
||||
;float B[N];
|
||||
;
|
||||
;void simple_vec_const(void) {
|
||||
; int i;
|
||||
;
|
||||
; for (i = 0; i < 4; i++)
|
||||
; B[i] = A[i] + i;
|
||||
;}
|
||||
;int main()
|
||||
;{
|
||||
; simple_vec_const();
|
||||
; return A[42];
|
||||
;}
|
||||
|
||||
; ModuleID = 'simple_vec_assign_scalar_2.s'
|
||||
target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64"
|
||||
target triple = "x86_64-unknown-linux-gnu"
|
||||
|
|
|
@ -1,15 +0,0 @@
|
|||
#define N 1024
|
||||
float A[N];
|
||||
float B[N];
|
||||
|
||||
void simple_vec_const(void) {
|
||||
int i;
|
||||
|
||||
for (i = 0; i < 4; i++)
|
||||
B[i] = A[0];
|
||||
}
|
||||
int main()
|
||||
{
|
||||
simple_vec_const();
|
||||
return A[42];
|
||||
}
|
|
@ -1,6 +1,21 @@
|
|||
; RUN: opt %loadPolly %defaultOpts -polly-codegen %vector-opt -S %s | FileCheck %s
|
||||
|
||||
; ModuleID = 'simple_vec_const.s'
|
||||
;#define N 1024
|
||||
;float A[N];
|
||||
;float B[N];
|
||||
;
|
||||
;void simple_vec_const(void) {
|
||||
; int i;
|
||||
;
|
||||
; for (i = 0; i < 4; i++)
|
||||
; B[i] = A[0];
|
||||
;}
|
||||
;int main()
|
||||
;{
|
||||
; simple_vec_const();
|
||||
; return A[42];
|
||||
;}
|
||||
|
||||
target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64"
|
||||
target triple = "x86_64-unknown-linux-gnu"
|
||||
|
||||
|
|
|
@ -1,15 +0,0 @@
|
|||
#define N 1024
|
||||
float A[N];
|
||||
float B[N];
|
||||
|
||||
void simple_vec_stride_one(void) {
|
||||
int i;
|
||||
|
||||
for (i = 0; i < 4; i++)
|
||||
B[i] = A[i];
|
||||
}
|
||||
int main()
|
||||
{
|
||||
simple_vec_stride_one();
|
||||
return A[42];
|
||||
}
|
|
@ -2,7 +2,23 @@
|
|||
; RUN: opt %loadPolly -basicaa -polly-codegen -polly-vectorizer=unroll-only -S %s | FileCheck -check-prefix=UNROLL %s
|
||||
; RUN: opt %loadPolly %defaultOpts -polly-import-jscop -polly-import-jscop-dir=%S -polly-cloog -analyze %s | FileCheck -check-prefix=IMPORT %s
|
||||
; RUN: opt %loadPolly %defaultOpts -polly-import-jscop -polly-import-jscop-dir=%S -polly-codegen %s -S %vector-opt | FileCheck -check-prefix=CODEGEN %s
|
||||
; ModuleID = 'simple_vec_stride_one.s'
|
||||
|
||||
;#define N 1024
|
||||
;float A[N];
|
||||
;float B[N];
|
||||
;
|
||||
;void simple_vec_stride_one(void) {
|
||||
; int i;
|
||||
;
|
||||
; for (i = 0; i < 4; i++)
|
||||
; B[i] = A[i];
|
||||
;}
|
||||
;int main()
|
||||
;{
|
||||
; simple_vec_stride_one();
|
||||
; return A[42];
|
||||
;}
|
||||
|
||||
target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64"
|
||||
target triple = "x86_64-unknown-linux-gnu"
|
||||
|
||||
|
|
|
@ -1,15 +0,0 @@
|
|||
#define N 1024
|
||||
float A[N];
|
||||
float B[N];
|
||||
|
||||
void simple_vec_stride_x(void) {
|
||||
int i;
|
||||
|
||||
for (i = 0; i < 4; i++)
|
||||
B[2 * i] = A[2 * i];
|
||||
}
|
||||
int main()
|
||||
{
|
||||
simple_vec_stride_x();
|
||||
return A[42];
|
||||
}
|
|
@ -1,5 +1,21 @@
|
|||
; RUN: opt %loadPolly %defaultOpts -polly-codegen %vector-opt -dce -S %s | FileCheck %s
|
||||
; ModuleID = 'simple_vec_stride_x.s'
|
||||
|
||||
;#define N 1024
|
||||
;float A[N];
|
||||
;float B[N];
|
||||
;
|
||||
;void simple_vec_stride_x(void) {
|
||||
; int i;
|
||||
;
|
||||
; for (i = 0; i < 4; i++)
|
||||
; B[2 * i] = A[2 * i];
|
||||
;}
|
||||
;int main()
|
||||
;{
|
||||
; simple_vec_stride_x();
|
||||
; return A[42];
|
||||
;}
|
||||
|
||||
target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64"
|
||||
target triple = "x86_64-unknown-linux-gnu"
|
||||
|
||||
|
|
|
@ -1,34 +0,0 @@
|
|||
#define N 20
|
||||
#include "limits.h"
|
||||
#include <stdio.h>
|
||||
int A[N];
|
||||
|
||||
void single_do_loop_int_max_iterations() {
|
||||
int i;
|
||||
|
||||
__sync_synchronize();
|
||||
|
||||
i = 0;
|
||||
|
||||
do {
|
||||
A[0] = i;
|
||||
++i;
|
||||
} while (i < INT_MAX);
|
||||
|
||||
__sync_synchronize();
|
||||
}
|
||||
|
||||
int main () {
|
||||
int i;
|
||||
|
||||
A[0] = 0;
|
||||
|
||||
single_do_loop_int_max_iterations();
|
||||
|
||||
fprintf(stdout, "Output %d\n", A[0]);
|
||||
|
||||
if (A[0] == INT_MAX - 1)
|
||||
return 0;
|
||||
else
|
||||
return 1;
|
||||
}
|
|
@ -1,4 +1,40 @@
|
|||
; RUN: opt %loadPolly %defaultOpts -polly-cloog -analyze -S %s | FileCheck %s
|
||||
|
||||
;#define N 20
|
||||
;#include "limits.h"
|
||||
;#include <stdio.h>
|
||||
;int A[N];
|
||||
;
|
||||
;void single_do_loop_int_max_iterations() {
|
||||
; int i;
|
||||
;
|
||||
; __sync_synchronize();
|
||||
;
|
||||
; i = 0;
|
||||
;
|
||||
; do {
|
||||
; A[0] = i;
|
||||
; ++i;
|
||||
; } while (i < INT_MAX);
|
||||
;
|
||||
; __sync_synchronize();
|
||||
;}
|
||||
;
|
||||
;int main () {
|
||||
; int i;
|
||||
;
|
||||
; A[0] = 0;
|
||||
;
|
||||
; single_do_loop_int_max_iterations();
|
||||
;
|
||||
; fprintf(stdout, "Output %d\n", A[0]);
|
||||
;
|
||||
; if (A[0] == INT_MAX - 1)
|
||||
; return 0;
|
||||
; else
|
||||
; return 1;
|
||||
;}
|
||||
|
||||
target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64"
|
||||
target triple = "x86_64-unknown-linux-gnu"
|
||||
|
||||
|
|
|
@ -1,25 +0,0 @@
|
|||
define N 20
|
||||
#include "limits.h"
|
||||
int A[N];
|
||||
|
||||
void bar (int n) {
|
||||
int i;
|
||||
__sync_synchronize();
|
||||
i = 0;
|
||||
|
||||
do {
|
||||
A[0] = i;
|
||||
++i;
|
||||
} while (i < 2 * n);
|
||||
__sync_synchronize();
|
||||
}
|
||||
|
||||
int main () {
|
||||
A[0] = 0;
|
||||
bar (N/2);
|
||||
|
||||
if (A[0] == N - 1 )
|
||||
return 0;
|
||||
else
|
||||
return 1;
|
||||
}
|
|
@ -1,6 +1,32 @@
|
|||
; RUN: opt %loadPolly %defaultOpts -polly-cloog-scop -S -analyze %s | FileCheck %s
|
||||
; XFAIL: *
|
||||
; ModuleID = 'single_do_loop_int_param_iterations.s'
|
||||
|
||||
;define N 20
|
||||
;#include "limits.h"
|
||||
;int A[N];
|
||||
;
|
||||
;void bar (int n) {
|
||||
; int i;
|
||||
; __sync_synchronize();
|
||||
; i = 0;
|
||||
;
|
||||
; do {
|
||||
; A[0] = i;
|
||||
; ++i;
|
||||
; } while (i < 2 * n);
|
||||
; __sync_synchronize();
|
||||
;}
|
||||
;
|
||||
;int main () {
|
||||
; A[0] = 0;
|
||||
; bar (N/2);
|
||||
;
|
||||
; if (A[0] == N - 1 )
|
||||
; return 0;
|
||||
; else
|
||||
; return 1;
|
||||
;}
|
||||
|
||||
target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64"
|
||||
target triple = "x86_64-unknown-linux-gnu"
|
||||
|
||||
|
|
|
@ -1,25 +0,0 @@
|
|||
#define N 20
|
||||
#include "limits.h"
|
||||
long long A[N];
|
||||
|
||||
int main () {
|
||||
long long i;
|
||||
|
||||
A[0] = 0;
|
||||
|
||||
__sync_synchronize();
|
||||
|
||||
i = 0;
|
||||
|
||||
do {
|
||||
A[0] = i;
|
||||
++i;
|
||||
} while (i < LLONG_MAX);
|
||||
|
||||
__sync_synchronize();
|
||||
|
||||
if (A[0] == LLONG_MAX - 1)
|
||||
return 0;
|
||||
else
|
||||
return 1;
|
||||
}
|
|
@ -1,6 +1,32 @@
|
|||
; RUN: opt %loadPolly %defaultOpts -polly-cloog -analyze -S %s | FileCheck %s
|
||||
; RUN: opt %loadPolly %defaultOpts -polly-codegen -O3 %s
|
||||
; ModuleID = 'single_do_loop_ll_max_iterations.s'
|
||||
|
||||
;#define N 20
|
||||
;#include "limits.h"
|
||||
;long long A[N];
|
||||
;
|
||||
;int main () {
|
||||
; long long i;
|
||||
;
|
||||
; A[0] = 0;
|
||||
;
|
||||
; __sync_synchronize();
|
||||
;
|
||||
; i = 0;
|
||||
;
|
||||
; do {
|
||||
; A[0] = i;
|
||||
; ++i;
|
||||
; } while (i < LLONG_MAX);
|
||||
;
|
||||
; __sync_synchronize();
|
||||
;
|
||||
; if (A[0] == LLONG_MAX - 1)
|
||||
; return 0;
|
||||
; else
|
||||
; return 1;
|
||||
;}
|
||||
|
||||
target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64"
|
||||
target triple = "x86_64-unknown-linux-gnu"
|
||||
|
||||
|
|
|
@ -1,25 +0,0 @@
|
|||
#define N 20
|
||||
#include "limits.h"
|
||||
|
||||
int main () {
|
||||
int i;
|
||||
int A[N];
|
||||
|
||||
A[0] = 1;
|
||||
|
||||
__sync_synchronize();
|
||||
|
||||
i = 0;
|
||||
|
||||
do {
|
||||
A[0] = 0;
|
||||
++i;
|
||||
} while (i < 1);
|
||||
|
||||
__sync_synchronize();
|
||||
|
||||
if (A[0] == 0)
|
||||
return 0;
|
||||
else
|
||||
return 1;
|
||||
}
|
|
@ -1,6 +1,32 @@
|
|||
; RUN: opt %loadPolly %defaultOpts -polly-cloog-scop -S -analyze %s | FileCheck %s
|
||||
; XFAIL: *
|
||||
; ModuleID = 'single_do_loop_one_iteration.s'
|
||||
|
||||
;#define N 20
|
||||
;#include "limits.h"
|
||||
;
|
||||
;int main () {
|
||||
; int i;
|
||||
; int A[N];
|
||||
;
|
||||
; A[0] = 1;
|
||||
;
|
||||
; __sync_synchronize();
|
||||
;
|
||||
; i = 0;
|
||||
;
|
||||
; do {
|
||||
; A[0] = 0;
|
||||
; ++i;
|
||||
; } while (i < 1);
|
||||
;
|
||||
; __sync_synchronize();
|
||||
;
|
||||
; if (A[0] == 0)
|
||||
; return 0;
|
||||
; else
|
||||
; return 1;
|
||||
;}
|
||||
|
||||
target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64"
|
||||
target triple = "x86_64-unknown-linux-gnu"
|
||||
|
||||
|
|
|
@ -1,32 +0,0 @@
|
|||
#define N 20
|
||||
#include "limits.h"
|
||||
#include <stdio.h>
|
||||
int A[2 * N];
|
||||
|
||||
void single_do_loop_scev_replace() {
|
||||
int i;
|
||||
|
||||
__sync_synchronize();
|
||||
|
||||
i = 0;
|
||||
|
||||
do {
|
||||
A[2 * i] = i;
|
||||
++i;
|
||||
} while (i < N);
|
||||
|
||||
__sync_synchronize();
|
||||
}
|
||||
|
||||
int main () {
|
||||
int i;
|
||||
|
||||
single_do_loop_scev_replace();
|
||||
|
||||
fprintf(stdout, "Output %d\n", A[0]);
|
||||
|
||||
if (A[2 * N - 2] == N - 1)
|
||||
return 0;
|
||||
else
|
||||
return 1;
|
||||
}
|
|
@ -1,5 +1,38 @@
|
|||
; RUN: opt %loadPolly %defaultOpts -polly-cloog -analyze %s | FileCheck %s
|
||||
; ModuleID = 'single_do_loop_scev_replace.s'
|
||||
|
||||
;#define N 20
|
||||
;#include "limits.h"
|
||||
;#include <stdio.h>
|
||||
;int A[2 * N];
|
||||
;
|
||||
;void single_do_loop_scev_replace() {
|
||||
; int i;
|
||||
;
|
||||
; __sync_synchronize();
|
||||
;
|
||||
; i = 0;
|
||||
;
|
||||
; do {
|
||||
; A[2 * i] = i;
|
||||
; ++i;
|
||||
; } while (i < N);
|
||||
;
|
||||
; __sync_synchronize();
|
||||
;}
|
||||
;
|
||||
;int main () {
|
||||
; int i;
|
||||
;
|
||||
; single_do_loop_scev_replace();
|
||||
;
|
||||
; fprintf(stdout, "Output %d\n", A[0]);
|
||||
;
|
||||
; if (A[2 * N - 2] == N - 1)
|
||||
; return 0;
|
||||
; else
|
||||
; return 1;
|
||||
;}
|
||||
|
||||
target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64"
|
||||
target triple = "x86_64-unknown-linux-gnu"
|
||||
|
||||
|
|
|
@ -1,20 +0,0 @@
|
|||
#include <string.h>
|
||||
#define N 1024
|
||||
|
||||
int main () {
|
||||
int i;
|
||||
int A[N];
|
||||
|
||||
memset(A, 0, sizeof(int) * N);
|
||||
|
||||
for (i = 0; i < N; i++) {
|
||||
A[i] = 1;
|
||||
}
|
||||
|
||||
for (i = 0; i < N; i++)
|
||||
if (A[i] != 1)
|
||||
return 1;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -1,5 +1,26 @@
|
|||
; RUN: opt %loadPolly %defaultOpts -polly-cloog -analyze %s | FileCheck %s
|
||||
; ModuleID = 'single_loop.s'
|
||||
|
||||
;#include <string.h>
|
||||
;#define N 1024
|
||||
;
|
||||
;int main () {
|
||||
; int i;
|
||||
; int A[N];
|
||||
;
|
||||
; memset(A, 0, sizeof(int) * N);
|
||||
;
|
||||
; for (i = 0; i < N; i++) {
|
||||
; A[i] = 1;
|
||||
; }
|
||||
;
|
||||
; for (i = 0; i < N; i++)
|
||||
; if (A[i] != 1)
|
||||
; return 1;
|
||||
;
|
||||
; return 0;
|
||||
;}
|
||||
;
|
||||
|
||||
target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64"
|
||||
target triple = "x86_64-unknown-linux-gnu"
|
||||
|
||||
|
|
|
@ -1,21 +0,0 @@
|
|||
#define N 20
|
||||
#include "limits.h"
|
||||
|
||||
int main () {
|
||||
int i;
|
||||
int A[N];
|
||||
|
||||
A[0] = 0;
|
||||
|
||||
__sync_synchronize();
|
||||
|
||||
for (i = 0; i < INT_MAX; i++)
|
||||
A[0] = i;
|
||||
|
||||
__sync_synchronize();
|
||||
|
||||
if (A[0] == INT_MAX - 1)
|
||||
return 0;
|
||||
else
|
||||
return 1;
|
||||
}
|
|
@ -1,5 +1,27 @@
|
|||
; RUN: opt %loadPolly %defaultOpts -polly-cloog -analyze -S %s | FileCheck %s
|
||||
|
||||
;#define N 20
|
||||
;#include "limits.h"
|
||||
;
|
||||
;int main () {
|
||||
; int i;
|
||||
; int A[N];
|
||||
;
|
||||
; A[0] = 0;
|
||||
;
|
||||
; __sync_synchronize();
|
||||
;
|
||||
; for (i = 0; i < INT_MAX; i++)
|
||||
; A[0] = i;
|
||||
;
|
||||
; __sync_synchronize();
|
||||
;
|
||||
; if (A[0] == INT_MAX - 1)
|
||||
; return 0;
|
||||
; else
|
||||
; return 1;
|
||||
;}
|
||||
|
||||
target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64"
|
||||
target triple = "x86_64-unknown-linux-gnu"
|
||||
|
||||
|
|
|
@ -1,21 +0,0 @@
|
|||
#include "limits.h"
|
||||
#define N 20
|
||||
|
||||
int main () {
|
||||
long long i;
|
||||
long long A[N];
|
||||
|
||||
A[0] = 0;
|
||||
|
||||
__sync_synchronize();
|
||||
|
||||
for (i = 0; i < LLONG_MAX; i++)
|
||||
A[0] = i;
|
||||
|
||||
__sync_synchronize();
|
||||
|
||||
if (A[0] == LLONG_MAX - 1)
|
||||
return 0;
|
||||
else
|
||||
return 1;
|
||||
}
|
|
@ -1,7 +1,27 @@
|
|||
; RUN: opt %loadPolly %defaultOpts -polly-cloog -analyze -S %s | FileCheck %s
|
||||
|
||||
; ModuleID = 'single_loop_ll_max_iterations.s'
|
||||
;#include "limits.h"
|
||||
;#define N 20
|
||||
;
|
||||
;int main () {
|
||||
; long long i;
|
||||
; long long A[N];
|
||||
;
|
||||
; A[0] = 0;
|
||||
;
|
||||
; __sync_synchronize();
|
||||
;
|
||||
; for (i = 0; i < LLONG_MAX; i++)
|
||||
; A[0] = i;
|
||||
;
|
||||
; __sync_synchronize();
|
||||
;
|
||||
; if (A[0] == LLONG_MAX - 1)
|
||||
; return 0;
|
||||
; else
|
||||
; return 1;
|
||||
;}
|
||||
|
||||
target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64"
|
||||
target triple = "x86_64-unknown-linux-gnu"
|
||||
|
||||
|
|
|
@ -1,20 +0,0 @@
|
|||
#define N 20
|
||||
|
||||
int main () {
|
||||
int i;
|
||||
int A[N];
|
||||
|
||||
A[0] = 0;
|
||||
|
||||
__sync_synchronize();
|
||||
|
||||
for (i = 0; i < 1; i++)
|
||||
A[i] = 1;
|
||||
|
||||
__sync_synchronize();
|
||||
|
||||
if (A[0] == 1)
|
||||
return 0;
|
||||
else
|
||||
return 1;
|
||||
}
|
|
@ -1,6 +1,26 @@
|
|||
; RUN: opt %loadPolly %defaultOpts -polly-cloog -analyze %s | FileCheck %s
|
||||
|
||||
; ModuleID = 'single_loop_one_iteration.s'
|
||||
;#define N 20
|
||||
;
|
||||
;int main () {
|
||||
; int i;
|
||||
; int A[N];
|
||||
;
|
||||
; A[0] = 0;
|
||||
;
|
||||
; __sync_synchronize();
|
||||
;
|
||||
; for (i = 0; i < 1; i++)
|
||||
; A[i] = 1;
|
||||
;
|
||||
; __sync_synchronize();
|
||||
;
|
||||
; if (A[0] == 1)
|
||||
; return 0;
|
||||
; else
|
||||
; return 1;
|
||||
;}
|
||||
|
||||
target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64"
|
||||
target triple = "x86_64-unknown-linux-gnu"
|
||||
|
||||
|
|
|
@ -1,21 +0,0 @@
|
|||
#include "limits.h"
|
||||
#define N 20
|
||||
|
||||
int main () {
|
||||
unsigned int i;
|
||||
unsigned int A[N];
|
||||
|
||||
A[0] = 0;
|
||||
|
||||
__sync_synchronize();
|
||||
|
||||
for (i = 0; i < UINT_MAX; i++)
|
||||
A[0] = i;
|
||||
|
||||
__sync_synchronize();
|
||||
|
||||
if (A[0] == UINT_MAX - 1)
|
||||
return 0;
|
||||
else
|
||||
return 1;
|
||||
}
|
|
@ -1,6 +1,28 @@
|
|||
; RUN: opt %loadPolly %defaultOpts -polly-cloog-scop -S -analyze %s | FileCheck %s
|
||||
; XFAIL: *
|
||||
; ModuleID = 'single_loop_uint_max_iterations.s'
|
||||
|
||||
;#include "limits.h"
|
||||
;#define N 20
|
||||
;
|
||||
;int main () {
|
||||
; unsigned int i;
|
||||
; unsigned int A[N];
|
||||
;
|
||||
; A[0] = 0;
|
||||
;
|
||||
; __sync_synchronize();
|
||||
;
|
||||
; for (i = 0; i < UINT_MAX; i++)
|
||||
; A[0] = i;
|
||||
;
|
||||
; __sync_synchronize();
|
||||
;
|
||||
; if (A[0] == UINT_MAX - 1)
|
||||
; return 0;
|
||||
; else
|
||||
; return 1;
|
||||
;}
|
||||
|
||||
target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64"
|
||||
target triple = "x86_64-unknown-linux-gnu"
|
||||
|
||||
|
|
|
@ -1,21 +0,0 @@
|
|||
#include "limits.h"
|
||||
#define N 20
|
||||
|
||||
int main () {
|
||||
unsigned long long i;
|
||||
unsigned long long A[N];
|
||||
|
||||
A[0] = 0;
|
||||
|
||||
__sync_synchronize();
|
||||
|
||||
for (i = 0; i < ULLONG_MAX; i++)
|
||||
A[0] = i;
|
||||
|
||||
__sync_synchronize();
|
||||
|
||||
if (A[0] == ULLONG_MAX - 1)
|
||||
return 0;
|
||||
else
|
||||
return 1;
|
||||
}
|
|
@ -1,6 +1,28 @@
|
|||
; RUN: opt %loadPolly %defaultOpts -polly-cloog-scop -S -analyze %s | FileCheck %s
|
||||
; XFAIL: *
|
||||
; ModuleID = 'single_loop_ull_max_iterations.s'
|
||||
|
||||
;#include "limits.h"
|
||||
;#define N 20
|
||||
;
|
||||
;int main () {
|
||||
; unsigned long long i;
|
||||
; unsigned long long A[N];
|
||||
;
|
||||
; A[0] = 0;
|
||||
;
|
||||
; __sync_synchronize();
|
||||
;
|
||||
; for (i = 0; i < ULLONG_MAX; i++)
|
||||
; A[0] = i;
|
||||
;
|
||||
; __sync_synchronize();
|
||||
;
|
||||
; if (A[0] == ULLONG_MAX - 1)
|
||||
; return 0;
|
||||
; else
|
||||
; return 1;
|
||||
;}
|
||||
|
||||
target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64"
|
||||
target triple = "x86_64-unknown-linux-gnu"
|
||||
|
||||
|
|
|
@ -1,20 +0,0 @@
|
|||
#define N 20
|
||||
|
||||
int main () {
|
||||
int i;
|
||||
int A[N];
|
||||
|
||||
A[0] = 0;
|
||||
|
||||
__sync_synchronize();
|
||||
|
||||
for (i = 0; i < 0; i++)
|
||||
A[i] = 1;
|
||||
|
||||
__sync_synchronize();
|
||||
|
||||
if (A[0] == 0)
|
||||
return 0;
|
||||
else
|
||||
return 1;
|
||||
}
|
|
@ -1,6 +1,26 @@
|
|||
; RUN: opt %loadPolly %defaultOpts -polly-cloog -analyze -S %s | FileCheck %s
|
||||
|
||||
; ModuleID = 'single_loop_zero_iterations.s'
|
||||
;#define N 20
|
||||
;
|
||||
;int main () {
|
||||
; int i;
|
||||
; int A[N];
|
||||
;
|
||||
; A[0] = 0;
|
||||
;
|
||||
; __sync_synchronize();
|
||||
;
|
||||
; for (i = 0; i < 0; i++)
|
||||
; A[i] = 1;
|
||||
;
|
||||
; __sync_synchronize();
|
||||
;
|
||||
; if (A[0] == 0)
|
||||
; return 0;
|
||||
; else
|
||||
; return 1;
|
||||
;}
|
||||
|
||||
target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64"
|
||||
target triple = "x86_64-unknown-linux-gnu"
|
||||
|
||||
|
|
|
@ -1,19 +0,0 @@
|
|||
int bar1();
|
||||
int bar2();
|
||||
int bar3();
|
||||
int k;
|
||||
#define N 100
|
||||
int A[N];
|
||||
|
||||
int foo (int z) {
|
||||
int i, j;
|
||||
|
||||
for (i = 0; i < N; i++) {
|
||||
A[i] = i;
|
||||
|
||||
for (j = 0; j < N * 2; j++)
|
||||
A[i] = j * A[i];
|
||||
}
|
||||
|
||||
return A[z];
|
||||
}
|
|
@ -1,6 +1,26 @@
|
|||
; RUN: opt %loadPolly %defaultOpts -O3 -polly-cloog -analyze -S %s | FileCheck %s
|
||||
; XFAIL: *
|
||||
; ModuleID = 'test.c'
|
||||
|
||||
;int bar1();
|
||||
;int bar2();
|
||||
;int bar3();
|
||||
;int k;
|
||||
;#define N 100
|
||||
;int A[N];
|
||||
;
|
||||
;int foo (int z) {
|
||||
; int i, j;
|
||||
;
|
||||
; for (i = 0; i < N; i++) {
|
||||
; A[i] = i;
|
||||
;
|
||||
; for (j = 0; j < N * 2; j++)
|
||||
; A[i] = j * A[i];
|
||||
; }
|
||||
;
|
||||
; return A[z];
|
||||
;}
|
||||
|
||||
target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64"
|
||||
target triple = "x86_64-unknown-linux-gnu"
|
||||
|
||||
|
|
|
@ -1,13 +0,0 @@
|
|||
#define TYPE float
|
||||
#define NUM 4
|
||||
|
||||
TYPE A[NUM];
|
||||
TYPE B[NUM];
|
||||
TYPE C[NUM];
|
||||
|
||||
void vector_multiply(void) {
|
||||
int i;
|
||||
for (i = 0; i < NUM; i++) {
|
||||
A[i] = B[i] * C[i];
|
||||
}
|
||||
}
|
|
@ -1,5 +1,19 @@
|
|||
; RUN: opt -polly-analyze-ir -analyze < %s 2>&1 | not FileCheck %s
|
||||
; ModuleID = 'not-a-reduction.s'
|
||||
|
||||
;#define TYPE float
|
||||
;#define NUM 4
|
||||
;
|
||||
;TYPE A[NUM];
|
||||
;TYPE B[NUM];
|
||||
;TYPE C[NUM];
|
||||
;
|
||||
;void vector_multiply(void) {
|
||||
; int i;
|
||||
; for (i = 0; i < NUM; i++) {
|
||||
; A[i] = B[i] * C[i];
|
||||
; }
|
||||
;}
|
||||
|
||||
target datalayout = "e-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-v64:64:64-v128:128:128-a0:0:64-s0:64:64-f80:128:128-n8:16:32:64"
|
||||
target triple = "x86_64-pc-linux-gnu"
|
||||
|
||||
|
|
Loading…
Reference in New Issue