diff options
author | Tobias Grosser <grosser@fim.uni-passau.de> | 2012-11-02 06:08:39 +0000 |
---|---|---|
committer | Tobias Grosser <grosser@fim.uni-passau.de> | 2012-11-02 06:08:39 +0000 |
commit | 41b20a62c926f7b8b68d5fcff18dbf43faab28c2 (patch) | |
tree | 2fcb6954b2ee72925111d572edc9018e985921c0 | |
parent | acc748b2b572ab3106665fcb16ed669b29c213a6 (diff) | |
download | llvm-41b20a62c926f7b8b68d5fcff18dbf43faab28c2.tar.gz |
Tests: move content of .c files in .ll
llvm-svn: 167283
94 files changed, 1158 insertions, 1110 deletions
diff --git a/polly/test/CodeGen/20100720-MultipleConditions.c b/polly/test/CodeGen/20100720-MultipleConditions.c deleted file mode 100644 index 15d6d56c0b5c..000000000000 --- a/polly/test/CodeGen/20100720-MultipleConditions.c +++ /dev/null @@ -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]; -} diff --git a/polly/test/CodeGen/20100720-MultipleConditions.ll b/polly/test/CodeGen/20100720-MultipleConditions.ll index 796f29192412..1bd31db68ed4 100644 --- a/polly/test/CodeGen/20100720-MultipleConditions.ll +++ b/polly/test/CodeGen/20100720-MultipleConditions.ll @@ -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" diff --git a/polly/test/CodeGen/GPGPU/2d_innermost_parallel.c b/polly/test/CodeGen/GPGPU/2d_innermost_parallel.c deleted file mode 100644 index b6397d194290..000000000000 --- a/polly/test/CodeGen/GPGPU/2d_innermost_parallel.c +++ /dev/null @@ -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; -} diff --git a/polly/test/CodeGen/GPGPU/2d_innermost_parallel.ll b/polly/test/CodeGen/GPGPU/2d_innermost_parallel.ll index 820280367ab6..f040e9cbe5ce 100644 --- a/polly/test/CodeGen/GPGPU/2d_innermost_parallel.ll +++ b/polly/test/CodeGen/GPGPU/2d_innermost_parallel.ll @@ -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" diff --git a/polly/test/CodeGen/GPGPU/3d_innermost_non_parallel.c b/polly/test/CodeGen/GPGPU/3d_innermost_non_parallel.c deleted file mode 100644 index dae115ea3b44..000000000000 --- a/polly/test/CodeGen/GPGPU/3d_innermost_non_parallel.c +++ /dev/null @@ -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; -} diff --git a/polly/test/CodeGen/GPGPU/3d_innermost_non_parallel.ll b/polly/test/CodeGen/GPGPU/3d_innermost_non_parallel.ll index 588f581b2ef3..46df98dbd500 100644 --- a/polly/test/CodeGen/GPGPU/3d_innermost_non_parallel.ll +++ b/polly/test/CodeGen/GPGPU/3d_innermost_non_parallel.ll @@ -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" diff --git a/polly/test/CodeGen/MemAccess/codegen_constant_offset.c b/polly/test/CodeGen/MemAccess/codegen_constant_offset.c deleted file mode 100644 index 4a6bce6b9f28..000000000000 --- a/polly/test/CodeGen/MemAccess/codegen_constant_offset.c +++ /dev/null @@ -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; -} diff --git a/polly/test/CodeGen/MemAccess/codegen_constant_offset.ll b/polly/test/CodeGen/MemAccess/codegen_constant_offset.ll index cd211aa9c4eb..595af3be85e0 100644 --- a/polly/test/CodeGen/MemAccess/codegen_constant_offset.ll +++ b/polly/test/CodeGen/MemAccess/codegen_constant_offset.ll @@ -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" diff --git a/polly/test/CodeGen/MemAccess/codegen_simple.c b/polly/test/CodeGen/MemAccess/codegen_simple.c deleted file mode 100644 index 0df383f63a07..000000000000 --- a/polly/test/CodeGen/MemAccess/codegen_simple.c +++ /dev/null @@ -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; -} diff --git a/polly/test/CodeGen/MemAccess/codegen_simple.ll b/polly/test/CodeGen/MemAccess/codegen_simple.ll index 1ecd795dd91c..e1f634a7afde 100644 --- a/polly/test/CodeGen/MemAccess/codegen_simple.ll +++ b/polly/test/CodeGen/MemAccess/codegen_simple.ll @@ -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" diff --git a/polly/test/CodeGen/MemAccess/codegen_simple_md.c b/polly/test/CodeGen/MemAccess/codegen_simple_md.c deleted file mode 100644 index 740625f25edb..000000000000 --- a/polly/test/CodeGen/MemAccess/codegen_simple_md.c +++ /dev/null @@ -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; -} diff --git a/polly/test/CodeGen/MemAccess/codegen_simple_md.ll b/polly/test/CodeGen/MemAccess/codegen_simple_md.ll index ea7296b6d704..75c8a67969a2 100644 --- a/polly/test/CodeGen/MemAccess/codegen_simple_md.ll +++ b/polly/test/CodeGen/MemAccess/codegen_simple_md.ll @@ -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" diff --git a/polly/test/CodeGen/MemAccess/simple.c b/polly/test/CodeGen/MemAccess/simple.c deleted file mode 100644 index cfdfe62c7f69..000000000000 --- a/polly/test/CodeGen/MemAccess/simple.c +++ /dev/null @@ -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; -} - diff --git a/polly/test/CodeGen/MemAccess/simple.ll b/polly/test/CodeGen/MemAccess/simple.ll index 726ea440638d..a2e9a660a42f 100644 --- a/polly/test/CodeGen/MemAccess/simple.ll +++ b/polly/test/CodeGen/MemAccess/simple.ll @@ -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" diff --git a/polly/test/CodeGen/OpenMP/20120330-argument-use.c b/polly/test/CodeGen/OpenMP/20120330-argument-use.c deleted file mode 100644 index eebd704f58c7..000000000000 --- a/polly/test/CodeGen/OpenMP/20120330-argument-use.c +++ /dev/null @@ -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; - } -} diff --git a/polly/test/CodeGen/OpenMP/20120330-argument-use.ll b/polly/test/CodeGen/OpenMP/20120330-argument-use.ll index 4ec2a122cc5c..afd9bd23a85c 100644 --- a/polly/test/CodeGen/OpenMP/20120330-argument-use.ll +++ b/polly/test/CodeGen/OpenMP/20120330-argument-use.ll @@ -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" diff --git a/polly/test/CodeGen/OpenMP/add_memref.c b/polly/test/CodeGen/OpenMP/add_memref.c deleted file mode 100644 index 02609a3b09af..000000000000 --- a/polly/test/CodeGen/OpenMP/add_memref.c +++ /dev/null @@ -1,10 +0,0 @@ -#define N 10 - -void foo() { - float A[N]; - - for (int i=0; i < N; i++) - A[i] = 10; - - return; -} diff --git a/polly/test/CodeGen/OpenMP/add_memref.ll b/polly/test/CodeGen/OpenMP/add_memref.ll index 49d9715977f2..d8218bb186be 100644 --- a/polly/test/CodeGen/OpenMP/add_memref.ll +++ b/polly/test/CodeGen/OpenMP/add_memref.ll @@ -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" diff --git a/polly/test/CodeGen/OpenMP/extract_memref.c b/polly/test/CodeGen/OpenMP/extract_memref.c deleted file mode 100644 index fa2e63edb93f..000000000000 --- a/polly/test/CodeGen/OpenMP/extract_memref.c +++ /dev/null @@ -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(); -} diff --git a/polly/test/CodeGen/OpenMP/extract_memref.ll b/polly/test/CodeGen/OpenMP/extract_memref.ll index c5993b440381..825eb71bc80a 100644 --- a/polly/test/CodeGen/OpenMP/extract_memref.ll +++ b/polly/test/CodeGen/OpenMP/extract_memref.ll @@ -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" diff --git a/polly/test/CodeGen/OpenMP/invalidate_subfn_scops.c b/polly/test/CodeGen/OpenMP/invalidate_subfn_scops.c deleted file mode 100644 index 4054d0599076..000000000000 --- a/polly/test/CodeGen/OpenMP/invalidate_subfn_scops.c +++ /dev/null @@ -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; -} diff --git a/polly/test/CodeGen/OpenMP/invalidate_subfn_scops.ll b/polly/test/CodeGen/OpenMP/invalidate_subfn_scops.ll index 64d96963d10d..27c4622051a0 100644 --- a/polly/test/CodeGen/OpenMP/invalidate_subfn_scops.ll +++ b/polly/test/CodeGen/OpenMP/invalidate_subfn_scops.ll @@ -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" diff --git a/polly/test/CodeGen/OpenMP/parallel_loop.c b/polly/test/CodeGen/OpenMP/parallel_loop.c deleted file mode 100644 index c776af39e4e6..000000000000 --- a/polly/test/CodeGen/OpenMP/parallel_loop.c +++ /dev/null @@ -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]; -} diff --git a/polly/test/CodeGen/OpenMP/parallel_loop.ll b/polly/test/CodeGen/OpenMP/parallel_loop.ll index cd1935645fc1..f81875d95b7e 100644 --- a/polly/test/CodeGen/OpenMP/parallel_loop.ll +++ b/polly/test/CodeGen/OpenMP/parallel_loop.ll @@ -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" diff --git a/polly/test/CodeGen/OpenMP/parallel_loop_simple.c b/polly/test/CodeGen/OpenMP/parallel_loop_simple.c deleted file mode 100644 index 1c382fc992e4..000000000000 --- a/polly/test/CodeGen/OpenMP/parallel_loop_simple.c +++ /dev/null @@ -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]; -} diff --git a/polly/test/CodeGen/OpenMP/parallel_loop_simple.ll b/polly/test/CodeGen/OpenMP/parallel_loop_simple.ll index a22c73193f9b..f1b3c7c65e5f 100644 --- a/polly/test/CodeGen/OpenMP/parallel_loop_simple.ll +++ b/polly/test/CodeGen/OpenMP/parallel_loop_simple.ll @@ -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" diff --git a/polly/test/CodeGen/OpenMP/parallel_loop_simple2.c b/polly/test/CodeGen/OpenMP/parallel_loop_simple2.c deleted file mode 100644 index 2fb50ebc2c89..000000000000 --- a/polly/test/CodeGen/OpenMP/parallel_loop_simple2.c +++ /dev/null @@ -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]; -} diff --git a/polly/test/CodeGen/OpenMP/parallel_loop_simple2.ll b/polly/test/CodeGen/OpenMP/parallel_loop_simple2.ll index 30004b018729..70905e911e51 100644 --- a/polly/test/CodeGen/OpenMP/parallel_loop_simple2.ll +++ b/polly/test/CodeGen/OpenMP/parallel_loop_simple2.ll @@ -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" diff --git a/polly/test/CodeGen/OpenMP/simple_nested_loop.c b/polly/test/CodeGen/OpenMP/simple_nested_loop.c deleted file mode 100644 index 6867d0b45c71..000000000000 --- a/polly/test/CodeGen/OpenMP/simple_nested_loop.c +++ /dev/null @@ -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; -} - diff --git a/polly/test/CodeGen/OpenMP/simple_nested_loop.ll b/polly/test/CodeGen/OpenMP/simple_nested_loop.ll index 5ef6bb1bb5fa..4c16c55e26b1 100644 --- a/polly/test/CodeGen/OpenMP/simple_nested_loop.ll +++ b/polly/test/CodeGen/OpenMP/simple_nested_loop.ll @@ -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" diff --git a/polly/test/CodeGen/OpenMP/structnames.c b/polly/test/CodeGen/OpenMP/structnames.c deleted file mode 100644 index 1cdb2e321f08..000000000000 --- a/polly/test/CodeGen/OpenMP/structnames.c +++ /dev/null @@ -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; -} - diff --git a/polly/test/CodeGen/OpenMP/structnames.ll b/polly/test/CodeGen/OpenMP/structnames.ll index 3e17e248e9aa..e7c1d2510064 100644 --- a/polly/test/CodeGen/OpenMP/structnames.ll +++ b/polly/test/CodeGen/OpenMP/structnames.ll @@ -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" diff --git a/polly/test/CodeGen/OpenMP/two_loop.c b/polly/test/CodeGen/OpenMP/two_loop.c deleted file mode 100644 index 984e48f1f2ca..000000000000 --- a/polly/test/CodeGen/OpenMP/two_loop.c +++ /dev/null @@ -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; -} - diff --git a/polly/test/CodeGen/OpenMP/two_loop.ll b/polly/test/CodeGen/OpenMP/two_loop.ll index cb95178491a0..bf5df72d40c8 100644 --- a/polly/test/CodeGen/OpenMP/two_loop.ll +++ b/polly/test/CodeGen/OpenMP/two_loop.ll @@ -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" diff --git a/polly/test/CodeGen/constant_condition.c b/polly/test/CodeGen/constant_condition.c deleted file mode 100644 index 171927c6fa26..000000000000 --- a/polly/test/CodeGen/constant_condition.c +++ /dev/null @@ -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]; -} - diff --git a/polly/test/CodeGen/constant_condition.ll b/polly/test/CodeGen/constant_condition.ll index 4f0f69b7084c..2aeb91360e42 100644 --- a/polly/test/CodeGen/constant_condition.ll +++ b/polly/test/CodeGen/constant_condition.ll @@ -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] diff --git a/polly/test/CodeGen/do_pluto_matmult.c b/polly/test/CodeGen/do_pluto_matmult.c deleted file mode 100644 index d5509698e5b8..000000000000 --- a/polly/test/CodeGen/do_pluto_matmult.c +++ /dev/null @@ -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; -} diff --git a/polly/test/CodeGen/do_pluto_matmult.ll b/polly/test/CodeGen/do_pluto_matmult.ll index 126f377133e4..82855e89136b 100644 --- a/polly/test/CodeGen/do_pluto_matmult.ll +++ b/polly/test/CodeGen/do_pluto_matmult.ll @@ -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 diff --git a/polly/test/CodeGen/loop_with_condition.c b/polly/test/CodeGen/loop_with_condition.c deleted file mode 100644 index c27d211032fc..000000000000 --- a/polly/test/CodeGen/loop_with_condition.c +++ /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; -} - diff --git a/polly/test/CodeGen/loop_with_condition.ll b/polly/test/CodeGen/loop_with_condition.ll index 1d825b197ab4..70e980cb9f20 100644 --- a/polly/test/CodeGen/loop_with_condition.ll +++ b/polly/test/CodeGen/loop_with_condition.ll @@ -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" diff --git a/polly/test/CodeGen/loop_with_condition_ineq.c b/polly/test/CodeGen/loop_with_condition_ineq.c deleted file mode 100644 index 9d61922b290a..000000000000 --- a/polly/test/CodeGen/loop_with_condition_ineq.c +++ /dev/null @@ -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; -} - diff --git a/polly/test/CodeGen/loop_with_condition_ineq.ll b/polly/test/CodeGen/loop_with_condition_ineq.ll index 3dd29b5fa427..9790818111b0 100644 --- a/polly/test/CodeGen/loop_with_condition_ineq.ll +++ b/polly/test/CodeGen/loop_with_condition_ineq.ll @@ -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" diff --git a/polly/test/CodeGen/loop_with_condition_nested.c b/polly/test/CodeGen/loop_with_condition_nested.c deleted file mode 100644 index b3f743a8c384..000000000000 --- a/polly/test/CodeGen/loop_with_condition_nested.c +++ /dev/null @@ -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; -} - diff --git a/polly/test/CodeGen/loop_with_condition_nested.ll b/polly/test/CodeGen/loop_with_condition_nested.ll index 3b24dd9e0f1e..f99a9c845854 100644 --- a/polly/test/CodeGen/loop_with_condition_nested.ll +++ b/polly/test/CodeGen/loop_with_condition_nested.ll @@ -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" diff --git a/polly/test/CodeGen/matmul_vec.c b/polly/test/CodeGen/matmul_vec.c deleted file mode 100644 index ade07d079bff..000000000000 --- a/polly/test/CodeGen/matmul_vec.c +++ /dev/null @@ -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]; -} diff --git a/polly/test/CodeGen/matmul_vec.ll b/polly/test/CodeGen/matmul_vec.ll index 14619f2eebf1..82ec9a76488f 100644 --- a/polly/test/CodeGen/matmul_vec.ll +++ b/polly/test/CodeGen/matmul_vec.ll @@ -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" diff --git a/polly/test/CodeGen/pluto_matmult.c b/polly/test/CodeGen/pluto_matmult.c deleted file mode 100644 index 898612fab6ad..000000000000 --- a/polly/test/CodeGen/pluto_matmult.c +++ /dev/null @@ -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; -} diff --git a/polly/test/CodeGen/pluto_matmult.ll b/polly/test/CodeGen/pluto_matmult.ll index 11e0e52d2037..d94fcfba4454 100644 --- a/polly/test/CodeGen/pluto_matmult.ll +++ b/polly/test/CodeGen/pluto_matmult.ll @@ -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" diff --git a/polly/test/CodeGen/reduction.c b/polly/test/CodeGen/reduction.c deleted file mode 100644 index 73a5e1e5381c..000000000000 --- a/polly/test/CodeGen/reduction.c +++ /dev/null @@ -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; -} diff --git a/polly/test/CodeGen/reduction.ll b/polly/test/CodeGen/reduction.ll index 25a4f94a4450..0db85a34473f 100644 --- a/polly/test/CodeGen/reduction.ll +++ b/polly/test/CodeGen/reduction.ll @@ -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" diff --git a/polly/test/CodeGen/reduction_2.c b/polly/test/CodeGen/reduction_2.c deleted file mode 100644 index ec7173f17611..000000000000 --- a/polly/test/CodeGen/reduction_2.c +++ /dev/null @@ -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; -} diff --git a/polly/test/CodeGen/reduction_2.ll b/polly/test/CodeGen/reduction_2.ll index 76682bec1e13..27daeeb9398b 100644 --- a/polly/test/CodeGen/reduction_2.ll +++ b/polly/test/CodeGen/reduction_2.ll @@ -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" diff --git a/polly/test/CodeGen/sequential_loops.c b/polly/test/CodeGen/sequential_loops.c deleted file mode 100644 index 4eac4b0f8ef6..000000000000 --- a/polly/test/CodeGen/sequential_loops.c +++ /dev/null @@ -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; -} - diff --git a/polly/test/CodeGen/sequential_loops.ll b/polly/test/CodeGen/sequential_loops.ll index 56bad0a65620..9ce1a20039cc 100644 --- a/polly/test/CodeGen/sequential_loops.ll +++ b/polly/test/CodeGen/sequential_loops.ll @@ -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" diff --git a/polly/test/CodeGen/simple_nonaffine_loop.c b/polly/test/CodeGen/simple_nonaffine_loop.c deleted file mode 100644 index 4c351451df19..000000000000 --- a/polly/test/CodeGen/simple_nonaffine_loop.c +++ /dev/null @@ -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; -} diff --git a/polly/test/CodeGen/simple_nonaffine_loop.ll b/polly/test/CodeGen/simple_nonaffine_loop.ll index b89c86a817ab..7c99035536d9 100644 --- a/polly/test/CodeGen/simple_nonaffine_loop.ll +++ b/polly/test/CodeGen/simple_nonaffine_loop.ll @@ -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" diff --git a/polly/test/CodeGen/simple_vec_assign_scalar.c b/polly/test/CodeGen/simple_vec_assign_scalar.c deleted file mode 100644 index 1d1eb0a0b4b7..000000000000 --- a/polly/test/CodeGen/simple_vec_assign_scalar.c +++ /dev/null @@ -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]; -} diff --git a/polly/test/CodeGen/simple_vec_assign_scalar.ll b/polly/test/CodeGen/simple_vec_assign_scalar.ll index 6151874fdb6f..e2ac25f022c7 100644 --- a/polly/test/CodeGen/simple_vec_assign_scalar.ll +++ b/polly/test/CodeGen/simple_vec_assign_scalar.ll @@ -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" diff --git a/polly/test/CodeGen/simple_vec_assign_scalar_2.c b/polly/test/CodeGen/simple_vec_assign_scalar_2.c deleted file mode 100644 index ace959f7ffa9..000000000000 --- a/polly/test/CodeGen/simple_vec_assign_scalar_2.c +++ /dev/null @@ -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]; -} diff --git a/polly/test/CodeGen/simple_vec_assign_scalar_2.ll b/polly/test/CodeGen/simple_vec_assign_scalar_2.ll index 65f93425b969..9ef1f95cf47e 100644 --- a/polly/test/CodeGen/simple_vec_assign_scalar_2.ll +++ b/polly/test/CodeGen/simple_vec_assign_scalar_2.ll @@ -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" diff --git a/polly/test/CodeGen/simple_vec_const.c b/polly/test/CodeGen/simple_vec_const.c deleted file mode 100644 index e75c71c8b354..000000000000 --- a/polly/test/CodeGen/simple_vec_const.c +++ /dev/null @@ -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]; -} diff --git a/polly/test/CodeGen/simple_vec_const.ll b/polly/test/CodeGen/simple_vec_const.ll index 7b3607ffb1c6..a14f982f882b 100644 --- a/polly/test/CodeGen/simple_vec_const.ll +++ b/polly/test/CodeGen/simple_vec_const.ll @@ -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" diff --git a/polly/test/CodeGen/simple_vec_stride_one.c b/polly/test/CodeGen/simple_vec_stride_one.c deleted file mode 100644 index 720563ef630f..000000000000 --- a/polly/test/CodeGen/simple_vec_stride_one.c +++ /dev/null @@ -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]; -} diff --git a/polly/test/CodeGen/simple_vec_stride_one.ll b/polly/test/CodeGen/simple_vec_stride_one.ll index ee754bffcf15..7044106a7ebc 100644 --- a/polly/test/CodeGen/simple_vec_stride_one.ll +++ b/polly/test/CodeGen/simple_vec_stride_one.ll @@ -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" diff --git a/polly/test/CodeGen/simple_vec_stride_x.c b/polly/test/CodeGen/simple_vec_stride_x.c deleted file mode 100644 index b6623bf79fad..000000000000 --- a/polly/test/CodeGen/simple_vec_stride_x.c +++ /dev/null @@ -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]; -} diff --git a/polly/test/CodeGen/simple_vec_stride_x.ll b/polly/test/CodeGen/simple_vec_stride_x.ll index ff44c28c948f..a4512d0f2625 100644 --- a/polly/test/CodeGen/simple_vec_stride_x.ll +++ b/polly/test/CodeGen/simple_vec_stride_x.ll @@ -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" diff --git a/polly/test/CodeGen/single_do_loop_int_max_iterations.c b/polly/test/CodeGen/single_do_loop_int_max_iterations.c deleted file mode 100644 index a47751837db9..000000000000 --- a/polly/test/CodeGen/single_do_loop_int_max_iterations.c +++ /dev/null @@ -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; -} diff --git a/polly/test/CodeGen/single_do_loop_int_max_iterations.ll b/polly/test/CodeGen/single_do_loop_int_max_iterations.ll index 0174cee4648e..e4c2eaafc040 100644 --- a/polly/test/CodeGen/single_do_loop_int_max_iterations.ll +++ b/polly/test/CodeGen/single_do_loop_int_max_iterations.ll @@ -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" diff --git a/polly/test/CodeGen/single_do_loop_int_param_iterations.c b/polly/test/CodeGen/single_do_loop_int_param_iterations.c deleted file mode 100644 index 48368a205f75..000000000000 --- a/polly/test/CodeGen/single_do_loop_int_param_iterations.c +++ /dev/null @@ -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; -} diff --git a/polly/test/CodeGen/single_do_loop_int_param_iterations.ll b/polly/test/CodeGen/single_do_loop_int_param_iterations.ll index 9c037b891070..c2a067ad8177 100644 --- a/polly/test/CodeGen/single_do_loop_int_param_iterations.ll +++ b/polly/test/CodeGen/single_do_loop_int_param_iterations.ll @@ -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" diff --git a/polly/test/CodeGen/single_do_loop_ll_max_iterations.c b/polly/test/CodeGen/single_do_loop_ll_max_iterations.c deleted file mode 100644 index a4b4cca4f6d5..000000000000 --- a/polly/test/CodeGen/single_do_loop_ll_max_iterations.c +++ /dev/null @@ -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; -} diff --git a/polly/test/CodeGen/single_do_loop_ll_max_iterations.ll b/polly/test/CodeGen/single_do_loop_ll_max_iterations.ll index 5581a9b428e8..30fcbd346b30 100644 --- a/polly/test/CodeGen/single_do_loop_ll_max_iterations.ll +++ b/polly/test/CodeGen/single_do_loop_ll_max_iterations.ll @@ -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" diff --git a/polly/test/CodeGen/single_do_loop_one_iteration.c b/polly/test/CodeGen/single_do_loop_one_iteration.c deleted file mode 100644 index df9c99d8f90c..000000000000 --- a/polly/test/CodeGen/single_do_loop_one_iteration.c +++ /dev/null @@ -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; -} diff --git a/polly/test/CodeGen/single_do_loop_one_iteration.ll b/polly/test/CodeGen/single_do_loop_one_iteration.ll index dbe4af37b708..6bf922ba8e94 100644 --- a/polly/test/CodeGen/single_do_loop_one_iteration.ll +++ b/polly/test/CodeGen/single_do_loop_one_iteration.ll @@ -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" diff --git a/polly/test/CodeGen/single_do_loop_scev_replace.c b/polly/test/CodeGen/single_do_loop_scev_replace.c deleted file mode 100644 index efa95ce234fd..000000000000 --- a/polly/test/CodeGen/single_do_loop_scev_replace.c +++ /dev/null @@ -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; -} diff --git a/polly/test/CodeGen/single_do_loop_scev_replace.ll b/polly/test/CodeGen/single_do_loop_scev_replace.ll index 2f95aa7e72a5..cfdc4127c45e 100644 --- a/polly/test/CodeGen/single_do_loop_scev_replace.ll +++ b/polly/test/CodeGen/single_do_loop_scev_replace.ll @@ -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" diff --git a/polly/test/CodeGen/single_loop.c b/polly/test/CodeGen/single_loop.c deleted file mode 100644 index 2e175e594bcd..000000000000 --- a/polly/test/CodeGen/single_loop.c +++ /dev/null @@ -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; -} - diff --git a/polly/test/CodeGen/single_loop.ll b/polly/test/CodeGen/single_loop.ll index fd5fb3d79197..9109ca0d50b4 100644 --- a/polly/test/CodeGen/single_loop.ll +++ b/polly/test/CodeGen/single_loop.ll @@ -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" diff --git a/polly/test/CodeGen/single_loop_int_max_iterations.c b/polly/test/CodeGen/single_loop_int_max_iterations.c deleted file mode 100644 index d102fbf5dd2e..000000000000 --- a/polly/test/CodeGen/single_loop_int_max_iterations.c +++ /dev/null @@ -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; -} diff --git a/polly/test/CodeGen/single_loop_int_max_iterations.ll b/polly/test/CodeGen/single_loop_int_max_iterations.ll index c5f7eae9c1ef..af2dab647f72 100644 --- a/polly/test/CodeGen/single_loop_int_max_iterations.ll +++ b/polly/test/CodeGen/single_loop_int_max_iterations.ll @@ -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" diff --git a/polly/test/CodeGen/single_loop_ll_max_iterations.c b/polly/test/CodeGen/single_loop_ll_max_iterations.c deleted file mode 100644 index f5f56073e593..000000000000 --- a/polly/test/CodeGen/single_loop_ll_max_iterations.c +++ /dev/null @@ -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; -} diff --git a/polly/test/CodeGen/single_loop_ll_max_iterations.ll b/polly/test/CodeGen/single_loop_ll_max_iterations.ll index 3b47d6648075..2cec9a47c8d2 100644 --- a/polly/test/CodeGen/single_loop_ll_max_iterations.ll +++ b/polly/test/CodeGen/single_loop_ll_max_iterations.ll @@ -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" diff --git a/polly/test/CodeGen/single_loop_one_iteration.c b/polly/test/CodeGen/single_loop_one_iteration.c deleted file mode 100644 index 5540c3a811e8..000000000000 --- a/polly/test/CodeGen/single_loop_one_iteration.c +++ /dev/null @@ -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; -} diff --git a/polly/test/CodeGen/single_loop_one_iteration.ll b/polly/test/CodeGen/single_loop_one_iteration.ll index ae608f549808..a82964c987b4 100644 --- a/polly/test/CodeGen/single_loop_one_iteration.ll +++ b/polly/test/CodeGen/single_loop_one_iteration.ll @@ -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" diff --git a/polly/test/CodeGen/single_loop_uint_max_iterations.c b/polly/test/CodeGen/single_loop_uint_max_iterations.c deleted file mode 100644 index 86658b65bae2..000000000000 --- a/polly/test/CodeGen/single_loop_uint_max_iterations.c +++ /dev/null @@ -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; -} diff --git a/polly/test/CodeGen/single_loop_uint_max_iterations.ll b/polly/test/CodeGen/single_loop_uint_max_iterations.ll index fc838e0f6d8c..1ac2050ebf57 100644 --- a/polly/test/CodeGen/single_loop_uint_max_iterations.ll +++ b/polly/test/CodeGen/single_loop_uint_max_iterations.ll @@ -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" diff --git a/polly/test/CodeGen/single_loop_ull_max_iterations.c b/polly/test/CodeGen/single_loop_ull_max_iterations.c deleted file mode 100644 index 56d7677495a3..000000000000 --- a/polly/test/CodeGen/single_loop_ull_max_iterations.c +++ /dev/null @@ -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; -} diff --git a/polly/test/CodeGen/single_loop_ull_max_iterations.ll b/polly/test/CodeGen/single_loop_ull_max_iterations.ll index 8c2a80eba125..d1f2a919fbad 100644 --- a/polly/test/CodeGen/single_loop_ull_max_iterations.ll +++ b/polly/test/CodeGen/single_loop_ull_max_iterations.ll @@ -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" diff --git a/polly/test/CodeGen/single_loop_zero_iterations.c b/polly/test/CodeGen/single_loop_zero_iterations.c deleted file mode 100644 index 87c55962c218..000000000000 --- a/polly/test/CodeGen/single_loop_zero_iterations.c +++ /dev/null @@ -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; -} diff --git a/polly/test/CodeGen/single_loop_zero_iterations.ll b/polly/test/CodeGen/single_loop_zero_iterations.ll index a00ed9b089e1..9d6963d8ce35 100644 --- a/polly/test/CodeGen/single_loop_zero_iterations.ll +++ b/polly/test/CodeGen/single_loop_zero_iterations.ll @@ -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" diff --git a/polly/test/CodeGen/test.c b/polly/test/CodeGen/test.c deleted file mode 100644 index 503e5f202df7..000000000000 --- a/polly/test/CodeGen/test.c +++ /dev/null @@ -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]; -} diff --git a/polly/test/CodeGen/test.ll b/polly/test/CodeGen/test.ll index e0676da5ab94..704d40569fe7 100644 --- a/polly/test/CodeGen/test.ll +++ b/polly/test/CodeGen/test.ll @@ -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" diff --git a/polly/test/TempScop/not-a-reduction.c b/polly/test/TempScop/not-a-reduction.c deleted file mode 100644 index 7acddb4c2ccf..000000000000 --- a/polly/test/TempScop/not-a-reduction.c +++ /dev/null @@ -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]; - } -} diff --git a/polly/test/TempScop/not-a-reduction.ll b/polly/test/TempScop/not-a-reduction.ll index 93a12844a4f9..3cc505aa3329 100644 --- a/polly/test/TempScop/not-a-reduction.ll +++ b/polly/test/TempScop/not-a-reduction.ll @@ -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" |