Do not test polybench with 'make check-polly'

Those test cases should be tested in the LLVM test suite. For Polly we should
extract regression tests for the individual passes.

llvm-svn: 200206
This commit is contained in:
Tobias Grosser 2014-01-27 10:37:33 +00:00
parent 54646f7fab
commit 24d7e669b3
56 changed files with 0 additions and 6800 deletions

View File

@ -1,87 +0,0 @@
* * * * * * * * * *
* PolyBenchs 1.0 *
* * * * * * * * * *
* Available benchmarks:
::linear-algebra::
linear-algebra/kernels:
linear-algebra/kernels/atax/2mm.c
linear-algebra/kernels/atax/3mm.c
linear-algebra/kernels/atax/atax.c
linear-algebra/kernels/bicg/bicg.c
linear-algebra/kernels/doitgen/doitgen.c
linear-algebra/kernels/gemm/gemm.c
linear-algebra/kernels/gemver/gemver.c
linear-algebra/kernels/gesummv/gesummv.c
linear-algebra/solvers:
linear-algebra/solvers/gramschmidt/gramschmidt.c
linear-algebra/solvers/lu/lu.c
linear-algebra/solvers/ludcmp/ludcmp.c
::datamining::
datamining/correlation/correlation.c
datamining/covariance/covariance.c
::stencils::
stencils/adi/adi.c
stencils/jacobi-2d-imper/jacobi-2d-imper.c
stencils/seidel/seidel.c
* To compile a benchmark without any monitoring:
$> gcc -I utilities utilities/instrument.c linear-algebra/kernels/atax/atax.c
* To compile a benchmark with execution time reporting:
$> gcc -I utilities utilities/instrument.c linear-algebra/kernels/atax/atax.c -DPOLYBENCH_TIME
* Available options
They are all passed as macro definitions during compilation time. The
current list is:
- POLYBENCH_TIME: output execution time (gettimeofday) [default: off]
- POLYBENCH_NO_FLUSH_CACHE: don't flush the cache before calling the
timer [default: flush the cache]
- POLYBENCH_LINUX_FIFO_SCHEDULER: use FIFO real-time scheduler for the
kernel execution, the program must be run as root, under linux only,
and compiled with -lc [default: off]
- POLYBENCH_CACHE_SIZE_KB: cache size to flush, in kB [default: 8192]
- POLYBENCH_TEST_MALLOC: use malloc instead of stack allocation [default: off]
- POLYBENCH_DUMP_ARRAYS: dump all live-out arrays on stderr [default: off]
- Nxx: override the default dataset values
* Collecting the execution time of all files
$> scripts/runall.sh <machine-name>
Note: the script runall must be run from the root directory of the archive.
** Specifying different dataset size for one file in particular
- Create a compiler.opts file under the directory of the benchmark
- Specify a set of options, e.g. -DX=1024 -DY=1024 (see gemm for an example)
** To specify another compiler
- Simplest is to edit scripts/runall.sh, and change the
COMPILER_COMMAND variable. One can also export the adequate
COMPILER_COMMAND variable in the shell environment.
* Author
Louis-Noel Pouchet <pouchet@cse.ohio-state.edu>
* Contributors
Uday Bondhugula <ubondhug@us.ibm.com>

View File

@ -1,165 +0,0 @@
#include <stdio.h>
#include <unistd.h>
#include <string.h>
#include <math.h>
#include "instrument.h"
/* Default problem size. */
#ifndef M
# define M 500
#endif
#ifndef N
# define N 500
#endif
/* Default data type is double. */
#ifndef DATA_TYPE
# define DATA_TYPE double
#endif
#ifndef DATA_PRINTF_MODIFIER
# define DATA_PRINTF_MODIFIER "%0.2lf "
#endif
/* Array declaration. Enable malloc if POLYBENCH_TEST_MALLOC. */
DATA_TYPE float_n = 321414134.01;
DATA_TYPE eps = 0.005;
#ifndef POLYBENCH_TEST_MALLOC
DATA_TYPE data[M + 1][N + 1];
DATA_TYPE symmat[M + 1][M + 1];
DATA_TYPE stddev[M + 1];
DATA_TYPE mean[M + 1];
#else
DATA_TYPE** data = (DATA_TYPE**)malloc((M + 1) * sizeof(DATA_TYPE*));
DATA_TYPE** symmat = (DATA_TYPE**)malloc((M + 1) * sizeof(DATA_TYPE*));
DATA_TYPE* stddev = (DATA_TYPE*)malloc((M + 1) * sizeof(DATA_TYPE));
DATA_TYPE* mean = (DATA_TYPE*)malloc((M + 1) * sizeof(DATA_TYPE));
{
int i;
for (i = 0; i <= M; ++i)
{
data[i] = (DATA_TYPE*)malloc((N + 1) * sizeof(DATA_TYPE));
symmat[i] = (DATA_TYPE*)malloc((M + 1) * sizeof(DATA_TYPE));
}
}
#endif
inline
void init_array()
{
int i, j;
for (i = 0; i <= M; i++)
for (j = 0; j <= N; j++)
data[i][j] = ((DATA_TYPE) i*j) / M;
}
/* Define the live-out variables. Code is not executed unless
POLYBENCH_DUMP_ARRAYS is defined. */
inline
void print_array(int argc, char** argv)
{
int i, j;
#ifndef POLYBENCH_DUMP_ARRAYS
if (argc > 42 && ! strcmp(argv[0], ""))
#endif
{
for (i = 0; i <= M; i++)
for (j = 0; j <= M; j++) {
fprintf(stderr, DATA_PRINTF_MODIFIER, symmat[i][j]);
if ((i * M + j) % 80 == 20) fprintf(stderr, "\n");
}
fprintf(stderr, "\n");
}
}
#ifndef SCOP_PARAM
void scop_func() {
long m = M;
long n = N;
#else
void scop_func(long m, long n) {
#endif
int i, j, j1, j2;
#pragma scop
#pragma live-out symmat
/* Center and reduce the column vectors. */
for (i = 1; i <= n; i++)
for (j = 1; j <= m; j++)
{
data[i][j] -= mean[j];
data[i][j] /= sqrt(float_n) * stddev[j];
}
/* Calculate the m * m correlation matrix. */
for (j1 = 1; j1 <= m-1; j1++)
{
symmat[j1][j1] = 1.0;
for (j2 = j1+1; j2 <= m; j2++)
{
symmat[j1][j2] = 0.0;
for (i = 1; i <= n; i++)
symmat[j1][j2] += (data[i][j1] * data[i][j2]);
symmat[j2][j1] = symmat[j1][j2];
}
}
#pragma endscop
}
int main(int argc, char** argv)
{
int i, j, j1, j2;
int m = M;
int n = N;
/* Initialize array. */
init_array();
/* Start timer. */
polybench_start_instruments;
#define sqrt_of_array_cell(x,j) sqrt(x[j])
/* Determine mean of column vectors of input data matrix */
for (j = 1; j <= m; j++)
{
mean[j] = 0.0;
for (i = 1; i <= n; i++)
mean[j] += data[i][j];
mean[j] /= float_n;
}
/* Determine standard deviations of column vectors of data matrix. */
for (j = 1; j <= m; j++)
{
stddev[j] = 0.0;
for (i = 1; i <= n; i++)
stddev[j] += (data[i][j] - mean[j]) * (data[i][j] - mean[j]);
stddev[j] /= float_n;
stddev[j] = sqrt_of_array_cell(stddev, j);
/* The following in an inelegant but usual way to handle
near-zero std. dev. values, which below would cause a zero-
divide. */
stddev[j] = stddev[j] <= eps ? 1.0 : stddev[j];
}
#ifndef SCOP_PARAM
scop_func();
#else
scop_func(m, n);
#endif
symmat[m][m] = 1.0;
/* Stop and print timer. */
polybench_stop_instruments;
polybench_print_instruments;
print_array(argc, argv);
return 0;
}

View File

@ -1,168 +0,0 @@
; RUN: opt %loadPolly %defaultOpts -polly-analyze-ir -print-top-scop-only -analyze %s | FileCheck %s
; XFAIL: *
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"
%struct._IO_FILE = type { i32, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, %struct._IO_marker*, %struct._IO_FILE*, i32, i32, i64, i16, i8, [1 x i8], i8*, i64, i8*, i8*, i8*, i8*, i64, i32, [20 x i8] }
%struct._IO_marker = type { %struct._IO_marker*, %struct._IO_FILE*, i32 }
@float_n = global double 0x41B32863F6028F5C
@eps = global double 5.000000e-03
@data = common global [501 x [501 x double]] zeroinitializer, align 32
@symmat = common global [501 x [501 x double]] zeroinitializer, align 32
@stderr = external global %struct._IO_FILE*
@.str = private constant [8 x i8] c"%0.2lf \00", align 1
@mean = common global [501 x double] zeroinitializer, align 32
@stddev = common global [501 x double] zeroinitializer, align 32
define void @scop_func(i64 %m, i64 %n) nounwind {
entry:
%0 = icmp slt i64 %n, 1
%1 = icmp slt i64 %m, 1
%or.cond = or i1 %0, %1
br i1 %or.cond, label %bb13.preheader, label %bb2.preheader.preheader
bb2.preheader.preheader: ; preds = %entry
br label %bb2.preheader
bb1: ; preds = %bb2.preheader, %bb1
%indvar52 = phi i64 [ %tmp63, %bb1 ], [ 0, %bb2.preheader ]
%tmp9 = add i64 %indvar52, 1
%scevgep59 = getelementptr [501 x [501 x double]]* @data, i64 0, i64 %tmp8, i64 %tmp9
%tmp61 = add i64 %indvar52, 2
%tmp3 = add i64 %indvar52, 1
%scevgep60 = getelementptr [501 x double]* @mean, i64 0, i64 %tmp3
%scevgep55 = getelementptr [501 x double]* @stddev, i64 0, i64 %tmp3
%tmp63 = add i64 %indvar52, 1
%2 = load double* %scevgep59, align 8
%3 = load double* %scevgep60, align 8
%4 = fsub double %2, %3
store double %4, double* %scevgep59, align 8
%5 = load double* @float_n, align 8
%6 = tail call double @sqrt(double %5) nounwind readonly
%7 = load double* %scevgep55, align 8
%8 = fmul double %6, %7
%9 = fdiv double %4, %8
store double %9, double* %scevgep59, align 8
%10 = icmp sgt i64 %tmp61, %m
br i1 %10, label %bb3, label %bb1
bb3: ; preds = %bb1
%11 = icmp sgt i64 %tmp65, %n
br i1 %11, label %bb13.preheader.loopexit, label %bb2.preheader
bb2.preheader: ; preds = %bb2.preheader.preheader, %bb3
%indvar56 = phi i64 [ %tmp62, %bb3 ], [ 0, %bb2.preheader.preheader ]
%tmp8 = add i64 %indvar56, 1
%tmp65 = add i64 %indvar56, 2
%tmp62 = add i64 %indvar56, 1
br label %bb1
bb13.preheader.loopexit: ; preds = %bb3
br label %bb13.preheader
bb13.preheader: ; preds = %bb13.preheader.loopexit, %entry
%12 = add nsw i64 %m, -1
%13 = icmp slt i64 %12, 1
br i1 %13, label %return, label %bb6.preheader
bb6.preheader: ; preds = %bb13.preheader
%tmp = add i64 %m, -1
br label %bb6
bb6: ; preds = %bb6.preheader, %bb12
%indvar14 = phi i64 [ 0, %bb6.preheader ], [ %indvar.next15, %bb12 ]
%tmp35 = add i64 %indvar14, 3
%tmp36 = trunc i64 %tmp35 to i32
%tmp38 = add i64 %indvar14, 2
%tmp39 = trunc i64 %tmp38 to i32
%tmp46 = add i64 %indvar14, 1
%scevgep49 = getelementptr [501 x [501 x double]]* @symmat, i64 0, i64 0, i64 %tmp46
%scevgep53 = getelementptr [501 x [501 x double]]* @symmat, i64 0, i64 %tmp46, i64 0
%tmp59 = mul i64 %indvar14, 502
%tmp60 = add i64 %tmp59, 1
%scevgep61 = getelementptr [501 x [501 x double]]* @symmat, i64 0, i64 1, i64 %tmp60
store double 1.000000e+00, double* %scevgep61, align 8
%14 = icmp sgt i64 %tmp38, %m
br i1 %14, label %bb12, label %bb.nph12
bb.nph12: ; preds = %bb6
br i1 %0, label %bb10.us.preheader, label %bb.nph.preheader
bb10.us.preheader: ; preds = %bb.nph12
br label %bb10.us
bb.nph.preheader: ; preds = %bb.nph12
br label %bb.nph
bb10.us: ; preds = %bb10.us.preheader, %bb10.us
%indvar = phi i32 [ %indvar.next, %bb10.us ], [ 0, %bb10.us.preheader ]
%storemerge2.us = add i32 %tmp36, %indvar
%storemerge28.us = add i32 %tmp39, %indvar
%tmp55 = sext i32 %storemerge28.us to i64
%tmp56 = mul i64 %tmp55, 501
%scevgep57 = getelementptr double* %scevgep49, i64 %tmp56
%scevgep58 = getelementptr double* %scevgep53, i64 %tmp55
store double 0.000000e+00, double* %scevgep58, align 8
store double 0.000000e+00, double* %scevgep57, align 8
%15 = sext i32 %storemerge2.us to i64
%16 = icmp sgt i64 %15, %m
%indvar.next = add i32 %indvar, 1
br i1 %16, label %bb12.loopexit1, label %bb10.us
bb.nph: ; preds = %bb.nph.preheader, %bb10
%indvar41 = phi i32 [ %indvar.next42, %bb10 ], [ 0, %bb.nph.preheader ]
%storemerge2 = add i32 %tmp36, %indvar41
%storemerge28 = add i32 %tmp39, %indvar41
%tmp50 = sext i32 %storemerge28 to i64
%tmp51 = mul i64 %tmp50, 501
%scevgep52 = getelementptr double* %scevgep49, i64 %tmp51
%scevgep54 = getelementptr double* %scevgep53, i64 %tmp50
%tmp21 = sext i32 %storemerge28 to i64
store double 0.000000e+00, double* %scevgep54, align 8
br label %bb8
bb8: ; preds = %bb8, %bb.nph
%indvar38 = phi i64 [ 0, %bb.nph ], [ %tmp40, %bb8 ]
%17 = phi double [ 0.000000e+00, %bb.nph ], [ %21, %bb8 ]
%tmp44 = add i64 %indvar38, 1
%scevgep47 = getelementptr [501 x [501 x double]]* @data, i64 0, i64 %tmp44, i64 %tmp46
%tmp48 = add i64 %indvar38, 2
%tmp13 = add i64 %indvar38, 1
%scevgep = getelementptr [501 x [501 x double]]* @data, i64 0, i64 %tmp13, i64 %tmp21
%tmp40 = add i64 %indvar38, 1
%18 = load double* %scevgep47, align 8
%19 = load double* %scevgep, align 8
%20 = fmul double %18, %19
%21 = fadd double %17, %20
%22 = icmp sgt i64 %tmp48, %n
br i1 %22, label %bb10, label %bb8
bb10: ; preds = %bb8
%.lcssa = phi double [ %21, %bb8 ]
store double %.lcssa, double* %scevgep54
store double %.lcssa, double* %scevgep52, align 8
%23 = sext i32 %storemerge2 to i64
%24 = icmp sgt i64 %23, %m
%indvar.next42 = add i32 %indvar41, 1
br i1 %24, label %bb12.loopexit, label %bb.nph
bb12.loopexit: ; preds = %bb10
br label %bb12
bb12.loopexit1: ; preds = %bb10.us
br label %bb12
bb12: ; preds = %bb12.loopexit1, %bb12.loopexit, %bb6
%indvar.next15 = add i64 %indvar14, 1
%exitcond = icmp eq i64 %indvar.next15, %tmp
br i1 %exitcond, label %return.loopexit, label %bb6
return.loopexit: ; preds = %bb12
br label %return
return: ; preds = %return.loopexit, %bb13.preheader
ret void
}
declare double @sqrt(double) nounwind readonly

View File

@ -1,116 +0,0 @@
; RUN: opt %loadPolly %defaultOpts -polly-analyze-ir -print-top-scop-only -analyze %s | FileCheck %s
; XFAIL: *
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"
%struct._IO_FILE = type { i32, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, %struct._IO_marker*, %struct._IO_FILE*, i32, i32, i64, i16, i8, [1 x i8], i8*, i64, i8*, i8*, i8*, i8*, i64, i32, [20 x i8] }
%struct._IO_marker = type { %struct._IO_marker*, %struct._IO_FILE*, i32 }
@float_n = global double 0x41B32863F6028F5C
@eps = global double 5.000000e-03
@data = common global [501 x [501 x double]] zeroinitializer, align 32
@symmat = common global [501 x [501 x double]] zeroinitializer, align 32
@stderr = external global %struct._IO_FILE*
@.str = private constant [8 x i8] c"%0.2lf \00", align 1
@mean = common global [501 x double] zeroinitializer, align 32
@stddev = common global [501 x double] zeroinitializer, align 32
define void @scop_func() nounwind {
bb.nph33.bb.nph33.split_crit_edge:
br label %bb2.preheader
bb1: ; preds = %bb2.preheader, %bb1
%indvar45 = phi i64 [ %tmp57, %bb1 ], [ 0, %bb2.preheader ]
%tmp51 = add i64 %indvar45, 1
%scevgep53 = getelementptr [501 x [501 x double]]* @data, i64 0, i64 %tmp50, i64 %tmp51
%tmp44 = add i64 %indvar45, 1
%scevgep54 = getelementptr [501 x double]* @mean, i64 0, i64 %tmp44
%scevgep49 = getelementptr [501 x double]* @stddev, i64 0, i64 %tmp44
%tmp57 = add i64 %indvar45, 1
%0 = load double* %scevgep53, align 8
%1 = load double* %scevgep54, align 8
%2 = fsub double %0, %1
store double %2, double* %scevgep53, align 8
%3 = load double* @float_n, align 8
%4 = tail call double @sqrt(double %3) nounwind readonly
%5 = load double* %scevgep49, align 8
%6 = fmul double %4, %5
%7 = fdiv double %2, %6
store double %7, double* %scevgep53, align 8
%exitcond43 = icmp eq i64 %tmp57, 500
br i1 %exitcond43, label %bb3, label %bb1
bb3: ; preds = %bb1
%tmp56 = add i64 %indvar50, 1
%exitcond49 = icmp eq i64 %tmp56, 500
br i1 %exitcond49, label %bb6.preheader, label %bb2.preheader
bb6.preheader: ; preds = %bb3
br label %bb6
bb2.preheader: ; preds = %bb3, %bb.nph33.bb.nph33.split_crit_edge
%indvar50 = phi i64 [ 0, %bb.nph33.bb.nph33.split_crit_edge ], [ %tmp56, %bb3 ]
%tmp50 = add i64 %indvar50, 1
br label %bb1
bb6: ; preds = %bb6.preheader, %bb12
%indvar3 = phi i64 [ 0, %bb6.preheader ], [ %indvar.next, %bb12 ]
%tmp25 = mul i64 %indvar3, 502
%tmp26 = add i64 %tmp25, 2
%tmp30 = add i64 %tmp25, 1
%tmp33 = add i64 %indvar3, 2
%tmp36 = mul i64 %indvar3, -1
%tmp12 = add i64 %tmp36, 499
%tmp38 = add i64 %indvar3, 1
%scevgep42 = getelementptr [501 x [501 x double]]* @symmat, i64 0, i64 1, i64 %tmp30
store double 1.000000e+00, double* %scevgep42, align 8
br i1 false, label %bb12, label %bb.nph12.bb.nph12.split_crit_edge
bb.nph12.bb.nph12.split_crit_edge: ; preds = %bb6
br label %bb.nph
bb.nph: ; preds = %bb10, %bb.nph12.bb.nph12.split_crit_edge
%indvar6 = phi i64 [ %indvar.next7, %bb10 ], [ 0, %bb.nph12.bb.nph12.split_crit_edge ]
%tmp27 = add i64 %tmp26, %indvar6
%scevgep23 = getelementptr [501 x [501 x double]]* @symmat, i64 0, i64 1, i64 %tmp27
%tmp29 = add i64 %indvar6, 2
%scevgep20 = getelementptr [501 x [501 x double]]* @symmat, i64 0, i64 %tmp29, i64 %tmp30
%tmp34 = add i64 %tmp33, %indvar6
store double 0.000000e+00, double* %scevgep23, align 8
br label %bb8
bb8: ; preds = %bb8, %bb.nph
%indvar = phi i64 [ 0, %bb.nph ], [ %tmp, %bb8 ]
%8 = phi double [ 0.000000e+00, %bb.nph ], [ %12, %bb8 ]
%tmp32 = add i64 %indvar, 1
%scevgep = getelementptr [501 x [501 x double]]* @data, i64 0, i64 %tmp32, i64 %tmp34
%scevgep41 = getelementptr [501 x [501 x double]]* @data, i64 0, i64 %tmp32, i64 %tmp38
%tmp = add i64 %indvar, 1
%9 = load double* %scevgep41, align 8
%10 = load double* %scevgep, align 8
%11 = fmul double %9, %10
%12 = fadd double %8, %11
%exitcond1 = icmp eq i64 %tmp, 500
br i1 %exitcond1, label %bb10, label %bb8
bb10: ; preds = %bb8
%.lcssa = phi double [ %12, %bb8 ]
store double %.lcssa, double* %scevgep23
store double %.lcssa, double* %scevgep20, align 8
%indvar.next7 = add i64 %indvar6, 1
%exitcond = icmp eq i64 %indvar.next7, %tmp12
br i1 %exitcond, label %bb12.loopexit, label %bb.nph
bb12.loopexit: ; preds = %bb10
br label %bb12
bb12: ; preds = %bb12.loopexit, %bb6
%indvar.next = add i64 %indvar3, 1
%exitcond24 = icmp eq i64 %indvar.next, 499
br i1 %exitcond24, label %return, label %bb6
return: ; preds = %bb12
ret void
}
declare double @sqrt(double) nounwind readonly

View File

@ -1,138 +0,0 @@
#include <stdio.h>
#include <unistd.h>
#include <string.h>
#include <math.h>
#include "instrument.h"
/* Default problem size. */
#ifndef M
# define M 500
#endif
#ifndef N
# define N 500
#endif
/* Default data type is double. */
#ifndef DATA_TYPE
# define DATA_TYPE double
#endif
#ifndef DATA_PRINTF_MODIFIER
# define DATA_PRINTF_MODIFIER "%0.2lf "
#endif
/* Array declaration. Enable malloc if POLYBENCH_TEST_MALLOC. */
DATA_TYPE float_n = 321414134.01;
#ifndef POLYBENCH_TEST_MALLOC
DATA_TYPE data[M + 1][N + 1];
DATA_TYPE symmat[M + 1][M + 1];
DATA_TYPE mean[M + 1];
#else
DATA_TYPE** data = (DATA_TYPE**)malloc((M + 1) * sizeof(DATA_TYPE*));
DATA_TYPE** symmat = (DATA_TYPE**)malloc((M + 1) * sizeof(DATA_TYPE*));
DATA_TYPE* mean = (DATA_TYPE*)malloc((M + 1) * sizeof(DATA_TYPE));
{
int i;
for (i = 0; i <= M; ++i)
{
data[i] = (DATA_TYPE*)malloc((N + 1) * sizeof(DATA_TYPE));
symmat[i] = (DATA_TYPE*)malloc((M + 1) * sizeof(DATA_TYPE));
}
}
#endif
inline
void init_array()
{
int i, j;
for (i = 0; i <= M; i++)
for (j = 0; j <= N; j++)
data[i][j] = ((DATA_TYPE) i*j) / M;
}
/* Define the live-out variables. Code is not executed unless
POLYBENCH_DUMP_ARRAYS is defined. */
inline
void print_array(int argc, char** argv)
{
int i, j;
#ifndef POLYBENCH_DUMP_ARRAYS
if (argc > 42 && ! strcmp(argv[0], ""))
#endif
{
for (i = 0; i <= M; i++)
for (j = 0; j <= M; j++) {
fprintf(stderr, DATA_PRINTF_MODIFIER, symmat[i][j]);
if ((i * M + j) % 80 == 20) fprintf(stderr, "\n");
}
fprintf(stderr, "\n");
}
}
#ifndef SCOP_PARAM
void scop_func() {
int m = M;
int n = N;
#else
void scop_func(long m, long n) {
#endif
long i, j, j1, j2;
#pragma scop
#pragma live-out symmat
/* Determine mean of column vectors of input data matrix */
for (j = 1; j <= m; j++)
{
mean[j] = 0.0;
for (i = 1; i <= n; i++)
mean[j] += data[i][j];
mean[j] /= float_n;
}
/* Center the column vectors. */
for (i = 1; i <= n; i++)
for (j = 1; j <= m; j++)
data[i][j] -= mean[j];
/* Calculate the m * m covariance matrix. */
for (j1 = 1; j1 <= m; j1++)
for (j2 = j1; j2 <= m; j2++)
{
symmat[j1][j2] = 0.0;
for (i = 1; i <= n; i++)
symmat[j1][j2] += data[i][j1] * data[i][j2];
symmat[j2][j1] = symmat[j1][j2];
}
#pragma endscop
}
int main(int argc, char** argv)
{
int i, j, j1, j2;
int m = M;
int n = N;
/* Initialize array. */
init_array();
/* Start timer. */
polybench_start_instruments;
#ifndef SCOP_PARAM
scop_func();
#else
scop_func(m, n);
#endif
/* Stop and print timer. */
polybench_stop_instruments;
polybench_print_instruments;
print_array(argc, argv);
return 0;
}

View File

@ -1,202 +0,0 @@
; RUN: opt %loadPolly %defaultOpts -polly-analyze-ir -print-top-scop-only -analyze %s | FileCheck %s
; XFAIL: *
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"
%struct._IO_FILE = type { i32, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, %struct._IO_marker*, %struct._IO_FILE*, i32, i32, i64, i16, i8, [1 x i8], i8*, i64, i8*, i8*, i8*, i8*, i64, i32, [20 x i8] }
%struct._IO_marker = type { %struct._IO_marker*, %struct._IO_FILE*, i32 }
@float_n = global double 0x41B32863F6028F5C
@data = common global [501 x [501 x double]] zeroinitializer, align 32
@symmat = common global [501 x [501 x double]] zeroinitializer, align 32
@stderr = external global %struct._IO_FILE*
@.str = private constant [8 x i8] c"%0.2lf \00", align 1
@mean = common global [501 x double] zeroinitializer, align 32
define void @scop_func(i64 %m, i64 %n) nounwind {
entry:
%0 = icmp slt i64 %m, 1
br i1 %0, label %bb10.preheader, label %bb.nph44
bb.nph44: ; preds = %entry
%1 = icmp slt i64 %n, 1
%2 = load double* @float_n, align 8
br i1 %1, label %bb3.us.preheader, label %bb.nph36.preheader
bb3.us.preheader: ; preds = %bb.nph44
br label %bb3.us
bb.nph36.preheader: ; preds = %bb.nph44
br label %bb.nph36
bb3.us: ; preds = %bb3.us.preheader, %bb3.us
%indvar = phi i64 [ %tmp, %bb3.us ], [ 0, %bb3.us.preheader ]
%tmp45 = add i64 %indvar, 2
%tmp13 = add i64 %indvar, 1
%scevgep = getelementptr [501 x double]* @mean, i64 0, i64 %tmp13
%tmp = add i64 %indvar, 1
%3 = fdiv double 0.000000e+00, %2
store double %3, double* %scevgep, align 8
%4 = icmp sgt i64 %tmp45, %m
br i1 %4, label %bb10.preheader.loopexit1, label %bb3.us
bb.nph36: ; preds = %bb.nph36.preheader, %bb3
%indvar94 = phi i64 [ %tmp100, %bb3 ], [ 0, %bb.nph36.preheader ]
%tmp8 = add i64 %indvar94, 1
%tmp102 = add i64 %indvar94, 2
%scevgep103 = getelementptr [501 x double]* @mean, i64 0, i64 %tmp8
%tmp100 = add i64 %indvar94, 1
store double 0.000000e+00, double* %scevgep103, align 8
br label %bb1
bb1: ; preds = %bb1, %bb.nph36
%indvar91 = phi i64 [ 0, %bb.nph36 ], [ %tmp99, %bb1 ]
%5 = phi double [ 0.000000e+00, %bb.nph36 ], [ %7, %bb1 ]
%tmp7 = add i64 %indvar91, 1
%scevgep97 = getelementptr [501 x [501 x double]]* @data, i64 0, i64 %tmp7, i64 %tmp8
%tmp98 = add i64 %indvar91, 2
%tmp99 = add i64 %indvar91, 1
%6 = load double* %scevgep97, align 8
%7 = fadd double %5, %6
%8 = icmp sgt i64 %tmp98, %n
br i1 %8, label %bb3, label %bb1
bb3: ; preds = %bb1
%.lcssa = phi double [ %7, %bb1 ]
%9 = fdiv double %.lcssa, %2
store double %9, double* %scevgep103, align 8
%10 = icmp sgt i64 %tmp102, %m
br i1 %10, label %bb10.preheader.loopexit, label %bb.nph36
bb10.preheader.loopexit: ; preds = %bb3
br label %bb10.preheader
bb10.preheader.loopexit1: ; preds = %bb3.us
br label %bb10.preheader
bb10.preheader: ; preds = %bb10.preheader.loopexit1, %bb10.preheader.loopexit, %entry
%11 = icmp slt i64 %n, 1
br i1 %11, label %bb19.preheader, label %bb.nph33
bb7: ; preds = %bb8.preheader, %bb7
%indvar77 = phi i64 [ %tmp87, %bb7 ], [ 0, %bb8.preheader ]
%tmp21 = add i64 %indvar77, 1
%scevgep83 = getelementptr [501 x [501 x double]]* @data, i64 0, i64 %tmp20, i64 %tmp21
%tmp85 = add i64 %indvar77, 2
%tmp16 = add i64 %indvar77, 1
%scevgep84 = getelementptr [501 x double]* @mean, i64 0, i64 %tmp16
%tmp87 = add i64 %indvar77, 1
%12 = load double* %scevgep83, align 8
%13 = load double* %scevgep84, align 8
%14 = fsub double %12, %13
store double %14, double* %scevgep83, align 8
%15 = icmp sgt i64 %tmp85, %m
br i1 %15, label %bb9, label %bb7
bb9: ; preds = %bb7
%16 = icmp sgt i64 %tmp89, %n
br i1 %16, label %bb19.preheader.loopexit, label %bb8.preheader
bb.nph33: ; preds = %bb10.preheader
br i1 %0, label %return, label %bb8.preheader.preheader
bb8.preheader.preheader: ; preds = %bb.nph33
br label %bb8.preheader
bb8.preheader: ; preds = %bb8.preheader.preheader, %bb9
%indvar79 = phi i64 [ %tmp86, %bb9 ], [ 0, %bb8.preheader.preheader ]
%tmp20 = add i64 %indvar79, 1
%tmp89 = add i64 %indvar79, 2
%tmp86 = add i64 %indvar79, 1
br label %bb7
bb19.preheader.loopexit: ; preds = %bb9
br label %bb19.preheader
bb19.preheader: ; preds = %bb19.preheader.loopexit, %bb10.preheader
br i1 %0, label %return, label %bb17.preheader.preheader
bb17.preheader.preheader: ; preds = %bb19.preheader
br label %bb17.preheader
bb.nph13: ; preds = %bb17.preheader
br i1 %11, label %bb16.us.preheader, label %bb.nph13.bb.nph13.split_crit_edge
bb16.us.preheader: ; preds = %bb.nph13
br label %bb16.us
bb.nph13.bb.nph13.split_crit_edge: ; preds = %bb.nph13
br label %bb.nph
bb16.us: ; preds = %bb16.us.preheader, %bb16.us
%indvar48 = phi i64 [ %indvar.next49, %bb16.us ], [ 0, %bb16.us.preheader ]
%tmp57 = add i64 %tmp56, %indvar48
%scevgep57 = getelementptr [501 x [501 x double]]* @symmat, i64 0, i64 1, i64 %tmp57
%tmp59 = add i64 %indvar48, 1
%scevgep52 = getelementptr [501 x [501 x double]]* @symmat, i64 0, i64 %tmp59, i64 %tmp56
%tmp54 = add i64 %tmp61, %indvar48
store double 0.000000e+00, double* %scevgep57, align 8
store double 0.000000e+00, double* %scevgep52, align 8
%17 = icmp sgt i64 %tmp54, %m
%indvar.next49 = add i64 %indvar48, 1
br i1 %17, label %bb18.loopexit2, label %bb16.us
bb.nph: ; preds = %bb16, %bb.nph13.bb.nph13.split_crit_edge
%indvar62 = phi i64 [ 0, %bb.nph13.bb.nph13.split_crit_edge ], [ %indvar.next63, %bb16 ]
%tmp72 = add i64 %tmp61, %indvar62
%tmp64 = add i64 %indvar62, 1
%scevgep74 = getelementptr [501 x [501 x double]]* @symmat, i64 0, i64 %tmp64, i64 %tmp56
%tmp69 = add i64 %tmp56, %indvar62
%scevgep76 = getelementptr [501 x [501 x double]]* @symmat, i64 0, i64 1, i64 %tmp69
%tmp74 = add i64 %storemerge214, %indvar62
store double 0.000000e+00, double* %scevgep76, align 8
br label %bb14
bb14: ; preds = %bb14, %bb.nph
%indvar59 = phi i64 [ 0, %bb.nph ], [ %tmp68, %bb14 ]
%18 = phi double [ 0.000000e+00, %bb.nph ], [ %22, %bb14 ]
%tmp71 = add i64 %indvar59, 1
%scevgep65 = getelementptr [501 x [501 x double]]* @data, i64 0, i64 %tmp71, i64 %tmp74
%scevgep66 = getelementptr [501 x [501 x double]]* @data, i64 0, i64 %tmp71, i64 %storemerge214
%tmp67 = add i64 %indvar59, 2
%tmp68 = add i64 %indvar59, 1
%19 = load double* %scevgep66, align 8
%20 = load double* %scevgep65, align 8
%21 = fmul double %19, %20
%22 = fadd double %18, %21
%23 = icmp sgt i64 %tmp67, %n
br i1 %23, label %bb16, label %bb14
bb16: ; preds = %bb14
%.lcssa24 = phi double [ %22, %bb14 ]
store double %.lcssa24, double* %scevgep76
store double %.lcssa24, double* %scevgep74, align 8
%24 = icmp sgt i64 %tmp72, %m
%indvar.next63 = add i64 %indvar62, 1
br i1 %24, label %bb18.loopexit, label %bb.nph
bb18.loopexit: ; preds = %bb16
br label %bb18
bb18.loopexit2: ; preds = %bb16.us
br label %bb18
bb18: ; preds = %bb18.loopexit2, %bb18.loopexit, %bb17.preheader
%indvar.next = add i64 %indvar27, 1
%exitcond = icmp eq i64 %indvar.next, %m
br i1 %exitcond, label %return.loopexit, label %bb17.preheader
bb17.preheader: ; preds = %bb17.preheader.preheader, %bb18
%indvar27 = phi i64 [ 0, %bb17.preheader.preheader ], [ %indvar.next, %bb18 ]
%tmp55 = mul i64 %indvar27, 502
%tmp56 = add i64 %tmp55, 1
%tmp61 = add i64 %indvar27, 2
%storemerge214 = add i64 %indvar27, 1
br i1 false, label %bb18, label %bb.nph13
return.loopexit: ; preds = %bb18
br label %return
return: ; preds = %return.loopexit, %bb19.preheader, %bb.nph33
ret void
}

View File

@ -1,132 +0,0 @@
; RUN: opt %loadPolly %defaultOpts -polly-detect -polly-ast -polly-codegen-scev -analyze %s | FileCheck %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"
%struct._IO_FILE = type { i32, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, %struct._IO_marker*, %struct._IO_FILE*, i32, i32, i64, i16, i8, [1 x i8], i8*, i64, i8*, i8*, i8*, i8*, i64, i32, [20 x i8] }
%struct._IO_marker = type { %struct._IO_marker*, %struct._IO_FILE*, i32 }
@float_n = global double 0x41B32863F6028F5C
@data = common global [501 x [501 x double]] zeroinitializer, align 32
@symmat = common global [501 x [501 x double]] zeroinitializer, align 32
@stderr = external global %struct._IO_FILE*
@.str = private constant [8 x i8] c"%0.2lf \00", align 1
@mean = common global [501 x double] zeroinitializer, align 32
define void @scop_func() nounwind {
bb.nph44.bb.nph44.split_crit_edge:
%0 = load double* @float_n, align 8
br label %bb.nph36
bb.nph36: ; preds = %bb3, %bb.nph44.bb.nph44.split_crit_edge
%indvar77 = phi i64 [ 0, %bb.nph44.bb.nph44.split_crit_edge ], [ %tmp83, %bb3 ]
%tmp48 = add i64 %indvar77, 1
%scevgep85 = getelementptr [501 x double]* @mean, i64 0, i64 %tmp48
%tmp83 = add i64 %indvar77, 1
store double 0.000000e+00, double* %scevgep85, align 8
br label %bb1
bb1: ; preds = %bb1, %bb.nph36
%indvar73 = phi i64 [ 0, %bb.nph36 ], [ %tmp82, %bb1 ]
%1 = phi double [ 0.000000e+00, %bb.nph36 ], [ %3, %bb1 ]
%tmp47 = add i64 %indvar73, 1
%scevgep80 = getelementptr [501 x [501 x double]]* @data, i64 0, i64 %tmp47, i64 %tmp48
%tmp82 = add i64 %indvar73, 1
%2 = load double* %scevgep80, align 8
%3 = fadd double %1, %2
%exitcond42 = icmp eq i64 %tmp82, 500
br i1 %exitcond42, label %bb3, label %bb1
bb3: ; preds = %bb1
%.lcssa41 = phi double [ %3, %bb1 ]
%4 = fdiv double %.lcssa41, %0
store double %4, double* %scevgep85, align 8
%exitcond46 = icmp eq i64 %tmp83, 500
br i1 %exitcond46, label %bb8.preheader.preheader, label %bb.nph36
bb8.preheader.preheader: ; preds = %bb3
br label %bb8.preheader
bb7: ; preds = %bb8.preheader, %bb7
%indvar59 = phi i64 [ %tmp70, %bb7 ], [ 0, %bb8.preheader ]
%tmp39 = add i64 %indvar59, 1
%scevgep66 = getelementptr [501 x [501 x double]]* @data, i64 0, i64 %tmp38, i64 %tmp39
%tmp = add i64 %indvar59, 1
%scevgep67 = getelementptr [501 x double]* @mean, i64 0, i64 %tmp
%tmp70 = add i64 %indvar59, 1
%5 = load double* %scevgep66, align 8
%6 = load double* %scevgep67, align 8
%7 = fsub double %5, %6
store double %7, double* %scevgep66, align 8
%exitcond33 = icmp eq i64 %tmp70, 500
br i1 %exitcond33, label %bb9, label %bb7
bb9: ; preds = %bb7
%tmp69 = add i64 %indvar62, 1
%exitcond37 = icmp eq i64 %tmp69, 500
br i1 %exitcond37, label %bb17.preheader.preheader, label %bb8.preheader
bb17.preheader.preheader: ; preds = %bb9
br label %bb17.preheader
bb8.preheader: ; preds = %bb8.preheader.preheader, %bb9
%indvar62 = phi i64 [ %tmp69, %bb9 ], [ 0, %bb8.preheader.preheader ]
%tmp38 = add i64 %indvar62, 1
br label %bb7
bb.nph13.bb.nph13.split_crit_edge: ; preds = %bb17.preheader
br label %bb.nph
bb.nph: ; preds = %bb16, %bb.nph13.bb.nph13.split_crit_edge
%indvar46 = phi i64 [ 0, %bb.nph13.bb.nph13.split_crit_edge ], [ %indvar.next47, %bb16 ]
%tmp20 = add i64 %indvar46, 1
%scevgep56 = getelementptr [501 x [501 x double]]* @symmat, i64 0, i64 %tmp20, i64 %tmp22
%tmp24 = add i64 %tmp22, %indvar46
%scevgep58 = getelementptr [501 x [501 x double]]* @symmat, i64 0, i64 1, i64 %tmp24
%tmp28 = add i64 %storemerge214, %indvar46
store double 0.000000e+00, double* %scevgep58, align 8
br label %bb14
bb14: ; preds = %bb14, %bb.nph
%indvar = phi i64 [ 0, %bb.nph ], [ %tmp50, %bb14 ]
%8 = phi double [ 0.000000e+00, %bb.nph ], [ %12, %bb14 ]
%tmp26 = add i64 %indvar, 1
%scevgep = getelementptr [501 x [501 x double]]* @data, i64 0, i64 %tmp26, i64 %tmp28
%scevgep49 = getelementptr [501 x [501 x double]]* @data, i64 0, i64 %tmp26, i64 %storemerge214
%tmp50 = add i64 %indvar, 1
%9 = load double* %scevgep49, align 8
%10 = load double* %scevgep, align 8
%11 = fmul double %9, %10
%12 = fadd double %8, %11
%exitcond1 = icmp eq i64 %tmp50, 500
br i1 %exitcond1, label %bb16, label %bb14
bb16: ; preds = %bb14
%.lcssa = phi double [ %12, %bb14 ]
store double %.lcssa, double* %scevgep58
store double %.lcssa, double* %scevgep56, align 8
%indvar.next47 = add i64 %indvar46, 1
%exitcond = icmp eq i64 %indvar.next47, %tmp8
br i1 %exitcond, label %bb18.loopexit, label %bb.nph
bb18.loopexit: ; preds = %bb16
br label %bb18
bb18: ; preds = %bb18.loopexit, %bb17.preheader
%indvar.next = add i64 %indvar2, 1
%exitcond19 = icmp eq i64 %indvar.next, 500
br i1 %exitcond19, label %return, label %bb17.preheader
bb17.preheader: ; preds = %bb17.preheader.preheader, %bb18
%indvar2 = phi i64 [ 0, %bb17.preheader.preheader ], [ %indvar.next, %bb18 ]
%tmp21 = mul i64 %indvar2, 502
%tmp22 = add i64 %tmp21, 1
%storemerge214 = add i64 %indvar2, 1
%tmp30 = mul i64 %indvar2, -1
%tmp8 = add i64 %tmp30, 500
br i1 false, label %bb18, label %bb.nph13.bb.nph13.split_crit_edge
return: ; preds = %bb18
ret void
}
; CHECK: for region: 'bb.nph36 => return' in function 'scop_func':

View File

@ -1,168 +0,0 @@
#include <stdio.h>
#include <unistd.h>
#include <string.h>
#include <math.h>
#include "instrument.h"
/* Default problem size. */
#ifndef NI
# define NI 512
#endif
#ifndef NJ
# define NJ 512
#endif
#ifndef NK
# define NK 512
#endif
#ifndef NL
# define NL 512
#endif
/* Default data type is double (dgemm). */
#ifndef DATA_TYPE
# define DATA_TYPE double
#endif
/* Array declaration. Enable malloc if POLYBENCH_TEST_MALLOC. */
DATA_TYPE alpha1;
DATA_TYPE beta1;
DATA_TYPE alpha2;
DATA_TYPE beta2;
#ifndef POLYBENCH_TEST_MALLOC
DATA_TYPE C[NI][NJ];
DATA_TYPE A[NI][NK];
DATA_TYPE B[NK][NJ];
DATA_TYPE D[NJ][NL];
DATA_TYPE E[NI][NL];
#else
DATA_TYPE** C = (DATA_TYPE**)malloc(NI * sizeof(DATA_TYPE*));
DATA_TYPE** A = (DATA_TYPE**)malloc(NI * sizeof(DATA_TYPE*));
DATA_TYPE** B = (DATA_TYPE**)malloc(NK * sizeof(DATA_TYPE*));
DATA_TYPE** D = (DATA_TYPE**)malloc(NJ * sizeof(DATA_TYPE*));
DATA_TYPE** E = (DATA_TYPE**)malloc(NI * sizeof(DATA_TYPE*));
{
int i;
for (i = 0; i < NI; ++i)
{
C[i] = (DATA_TYPE*)malloc(NJ * sizeof(DATA_TYPE));
A[i] = (DATA_TYPE*)malloc(NK * sizeof(DATA_TYPE));
E[i] = (DATA_TYPE*)malloc(NL * sizeof(DATA_TYPE));
}
for (i = 0; i < NK; ++i)
B[i] = (DATA_TYPE*)malloc(NJ * sizeof(DATA_TYPE));
for (i = 0; i < NJ; ++i)
D[i] = (DATA_TYPE*)malloc(NL * sizeof(DATA_TYPE));
}
#endif
inline
void init_array()
{
int i, j;
alpha1 = 32412;
beta1 = 2123;
alpha2 = 132412;
beta2 = 92123;
for (i = 0; i < NI; i++)
for (j = 0; j < NK; j++)
A[i][j] = ((DATA_TYPE) i*j)/NI;
for (i = 0; i < NK; i++)
for (j = 0; j < NJ; j++)
B[i][j] = ((DATA_TYPE) i*j + 1)/NJ;
for (i = 0; i < NI; i++)
for (j = 0; j < NJ; j++)
C[i][j] = ((DATA_TYPE) i*j + 2)/NJ;
for (i = 0; i < NJ; i++)
for (j = 0; j < NL; j++)
D[i][j] = ((DATA_TYPE) i*j + 2)/NJ;
for (i = 0; i < NI; i++)
for (j = 0; j < NL; j++)
E[i][j] = ((DATA_TYPE) i*j + 2)/NJ;
}
/* Define the live-out variables. Code is not executed unless
POLYBENCH_DUMP_ARRAYS is defined. */
inline
void print_array(int argc, char** argv)
{
int i, j;
#ifndef POLYBENCH_DUMP_ARRAYS
if (argc > 42 && ! strcmp(argv[0], ""))
#endif
{
for (i = 0; i < NI; i++) {
for (j = 0; j < NL; j++) {
fprintf(stderr, "%0.2lf ", E[i][j]);
if ((i * NI + j) % 80 == 20) fprintf(stderr, "\n");
}
fprintf(stderr, "\n");
}
}
}
#ifndef SCOP_PARAM
void scop_func() {
long ni = NI;
long nj = NJ;
long nk = NK;
long nl = NL;
#else
void scop_func(long ni, long nj, long nk, long nl) {
#endif
long i, j, k;
#pragma scop
#pragma live-out E
/* E := A*B*C */
for (i = 0; i < ni; i++)
for (j = 0; j < nj; j++)
{
C[i][j] = 0;
for (k = 0; k < nk; ++k)
C[i][j] += A[i][k] * B[k][j];
}
for (i = 0; i < ni; i++)
for (j = 0; j < nl; j++)
{
E[i][j] = 0;
for (k = 0; k < nj; ++k)
E[i][j] += C[i][k] * D[k][j];
}
#pragma endscop
}
int main(int argc, char** argv)
{
int i, j, k;
int ni = NI;
int nj = NJ;
int nk = NK;
int nl = NL;
/* Initialize array. */
init_array();
/* Start timer. */
polybench_start_instruments;
#ifndef SCOP_PARAM
scop_func();
#else
scop_func(ni, nj, nk, nl);
#endif
/* Stop and print timer. */
polybench_stop_instruments;
polybench_print_instruments;
print_array(argc, argv);
return 0;
}

View File

@ -1,163 +0,0 @@
; RUN: opt %loadPolly %defaultOpts -polly-ast -analyze %s| FileCheck %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"
%struct._IO_FILE = type { i32, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, %struct._IO_marker*, %struct._IO_FILE*, i32, i32, i64, i16, i8, [1 x i8], i8*, i64, i8*, i8*, i8*, i8*, i64, i32, [20 x i8] }
%struct._IO_marker = type { %struct._IO_marker*, %struct._IO_FILE*, i32 }
@alpha1 = common global double 0.000000e+00
@beta1 = common global double 0.000000e+00
@alpha2 = common global double 0.000000e+00
@beta2 = common global double 0.000000e+00
@A = common global [512 x [512 x double]] zeroinitializer, align 32
@B = common global [512 x [512 x double]] zeroinitializer, align 32
@C = common global [512 x [512 x double]] zeroinitializer, align 32
@D = common global [512 x [512 x double]] zeroinitializer, align 32
@E = common global [512 x [512 x double]] zeroinitializer, align 32
@stderr = external global %struct._IO_FILE*
@.str = private constant [8 x i8] c"%0.2lf \00", align 1
define void @scop_func(i64 %ni, i64 %nj, i64 %nk, i64 %nl) nounwind {
entry:
%0 = icmp sgt i64 %ni, 0
br i1 %0, label %bb.nph50, label %return
bb.nph35: ; preds = %bb.nph35.preheader, %bb6
%indvar17 = phi i64 [ 0, %bb.nph35.preheader ], [ %indvar.next18, %bb6 ]
br i1 %8, label %bb.nph27.us.preheader, label %bb4.preheader
bb.nph27.us.preheader: ; preds = %bb.nph35
br label %bb.nph27.us
bb4.preheader: ; preds = %bb.nph35
br label %bb4
bb4.us: ; preds = %bb2.us
%.lcssa20 = phi double [ %5, %bb2.us ]
store double %.lcssa20, double* %scevgep64
%1 = add nsw i64 %storemerge431.us, 1
%exitcond24 = icmp eq i64 %1, %nj
br i1 %exitcond24, label %bb6.loopexit2, label %bb.nph27.us
bb2.us: ; preds = %bb.nph27.us, %bb2.us
%.tmp.029.us = phi double [ 0.000000e+00, %bb.nph27.us ], [ %5, %bb2.us ]
%storemerge526.us = phi i64 [ 0, %bb.nph27.us ], [ %6, %bb2.us ]
%scevgep61 = getelementptr [512 x [512 x double]]* @A, i64 0, i64 %indvar17, i64 %storemerge526.us
%scevgep60 = getelementptr [512 x [512 x double]]* @B, i64 0, i64 %storemerge526.us, i64 %storemerge431.us
%2 = load double* %scevgep61, align 8
%3 = load double* %scevgep60, align 8
%4 = fmul double %2, %3
%5 = fadd double %.tmp.029.us, %4
%6 = add nsw i64 %storemerge526.us, 1
%exitcond21 = icmp eq i64 %6, %nk
br i1 %exitcond21, label %bb4.us, label %bb2.us
bb.nph27.us: ; preds = %bb.nph27.us.preheader, %bb4.us
%storemerge431.us = phi i64 [ %1, %bb4.us ], [ 0, %bb.nph27.us.preheader ]
%scevgep64 = getelementptr [512 x [512 x double]]* @C, i64 0, i64 %indvar17, i64 %storemerge431.us
store double 0.000000e+00, double* %scevgep64, align 8
br label %bb2.us
bb4: ; preds = %bb4.preheader, %bb4
%indvar67 = phi i64 [ %indvar.next68, %bb4 ], [ 0, %bb4.preheader ]
%scevgep72 = getelementptr [512 x [512 x double]]* @C, i64 0, i64 %indvar17, i64 %indvar67
store double 0.000000e+00, double* %scevgep72, align 8
%indvar.next68 = add i64 %indvar67, 1
%exitcond16 = icmp eq i64 %indvar.next68, %nj
br i1 %exitcond16, label %bb6.loopexit, label %bb4
bb6.loopexit: ; preds = %bb4
br label %bb6
bb6.loopexit2: ; preds = %bb4.us
br label %bb6
bb6: ; preds = %bb6.loopexit2, %bb6.loopexit
%indvar.next18 = add i64 %indvar17, 1
%exitcond27 = icmp ne i64 %indvar.next18, %ni
br i1 %exitcond27, label %bb.nph35, label %bb16.preheader.loopexit
bb.nph50: ; preds = %entry
%7 = icmp sgt i64 %nj, 0
%8 = icmp sgt i64 %nk, 0
br i1 %7, label %bb.nph35.preheader, label %bb16.preheader
bb.nph35.preheader: ; preds = %bb.nph50
br label %bb.nph35
bb16.preheader.loopexit: ; preds = %bb6
br label %bb16.preheader
bb16.preheader: ; preds = %bb16.preheader.loopexit, %bb.nph50
br i1 %0, label %bb.nph25, label %return
bb.nph11: ; preds = %bb.nph11.preheader, %bb15
%indvar4 = phi i64 [ 0, %bb.nph11.preheader ], [ %indvar.next5, %bb15 ]
br i1 %16, label %bb.nph.us.preheader, label %bb13.preheader
bb.nph.us.preheader: ; preds = %bb.nph11
br label %bb.nph.us
bb13.preheader: ; preds = %bb.nph11
br label %bb13
bb13.us: ; preds = %bb11.us
%.lcssa = phi double [ %13, %bb11.us ]
store double %.lcssa, double* %scevgep54
%9 = add nsw i64 %storemerge27.us, 1
%exitcond = icmp eq i64 %9, %nl
br i1 %exitcond, label %bb15.loopexit1, label %bb.nph.us
bb11.us: ; preds = %bb.nph.us, %bb11.us
%.tmp.0.us = phi double [ 0.000000e+00, %bb.nph.us ], [ %13, %bb11.us ]
%storemerge36.us = phi i64 [ 0, %bb.nph.us ], [ %14, %bb11.us ]
%scevgep51 = getelementptr [512 x [512 x double]]* @C, i64 0, i64 %indvar4, i64 %storemerge36.us
%scevgep = getelementptr [512 x [512 x double]]* @D, i64 0, i64 %storemerge36.us, i64 %storemerge27.us
%10 = load double* %scevgep51, align 8
%11 = load double* %scevgep, align 8
%12 = fmul double %10, %11
%13 = fadd double %.tmp.0.us, %12
%14 = add nsw i64 %storemerge36.us, 1
%exitcond7 = icmp eq i64 %14, %nj
br i1 %exitcond7, label %bb13.us, label %bb11.us
bb.nph.us: ; preds = %bb.nph.us.preheader, %bb13.us
%storemerge27.us = phi i64 [ %9, %bb13.us ], [ 0, %bb.nph.us.preheader ]
%scevgep54 = getelementptr [512 x [512 x double]]* @E, i64 0, i64 %indvar4, i64 %storemerge27.us
store double 0.000000e+00, double* %scevgep54, align 8
br label %bb11.us
bb13: ; preds = %bb13.preheader, %bb13
%indvar = phi i64 [ %indvar.next, %bb13 ], [ 0, %bb13.preheader ]
%scevgep57 = getelementptr [512 x [512 x double]]* @E, i64 0, i64 %indvar4, i64 %indvar
store double 0.000000e+00, double* %scevgep57, align 8
%indvar.next = add i64 %indvar, 1
%exitcond3 = icmp eq i64 %indvar.next, %nl
br i1 %exitcond3, label %bb15.loopexit, label %bb13
bb15.loopexit: ; preds = %bb13
br label %bb15
bb15.loopexit1: ; preds = %bb13.us
br label %bb15
bb15: ; preds = %bb15.loopexit1, %bb15.loopexit
%indvar.next5 = add i64 %indvar4, 1
%exitcond12 = icmp ne i64 %indvar.next5, %ni
br i1 %exitcond12, label %bb.nph11, label %return.loopexit
bb.nph25: ; preds = %bb16.preheader
%15 = icmp sgt i64 %nl, 0
%16 = icmp sgt i64 %nj, 0
br i1 %15, label %bb.nph11.preheader, label %return
bb.nph11.preheader: ; preds = %bb.nph25
br label %bb.nph11
return.loopexit: ; preds = %bb15
br label %return
return: ; preds = %return.loopexit, %bb.nph25, %bb16.preheader, %entry
ret void
}
; CHECK: for region: 'entry.split => return' in function 'scop_func':

View File

@ -1,100 +0,0 @@
; RUN: opt %loadPolly %defaultOpts -polly-detect -analyze %s | FileCheck %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"
%struct._IO_FILE = type { i32, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, %struct._IO_marker*, %struct._IO_FILE*, i32, i32, i64, i16, i8, [1 x i8], i8*, i64, i8*, i8*, i8*, i8*, i64, i32, [20 x i8] }
%struct._IO_marker = type { %struct._IO_marker*, %struct._IO_FILE*, i32 }
@alpha1 = common global double 0.000000e+00
@beta1 = common global double 0.000000e+00
@alpha2 = common global double 0.000000e+00
@beta2 = common global double 0.000000e+00
@A = common global [512 x [512 x double]] zeroinitializer, align 32
@B = common global [512 x [512 x double]] zeroinitializer, align 32
@C = common global [512 x [512 x double]] zeroinitializer, align 32
@D = common global [512 x [512 x double]] zeroinitializer, align 32
@E = common global [512 x [512 x double]] zeroinitializer, align 32
@stderr = external global %struct._IO_FILE*
@.str = private constant [8 x i8] c"%0.2lf \00", align 1
define void @scop_func() nounwind {
bb.nph50.bb.nph50.split_crit_edge:
br label %bb5.preheader
bb4.us: ; preds = %bb2.us
%.lcssa9 = phi double [ %4, %bb2.us ]
store double %.lcssa9, double* %scevgep61
%0 = add nsw i64 %storemerge431.us, 1
%exitcond13 = icmp eq i64 %0, 512
br i1 %exitcond13, label %bb6, label %bb.nph27.us
bb2.us: ; preds = %bb.nph27.us, %bb2.us
%.tmp.029.us = phi double [ 0.000000e+00, %bb.nph27.us ], [ %4, %bb2.us ]
%storemerge526.us = phi i64 [ 0, %bb.nph27.us ], [ %5, %bb2.us ]
%scevgep58 = getelementptr [512 x [512 x double]]* @A, i64 0, i64 %storemerge37, i64 %storemerge526.us
%scevgep57 = getelementptr [512 x [512 x double]]* @B, i64 0, i64 %storemerge526.us, i64 %storemerge431.us
%1 = load double* %scevgep58, align 8
%2 = load double* %scevgep57, align 8
%3 = fmul double %1, %2
%4 = fadd double %.tmp.029.us, %3
%5 = add nsw i64 %storemerge526.us, 1
%exitcond10 = icmp eq i64 %5, 512
br i1 %exitcond10, label %bb4.us, label %bb2.us
bb.nph27.us: ; preds = %bb5.preheader, %bb4.us
%storemerge431.us = phi i64 [ %0, %bb4.us ], [ 0, %bb5.preheader ]
%scevgep61 = getelementptr [512 x [512 x double]]* @C, i64 0, i64 %storemerge37, i64 %storemerge431.us
store double 0.000000e+00, double* %scevgep61, align 8
br label %bb2.us
bb6: ; preds = %bb4.us
%6 = add nsw i64 %storemerge37, 1
%exitcond16 = icmp ne i64 %6, 512
br i1 %exitcond16, label %bb5.preheader, label %bb14.preheader.preheader
bb14.preheader.preheader: ; preds = %bb6
br label %bb14.preheader
bb5.preheader: ; preds = %bb6, %bb.nph50.bb.nph50.split_crit_edge
%storemerge37 = phi i64 [ 0, %bb.nph50.bb.nph50.split_crit_edge ], [ %6, %bb6 ]
br label %bb.nph27.us
bb13.us: ; preds = %bb11.us
%.lcssa = phi double [ %11, %bb11.us ]
store double %.lcssa, double* %scevgep54
%7 = add nsw i64 %storemerge27.us, 1
%exitcond = icmp eq i64 %7, 512
br i1 %exitcond, label %bb15, label %bb.nph.us
bb11.us: ; preds = %bb.nph.us, %bb11.us
%.tmp.0.us = phi double [ 0.000000e+00, %bb.nph.us ], [ %11, %bb11.us ]
%storemerge36.us = phi i64 [ 0, %bb.nph.us ], [ %12, %bb11.us ]
%scevgep51 = getelementptr [512 x [512 x double]]* @C, i64 0, i64 %storemerge112, i64 %storemerge36.us
%scevgep = getelementptr [512 x [512 x double]]* @D, i64 0, i64 %storemerge36.us, i64 %storemerge27.us
%8 = load double* %scevgep51, align 8
%9 = load double* %scevgep, align 8
%10 = fmul double %8, %9
%11 = fadd double %.tmp.0.us, %10
%12 = add nsw i64 %storemerge36.us, 1
%exitcond1 = icmp eq i64 %12, 512
br i1 %exitcond1, label %bb13.us, label %bb11.us
bb.nph.us: ; preds = %bb14.preheader, %bb13.us
%storemerge27.us = phi i64 [ %7, %bb13.us ], [ 0, %bb14.preheader ]
%scevgep54 = getelementptr [512 x [512 x double]]* @E, i64 0, i64 %storemerge112, i64 %storemerge27.us
store double 0.000000e+00, double* %scevgep54, align 8
br label %bb11.us
bb15: ; preds = %bb13.us
%13 = add nsw i64 %storemerge112, 1
%exitcond6 = icmp ne i64 %13, 512
br i1 %exitcond6, label %bb14.preheader, label %return
bb14.preheader: ; preds = %bb14.preheader.preheader, %bb15
%storemerge112 = phi i64 [ %13, %bb15 ], [ 0, %bb14.preheader.preheader ]
br label %bb.nph.us
return: ; preds = %bb15
ret void
}
; CHECK: Valid Region for Scop: bb5.preheader => return

View File

@ -1 +0,0 @@
-DNI=1024 -DNJ=1024 -DNK=1024 -DNL=1024

View File

@ -1,217 +0,0 @@
#include <stdio.h>
#include <unistd.h>
#include <string.h>
#include <math.h>
#include "instrument.h"
/* Default problem size. */
#ifndef NI
# define NI 512
#endif
#ifndef NJ
# define NJ 512
#endif
#ifndef NK
# define NK 512
#endif
#ifndef NL
# define NL 512
#endif
#ifndef NM
# define NM 512
#endif
/* Default data type is double (dgemm). */
#ifndef DATA_TYPE
# define DATA_TYPE double
#endif
/* Array declaration. Enable malloc if POLYBENCH_TEST_MALLOC. */
#ifndef POLYBENCH_TEST_MALLOC
DATA_TYPE A[NI][NK];
DATA_TYPE B[NK][NJ];
DATA_TYPE C[NJ][NM];
DATA_TYPE D[NM][NL];
DATA_TYPE E[NI][NJ];
DATA_TYPE F[NJ][NL];
DATA_TYPE G[NI][NL];
#else
DATA_TYPE** A = (DATA_TYPE**)malloc(NI * sizeof(DATA_TYPE*));
DATA_TYPE** B = (DATA_TYPE**)malloc(NK * sizeof(DATA_TYPE*));
DATA_TYPE** C = (DATA_TYPE**)malloc(NJ * sizeof(DATA_TYPE*));
DATA_TYPE** D = (DATA_TYPE**)malloc(NM * sizeof(DATA_TYPE*));
DATA_TYPE** E = (DATA_TYPE**)malloc(NI * sizeof(DATA_TYPE*));
DATA_TYPE** F = (DATA_TYPE**)malloc(NJ * sizeof(DATA_TYPE*));
DATA_TYPE** G = (DATA_TYPE**)malloc(NI * sizeof(DATA_TYPE*));
{
int i;
for (i = 0; i < NI; ++i)
{
A[i] = (DATA_TYPE*)malloc(NK * sizeof(DATA_TYPE));
E[i] = (DATA_TYPE*)malloc(NJ * sizeof(DATA_TYPE));
G[i] = (DATA_TYPE*)malloc(NL * sizeof(DATA_TYPE));
}
for (i = 0; i < NK; ++i)
B[i] = (DATA_TYPE*)malloc(NJ * sizeof(DATA_TYPE));
for (i = 0; i < NJ; ++i)
{
C[i] = (DATA_TYPE*)malloc(NM * sizeof(DATA_TYPE));
F[i] = (DATA_TYPE*)malloc(NL * sizeof(DATA_TYPE));
}
for (i = 0; i < NM; ++i)
D[i] = (DATA_TYPE*)malloc(NL * sizeof(DATA_TYPE));
}
#endif
inline
void init_array()
{
int i, j;
for (i = 0; i < NI; i++)
for (j = 0; j < NK; j++)
A[i][j] = ((DATA_TYPE) i*j)/NI;
for (i = 0; i < NK; i++)
for (j = 0; j < NJ; j++)
B[i][j] = ((DATA_TYPE) i*j + 1)/NJ;
for (i = 0; i < NJ; i++)
for (j = 0; j < NM; j++)
C[i][j] = ((DATA_TYPE) i*j + 2)/NJ;
for (i = 0; i < NM; i++)
for (j = 0; j < NL; j++)
D[i][j] = ((DATA_TYPE) i*j + 2)/NJ;
for (i = 0; i < NI; i++)
for (j = 0; j < NJ; j++)
E[i][j] = ((DATA_TYPE) i*j + 2)/NJ;
for (i = 0; i < NJ; i++)
for (j = 0; j < NL; j++)
F[i][j] = ((DATA_TYPE) i*j + 2)/NJ;
for (i = 0; i < NI; i++)
for (j = 0; j < NL; j++)
G[i][j] = ((DATA_TYPE) i*j + 2)/NJ;
}
/* Define the live-out variables. Code is not executed unless
POLYBENCH_DUMP_ARRAYS is defined. */
inline
void print_array(int argc, char** argv)
{
int i, j;
#ifndef POLYBENCH_DUMP_ARRAYS
if (argc > 42 && ! strcmp(argv[0], ""))
#endif
{
for (i = 0; i < NI; i++) {
for (j = 0; j < NL; j++) {
fprintf(stderr, "%0.2lf ", G[i][j]);
if ((i * NI + j) % 80 == 20) fprintf(stderr, "\n");
}
fprintf(stderr, "\n");
}
}
}
#ifndef SCOP_PARAM
void scop_func() {
long ni = NI;
long nj = NJ;
long nk = NK;
long nl = NL;
long nm = NM;
#else
void scop_func(long ni, long nj, long nk, long nl, long nm) {
#endif
long i, j, k;
#pragma scop
#pragma live-out G
/* /\* E := A*B *\/ */
/* for (i = 0; i < ni; i++) */
/* for (j = 0; j < nj; j++) */
/* { */
/* E[i][j] = 0; */
/* for (k = 0; k < nk; ++k) */
/* E[i][j] += A[i][k] * B[k][j]; */
/* } */
/* /\* F := C*D *\/ */
/* for (i = 0; i < nj; i++) */
/* for (j = 0; j < nl; j++) */
/* { */
/* F[i][j] = 0; */
/* for (k = 0; k < nm; ++k) */
/* F[i][j] += C[i][k] * D[k][j]; */
/* } */
/* /\* G := E*F *\/ */
/* for (i = 0; i < ni; i++) */
/* for (j = 0; j < nl; j++) */
/* { */
/* G[i][j] = 0; */
/* for (k = 0; k < nj; ++k) */
/* G[i][j] += E[i][k] * F[k][j]; */
/* } */
/// FIXME: Remove some parameters, CLooG-ISL crashes...
/* E := A*B */
for (i = 0; i < ni; i++)
for (j = 0; j < ni; j++)
{
E[i][j] = 0;
for (k = 0; k < nk; ++k)
E[i][j] += A[i][k] * B[k][j];
}
/* F := C*D */
for (i = 0; i < ni; i++)
for (j = 0; j < ni; j++)
{
F[i][j] = 0;
for (k = 0; k < nk; ++k)
F[i][j] += C[i][k] * D[k][j];
}
/* G := E*F */
for (i = 0; i < ni; i++)
for (j = 0; j < ni; j++)
{
G[i][j] = 0;
for (k = 0; k < nk; ++k)
G[i][j] += E[i][k] * F[k][j];
}
#pragma endscop
}
int main(int argc, char** argv)
{
int i, j, k;
int ni = NI;
int nj = NJ;
int nk = NK;
int nl = NL;
int nm = NM;
/* Initialize array. */
init_array();
/* Start timer. */
polybench_start_instruments;
#ifndef SCOP_PARAM
scop_func();
#else
scop_func(ni, nj, nk, nl, nm);
#endif
/* Stop and print timer. */
polybench_stop_instruments;
polybench_print_instruments;
print_array(argc, argv);
return 0;
}

View File

@ -1,212 +0,0 @@
; RUN: opt %loadPolly %defaultOpts -polly-ast -analyze %s| FileCheck %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"
%struct._IO_FILE = type { i32, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, %struct._IO_marker*, %struct._IO_FILE*, i32, i32, i64, i16, i8, [1 x i8], i8*, i64, i8*, i8*, i8*, i8*, i64, i32, [20 x i8] }
%struct._IO_marker = type { %struct._IO_marker*, %struct._IO_FILE*, i32 }
@A = common global [512 x [512 x double]] zeroinitializer, align 32
@B = common global [512 x [512 x double]] zeroinitializer, align 32
@C = common global [512 x [512 x double]] zeroinitializer, align 32
@D = common global [512 x [512 x double]] zeroinitializer, align 32
@E = common global [512 x [512 x double]] zeroinitializer, align 32
@F = common global [512 x [512 x double]] zeroinitializer, align 32
@G = common global [512 x [512 x double]] zeroinitializer, align 32
@stderr = external global %struct._IO_FILE*
@.str = private constant [8 x i8] c"%0.2lf \00", align 1
define void @scop_func(i64 %ni, i64 %nj, i64 %nk, i64 %nl, i64 %nm) nounwind {
entry:
%0 = icmp sgt i64 %ni, 0
br i1 %0, label %bb.nph76.bb.nph76.split_crit_edge, label %return
bb.nph62: ; preds = %bb.nph76.bb.nph76.split_crit_edge, %bb6
%indvar33 = phi i64 [ 0, %bb.nph76.bb.nph76.split_crit_edge ], [ %indvar.next34, %bb6 ]
br i1 %7, label %bb.nph54.us.preheader, label %bb4.preheader
bb.nph54.us.preheader: ; preds = %bb.nph62
br label %bb.nph54.us
bb4.preheader: ; preds = %bb.nph62
br label %bb4
bb4.us: ; preds = %bb2.us
%.lcssa36 = phi double [ %5, %bb2.us ]
store double %.lcssa36, double* %scevgep105
%1 = add nsw i64 %storemerge758.us, 1
%exitcond40 = icmp eq i64 %1, %ni
br i1 %exitcond40, label %bb6.loopexit3, label %bb.nph54.us
bb2.us: ; preds = %bb.nph54.us, %bb2.us
%.tmp.056.us = phi double [ 0.000000e+00, %bb.nph54.us ], [ %5, %bb2.us ]
%storemerge853.us = phi i64 [ 0, %bb.nph54.us ], [ %6, %bb2.us ]
%scevgep102 = getelementptr [512 x [512 x double]]* @A, i64 0, i64 %indvar33, i64 %storemerge853.us
%scevgep101 = getelementptr [512 x [512 x double]]* @B, i64 0, i64 %storemerge853.us, i64 %storemerge758.us
%2 = load double* %scevgep102, align 8
%3 = load double* %scevgep101, align 8
%4 = fmul double %2, %3
%5 = fadd double %.tmp.056.us, %4
%6 = add nsw i64 %storemerge853.us, 1
%exitcond37 = icmp eq i64 %6, %nk
br i1 %exitcond37, label %bb4.us, label %bb2.us
bb.nph54.us: ; preds = %bb.nph54.us.preheader, %bb4.us
%storemerge758.us = phi i64 [ %1, %bb4.us ], [ 0, %bb.nph54.us.preheader ]
%scevgep105 = getelementptr [512 x [512 x double]]* @E, i64 0, i64 %indvar33, i64 %storemerge758.us
store double 0.000000e+00, double* %scevgep105, align 8
br label %bb2.us
bb4: ; preds = %bb4.preheader, %bb4
%indvar108 = phi i64 [ %indvar.next109, %bb4 ], [ 0, %bb4.preheader ]
%scevgep113 = getelementptr [512 x [512 x double]]* @E, i64 0, i64 %indvar33, i64 %indvar108
store double 0.000000e+00, double* %scevgep113, align 8
%indvar.next109 = add i64 %indvar108, 1
%exitcond32 = icmp eq i64 %indvar.next109, %ni
br i1 %exitcond32, label %bb6.loopexit, label %bb4
bb6.loopexit: ; preds = %bb4
br label %bb6
bb6.loopexit3: ; preds = %bb4.us
br label %bb6
bb6: ; preds = %bb6.loopexit3, %bb6.loopexit
%indvar.next34 = add i64 %indvar33, 1
%exitcond43 = icmp ne i64 %indvar.next34, %ni
br i1 %exitcond43, label %bb.nph62, label %bb16.preheader
bb.nph76.bb.nph76.split_crit_edge: ; preds = %entry
%7 = icmp sgt i64 %nk, 0
br label %bb.nph62
bb16.preheader: ; preds = %bb6
br i1 %0, label %bb.nph52.bb.nph52.split_crit_edge, label %return
bb.nph38: ; preds = %bb.nph52.bb.nph52.split_crit_edge, %bb15
%indvar18 = phi i64 [ 0, %bb.nph52.bb.nph52.split_crit_edge ], [ %indvar.next19, %bb15 ]
br i1 %14, label %bb.nph30.us.preheader, label %bb13.preheader
bb.nph30.us.preheader: ; preds = %bb.nph38
br label %bb.nph30.us
bb13.preheader: ; preds = %bb.nph38
br label %bb13
bb13.us: ; preds = %bb11.us
%.lcssa21 = phi double [ %12, %bb11.us ]
store double %.lcssa21, double* %scevgep90
%8 = add nsw i64 %storemerge534.us, 1
%exitcond25 = icmp eq i64 %8, %ni
br i1 %exitcond25, label %bb15.loopexit2, label %bb.nph30.us
bb11.us: ; preds = %bb.nph30.us, %bb11.us
%.tmp.032.us = phi double [ 0.000000e+00, %bb.nph30.us ], [ %12, %bb11.us ]
%storemerge629.us = phi i64 [ 0, %bb.nph30.us ], [ %13, %bb11.us ]
%scevgep87 = getelementptr [512 x [512 x double]]* @C, i64 0, i64 %indvar18, i64 %storemerge629.us
%scevgep86 = getelementptr [512 x [512 x double]]* @D, i64 0, i64 %storemerge629.us, i64 %storemerge534.us
%9 = load double* %scevgep87, align 8
%10 = load double* %scevgep86, align 8
%11 = fmul double %9, %10
%12 = fadd double %.tmp.032.us, %11
%13 = add nsw i64 %storemerge629.us, 1
%exitcond22 = icmp eq i64 %13, %nk
br i1 %exitcond22, label %bb13.us, label %bb11.us
bb.nph30.us: ; preds = %bb.nph30.us.preheader, %bb13.us
%storemerge534.us = phi i64 [ %8, %bb13.us ], [ 0, %bb.nph30.us.preheader ]
%scevgep90 = getelementptr [512 x [512 x double]]* @F, i64 0, i64 %indvar18, i64 %storemerge534.us
store double 0.000000e+00, double* %scevgep90, align 8
br label %bb11.us
bb13: ; preds = %bb13.preheader, %bb13
%indvar93 = phi i64 [ %indvar.next94, %bb13 ], [ 0, %bb13.preheader ]
%scevgep98 = getelementptr [512 x [512 x double]]* @F, i64 0, i64 %indvar18, i64 %indvar93
store double 0.000000e+00, double* %scevgep98, align 8
%indvar.next94 = add i64 %indvar93, 1
%exitcond17 = icmp eq i64 %indvar.next94, %ni
br i1 %exitcond17, label %bb15.loopexit, label %bb13
bb15.loopexit: ; preds = %bb13
br label %bb15
bb15.loopexit2: ; preds = %bb13.us
br label %bb15
bb15: ; preds = %bb15.loopexit2, %bb15.loopexit
%indvar.next19 = add i64 %indvar18, 1
%exitcond28 = icmp ne i64 %indvar.next19, %ni
br i1 %exitcond28, label %bb.nph38, label %bb25.preheader
bb.nph52.bb.nph52.split_crit_edge: ; preds = %bb16.preheader
%14 = icmp sgt i64 %nk, 0
br label %bb.nph38
bb25.preheader: ; preds = %bb15
br i1 %0, label %bb.nph28.bb.nph28.split_crit_edge, label %return
bb.nph14: ; preds = %bb.nph28.bb.nph28.split_crit_edge, %bb24
%indvar5 = phi i64 [ 0, %bb.nph28.bb.nph28.split_crit_edge ], [ %indvar.next6, %bb24 ]
br i1 %21, label %bb.nph.us.preheader, label %bb22.preheader
bb.nph.us.preheader: ; preds = %bb.nph14
br label %bb.nph.us
bb22.preheader: ; preds = %bb.nph14
br label %bb22
bb22.us: ; preds = %bb20.us
%.lcssa = phi double [ %19, %bb20.us ]
store double %.lcssa, double* %scevgep80
%15 = add nsw i64 %storemerge310.us, 1
%exitcond = icmp eq i64 %15, %ni
br i1 %exitcond, label %bb24.loopexit1, label %bb.nph.us
bb20.us: ; preds = %bb.nph.us, %bb20.us
%.tmp.0.us = phi double [ 0.000000e+00, %bb.nph.us ], [ %19, %bb20.us ]
%storemerge49.us = phi i64 [ 0, %bb.nph.us ], [ %20, %bb20.us ]
%scevgep77 = getelementptr [512 x [512 x double]]* @E, i64 0, i64 %indvar5, i64 %storemerge49.us
%scevgep = getelementptr [512 x [512 x double]]* @F, i64 0, i64 %storemerge49.us, i64 %storemerge310.us
%16 = load double* %scevgep77, align 8
%17 = load double* %scevgep, align 8
%18 = fmul double %16, %17
%19 = fadd double %.tmp.0.us, %18
%20 = add nsw i64 %storemerge49.us, 1
%exitcond8 = icmp eq i64 %20, %nk
br i1 %exitcond8, label %bb22.us, label %bb20.us
bb.nph.us: ; preds = %bb.nph.us.preheader, %bb22.us
%storemerge310.us = phi i64 [ %15, %bb22.us ], [ 0, %bb.nph.us.preheader ]
%scevgep80 = getelementptr [512 x [512 x double]]* @G, i64 0, i64 %indvar5, i64 %storemerge310.us
store double 0.000000e+00, double* %scevgep80, align 8
br label %bb20.us
bb22: ; preds = %bb22.preheader, %bb22
%indvar = phi i64 [ %indvar.next, %bb22 ], [ 0, %bb22.preheader ]
%scevgep83 = getelementptr [512 x [512 x double]]* @G, i64 0, i64 %indvar5, i64 %indvar
store double 0.000000e+00, double* %scevgep83, align 8
%indvar.next = add i64 %indvar, 1
%exitcond4 = icmp eq i64 %indvar.next, %ni
br i1 %exitcond4, label %bb24.loopexit, label %bb22
bb24.loopexit: ; preds = %bb22
br label %bb24
bb24.loopexit1: ; preds = %bb22.us
br label %bb24
bb24: ; preds = %bb24.loopexit1, %bb24.loopexit
%indvar.next6 = add i64 %indvar5, 1
%exitcond13 = icmp ne i64 %indvar.next6, %ni
br i1 %exitcond13, label %bb.nph14, label %return.loopexit
bb.nph28.bb.nph28.split_crit_edge: ; preds = %bb25.preheader
%21 = icmp sgt i64 %nk, 0
br label %bb.nph14
return.loopexit: ; preds = %bb24
br label %return
return: ; preds = %return.loopexit, %bb25.preheader, %bb16.preheader, %entry
ret void
}
; CHECK: for region: 'entry.split => return' in function 'scop_func':

View File

@ -1,136 +0,0 @@
; RUN: opt %loadPolly %defaultOpts -polly-detect -analyze %s | FileCheck %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"
%struct._IO_FILE = type { i32, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, %struct._IO_marker*, %struct._IO_FILE*, i32, i32, i64, i16, i8, [1 x i8], i8*, i64, i8*, i8*, i8*, i8*, i64, i32, [20 x i8] }
%struct._IO_marker = type { %struct._IO_marker*, %struct._IO_FILE*, i32 }
@A = common global [512 x [512 x double]] zeroinitializer, align 32
@B = common global [512 x [512 x double]] zeroinitializer, align 32
@C = common global [512 x [512 x double]] zeroinitializer, align 32
@D = common global [512 x [512 x double]] zeroinitializer, align 32
@E = common global [512 x [512 x double]] zeroinitializer, align 32
@F = common global [512 x [512 x double]] zeroinitializer, align 32
@G = common global [512 x [512 x double]] zeroinitializer, align 32
@stderr = external global %struct._IO_FILE*
@.str = private constant [8 x i8] c"%0.2lf \00", align 1
define void @scop_func() nounwind {
bb.nph76.bb.nph76.split_crit_edge:
br label %bb5.preheader
bb4.us: ; preds = %bb2.us
%.lcssa19 = phi double [ %4, %bb2.us ]
store double %.lcssa19, double* %scevgep94
%0 = add nsw i64 %storemerge758.us, 1
%exitcond23 = icmp eq i64 %0, 512
br i1 %exitcond23, label %bb6, label %bb.nph54.us
bb2.us: ; preds = %bb.nph54.us, %bb2.us
%.tmp.056.us = phi double [ 0.000000e+00, %bb.nph54.us ], [ %4, %bb2.us ]
%storemerge853.us = phi i64 [ 0, %bb.nph54.us ], [ %5, %bb2.us ]
%scevgep91 = getelementptr [512 x [512 x double]]* @A, i64 0, i64 %storemerge63, i64 %storemerge853.us
%scevgep90 = getelementptr [512 x [512 x double]]* @B, i64 0, i64 %storemerge853.us, i64 %storemerge758.us
%1 = load double* %scevgep91, align 8
%2 = load double* %scevgep90, align 8
%3 = fmul double %1, %2
%4 = fadd double %.tmp.056.us, %3
%5 = add nsw i64 %storemerge853.us, 1
%exitcond20 = icmp eq i64 %5, 512
br i1 %exitcond20, label %bb4.us, label %bb2.us
bb.nph54.us: ; preds = %bb5.preheader, %bb4.us
%storemerge758.us = phi i64 [ %0, %bb4.us ], [ 0, %bb5.preheader ]
%scevgep94 = getelementptr [512 x [512 x double]]* @E, i64 0, i64 %storemerge63, i64 %storemerge758.us
store double 0.000000e+00, double* %scevgep94, align 8
br label %bb2.us
bb6: ; preds = %bb4.us
%6 = add nsw i64 %storemerge63, 1
%exitcond26 = icmp ne i64 %6, 512
br i1 %exitcond26, label %bb5.preheader, label %bb14.preheader.preheader
bb14.preheader.preheader: ; preds = %bb6
br label %bb14.preheader
bb5.preheader: ; preds = %bb6, %bb.nph76.bb.nph76.split_crit_edge
%storemerge63 = phi i64 [ 0, %bb.nph76.bb.nph76.split_crit_edge ], [ %6, %bb6 ]
br label %bb.nph54.us
bb13.us: ; preds = %bb11.us
%.lcssa9 = phi double [ %11, %bb11.us ]
store double %.lcssa9, double* %scevgep87
%7 = add nsw i64 %storemerge534.us, 1
%exitcond13 = icmp eq i64 %7, 512
br i1 %exitcond13, label %bb15, label %bb.nph30.us
bb11.us: ; preds = %bb.nph30.us, %bb11.us
%.tmp.032.us = phi double [ 0.000000e+00, %bb.nph30.us ], [ %11, %bb11.us ]
%storemerge629.us = phi i64 [ 0, %bb.nph30.us ], [ %12, %bb11.us ]
%scevgep84 = getelementptr [512 x [512 x double]]* @C, i64 0, i64 %storemerge139, i64 %storemerge629.us
%scevgep83 = getelementptr [512 x [512 x double]]* @D, i64 0, i64 %storemerge629.us, i64 %storemerge534.us
%8 = load double* %scevgep84, align 8
%9 = load double* %scevgep83, align 8
%10 = fmul double %8, %9
%11 = fadd double %.tmp.032.us, %10
%12 = add nsw i64 %storemerge629.us, 1
%exitcond10 = icmp eq i64 %12, 512
br i1 %exitcond10, label %bb13.us, label %bb11.us
bb.nph30.us: ; preds = %bb14.preheader, %bb13.us
%storemerge534.us = phi i64 [ %7, %bb13.us ], [ 0, %bb14.preheader ]
%scevgep87 = getelementptr [512 x [512 x double]]* @F, i64 0, i64 %storemerge139, i64 %storemerge534.us
store double 0.000000e+00, double* %scevgep87, align 8
br label %bb11.us
bb15: ; preds = %bb13.us
%13 = add nsw i64 %storemerge139, 1
%exitcond16 = icmp ne i64 %13, 512
br i1 %exitcond16, label %bb14.preheader, label %bb23.preheader.preheader
bb23.preheader.preheader: ; preds = %bb15
br label %bb23.preheader
bb14.preheader: ; preds = %bb14.preheader.preheader, %bb15
%storemerge139 = phi i64 [ %13, %bb15 ], [ 0, %bb14.preheader.preheader ]
br label %bb.nph30.us
bb22.us: ; preds = %bb20.us
%.lcssa = phi double [ %18, %bb20.us ]
store double %.lcssa, double* %scevgep80
%14 = add nsw i64 %storemerge310.us, 1
%exitcond = icmp eq i64 %14, 512
br i1 %exitcond, label %bb24, label %bb.nph.us
bb20.us: ; preds = %bb.nph.us, %bb20.us
%.tmp.0.us = phi double [ 0.000000e+00, %bb.nph.us ], [ %18, %bb20.us ]
%storemerge49.us = phi i64 [ 0, %bb.nph.us ], [ %19, %bb20.us ]
%scevgep77 = getelementptr [512 x [512 x double]]* @E, i64 0, i64 %storemerge215, i64 %storemerge49.us
%scevgep = getelementptr [512 x [512 x double]]* @F, i64 0, i64 %storemerge49.us, i64 %storemerge310.us
%15 = load double* %scevgep77, align 8
%16 = load double* %scevgep, align 8
%17 = fmul double %15, %16
%18 = fadd double %.tmp.0.us, %17
%19 = add nsw i64 %storemerge49.us, 1
%exitcond1 = icmp eq i64 %19, 512
br i1 %exitcond1, label %bb22.us, label %bb20.us
bb.nph.us: ; preds = %bb23.preheader, %bb22.us
%storemerge310.us = phi i64 [ %14, %bb22.us ], [ 0, %bb23.preheader ]
%scevgep80 = getelementptr [512 x [512 x double]]* @G, i64 0, i64 %storemerge215, i64 %storemerge310.us
store double 0.000000e+00, double* %scevgep80, align 8
br label %bb20.us
bb24: ; preds = %bb22.us
%20 = add nsw i64 %storemerge215, 1
%exitcond6 = icmp ne i64 %20, 512
br i1 %exitcond6, label %bb23.preheader, label %return
bb23.preheader: ; preds = %bb23.preheader.preheader, %bb24
%storemerge215 = phi i64 [ %20, %bb24 ], [ 0, %bb23.preheader.preheader ]
br label %bb.nph.us
return: ; preds = %bb24
ret void
}
; CHECK: Valid Region for Scop: bb5.preheader => return

View File

@ -1 +0,0 @@
-DNI=1024 -DNJ=1024 -DNK=1024 -DNL=1024 -DNM=1024

View File

@ -1,119 +0,0 @@
#include <stdio.h>
#include <unistd.h>
#include <string.h>
#include <math.h>
#include "instrument.h"
/* Default problem size. */
#ifndef NX
# define NX 8000
#endif
#ifndef NY
# define NY 8000
#endif
/* Default data type is double. */
#ifndef DATA_TYPE
# define DATA_TYPE double
#endif
/* Array declaration. Enable malloc if POLYBENCH_TEST_MALLOC. */
#ifndef POLYBENCH_TEST_MALLOC
DATA_TYPE A[NX][NY];
DATA_TYPE x[NY];
DATA_TYPE y[NY];
DATA_TYPE tmp[NX];
#else
DATA_TYPE** A = (DATA_TYPE**)malloc(NX * sizeof(DATA_TYPE*));
DATA_TYPE* x = (DATA_TYPE*)malloc(NY * sizeof(DATA_TYPE));
DATA_TYPE* y = (DATA_TYPE*)malloc(NY * sizeof(DATA_TYPE));
DATA_TYPE* tmp = (DATA_TYPE*)malloc(NX * sizeof(DATA_TYPE));
{
int i;
for (i = 0; i < NX; ++i)
A[i] = (DATA_TYPE*)malloc(NY * sizeof(DATA_TYPE));
}
#endif
inline
void init_array()
{
int i, j;
for (i = 0; i < NX; i++)
{
x[i] = i * M_PI;
for (j = 0; j < NY; j++)
A[i][j] = ((DATA_TYPE) i*j) / NX;
}
}
/* Define the live-out variables. Code is not executed unless
POLYBENCH_DUMP_ARRAYS is defined. */
inline
void print_array(int argc, char** argv)
{
int i, j;
#ifndef POLYBENCH_DUMP_ARRAYS
if (argc > 42 && ! strcmp(argv[0], ""))
#endif
{
for (i = 0; i < NX; i++) {
fprintf(stderr, "%0.2lf ", y[i]);
if (i%80 == 20) fprintf(stderr, "\n");
}
fprintf(stderr, "\n");
}
}
#ifndef SCOP_PARAM
void scop_func() {
long nx = NX;
long ny = NY;
#else
void scop_func(long nx, long ny) {
#endif
long i, j;
#pragma scop
#pragma live-out y
for (i= 0; i < nx; i++)
y[i] = 0;
for (i = 0; i < ny; i++)
{
tmp[i] = 0;
for (j = 0; j < ny; j++)
tmp[i] = tmp[i] + A[i][j] * x[j];
for (j = 0; j < ny; j++)
y[j] = y[j] + A[i][j] * tmp[i];
}
#pragma endscop
}
int main(int argc, char** argv)
{
int i, j;
int nx = NX;
int ny = NY;
/* Initialize array. */
init_array();
/* Start timer. */
polybench_start_instruments;
#ifndef SCOP_PARAM
scop_func();
#else
scop_func(nx, ny);
#endif
/* Stop and print timer. */
polybench_stop_instruments;
polybench_print_instruments;
print_array(argc, argv);
return 0;
}

View File

@ -1,90 +0,0 @@
; RUN: opt %loadPolly %defaultOpts -polly-ast -analyze %s | FileCheck %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"
%struct._IO_FILE = type { i32, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, %struct._IO_marker*, %struct._IO_FILE*, i32, i32, i64, i16, i8, [1 x i8], i8*, i64, i8*, i8*, i8*, i8*, i64, i32, [20 x i8] }
%struct._IO_marker = type { %struct._IO_marker*, %struct._IO_FILE*, i32 }
@x = common global [8000 x double] zeroinitializer, align 32
@A = common global [8000 x [8000 x double]] zeroinitializer, align 32
@y = common global [8000 x double] zeroinitializer, align 32
@stderr = external global %struct._IO_FILE*
@.str = private constant [8 x i8] c"%0.2lf \00", align 1
@tmp = common global [8000 x double] zeroinitializer, align 32
define void @scop_func(i64 %nx, i64 %ny) nounwind {
entry:
%0 = icmp sgt i64 %nx, 0
br i1 %0, label %bb.preheader, label %bb10.preheader
bb.preheader: ; preds = %entry
br label %bb
bb: ; preds = %bb.preheader, %bb
%storemerge15 = phi i64 [ %1, %bb ], [ 0, %bb.preheader ]
%scevgep26 = getelementptr [8000 x double]* @y, i64 0, i64 %storemerge15
store double 0.000000e+00, double* %scevgep26, align 8
%1 = add nsw i64 %storemerge15, 1
%exitcond10 = icmp eq i64 %1, %nx
br i1 %exitcond10, label %bb10.preheader.loopexit, label %bb
bb10.preheader.loopexit: ; preds = %bb
br label %bb10.preheader
bb10.preheader: ; preds = %bb10.preheader.loopexit, %entry
%2 = icmp sgt i64 %ny, 0
br i1 %2, label %bb.nph.preheader, label %return
bb.nph.preheader: ; preds = %bb10.preheader
br label %bb.nph
bb.nph: ; preds = %bb.nph.preheader, %bb9
%storemerge17 = phi i64 [ %13, %bb9 ], [ 0, %bb.nph.preheader ]
%scevgep24 = getelementptr [8000 x double]* @tmp, i64 0, i64 %storemerge17
store double 0.000000e+00, double* %scevgep24, align 8
br label %bb4
bb4: ; preds = %bb4, %bb.nph
%.tmp.0 = phi double [ 0.000000e+00, %bb.nph ], [ %6, %bb4 ]
%storemerge24 = phi i64 [ 0, %bb.nph ], [ %7, %bb4 ]
%scevgep17 = getelementptr [8000 x [8000 x double]]* @A, i64 0, i64 %storemerge17, i64 %storemerge24
%scevgep = getelementptr [8000 x double]* @x, i64 0, i64 %storemerge24
%3 = load double* %scevgep17, align 8
%4 = load double* %scevgep, align 8
%5 = fmul double %3, %4
%6 = fadd double %.tmp.0, %5
%7 = add nsw i64 %storemerge24, 1
%exitcond1 = icmp eq i64 %7, %ny
br i1 %exitcond1, label %bb8.loopexit, label %bb4
bb7: ; preds = %bb8.loopexit, %bb7
%storemerge35 = phi i64 [ %12, %bb7 ], [ 0, %bb8.loopexit ]
%scevgep19 = getelementptr [8000 x [8000 x double]]* @A, i64 0, i64 %storemerge17, i64 %storemerge35
%scevgep20 = getelementptr [8000 x double]* @y, i64 0, i64 %storemerge35
%8 = load double* %scevgep20, align 8
%9 = load double* %scevgep19, align 8
%10 = fmul double %9, %.lcssa
%11 = fadd double %8, %10
store double %11, double* %scevgep20, align 8
%12 = add nsw i64 %storemerge35, 1
%exitcond = icmp eq i64 %12, %ny
br i1 %exitcond, label %bb9, label %bb7
bb8.loopexit: ; preds = %bb4
%.lcssa = phi double [ %6, %bb4 ]
store double %.lcssa, double* %scevgep24
br label %bb7
bb9: ; preds = %bb7
%13 = add nsw i64 %storemerge17, 1
%exitcond6 = icmp eq i64 %13, %ny
br i1 %exitcond6, label %return.loopexit, label %bb.nph
return.loopexit: ; preds = %bb9
br label %return
return: ; preds = %return.loopexit, %bb10.preheader
ret void
}
; CHECK: for region: 'entry.split => return' in function 'scop_func':
; CHECK-NEXT: scop_func():

View File

@ -1,76 +0,0 @@
; RUN: opt %loadPolly %defaultOpts -polly-ast -analyze %s | FileCheck %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"
%struct._IO_FILE = type { i32, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, %struct._IO_marker*, %struct._IO_FILE*, i32, i32, i64, i16, i8, [1 x i8], i8*, i64, i8*, i8*, i8*, i8*, i64, i32, [20 x i8] }
%struct._IO_marker = type { %struct._IO_marker*, %struct._IO_FILE*, i32 }
@x = common global [8000 x double] zeroinitializer, align 32
@A = common global [8000 x [8000 x double]] zeroinitializer, align 32
@y = common global [8000 x double] zeroinitializer, align 32
@stderr = external global %struct._IO_FILE*
@.str = private constant [8 x i8] c"%0.2lf \00", align 1
@tmp = common global [8000 x double] zeroinitializer, align 32
define void @scop_func() nounwind {
bb.nph16:
br label %bb
bb: ; preds = %bb, %bb.nph16
%storemerge15 = phi i64 [ 0, %bb.nph16 ], [ %0, %bb ]
%scevgep26 = getelementptr [8000 x double]* @y, i64 0, i64 %storemerge15
store double 0.000000e+00, double* %scevgep26, align 8
%0 = add nsw i64 %storemerge15, 1
%exitcond10 = icmp eq i64 %0, 8000
br i1 %exitcond10, label %bb.nph.preheader, label %bb
bb.nph.preheader: ; preds = %bb
br label %bb.nph
bb.nph: ; preds = %bb.nph.preheader, %bb9
%storemerge17 = phi i64 [ %11, %bb9 ], [ 0, %bb.nph.preheader ]
%scevgep24 = getelementptr [8000 x double]* @tmp, i64 0, i64 %storemerge17
store double 0.000000e+00, double* %scevgep24, align 8
br label %bb4
bb4: ; preds = %bb4, %bb.nph
%.tmp.0 = phi double [ 0.000000e+00, %bb.nph ], [ %4, %bb4 ]
%storemerge24 = phi i64 [ 0, %bb.nph ], [ %5, %bb4 ]
%scevgep17 = getelementptr [8000 x [8000 x double]]* @A, i64 0, i64 %storemerge17, i64 %storemerge24
%scevgep = getelementptr [8000 x double]* @x, i64 0, i64 %storemerge24
%1 = load double* %scevgep17, align 8
%2 = load double* %scevgep, align 8
%3 = fmul double %1, %2
%4 = fadd double %.tmp.0, %3
%5 = add nsw i64 %storemerge24, 1
%exitcond1 = icmp eq i64 %5, 8000
br i1 %exitcond1, label %bb8.loopexit, label %bb4
bb7: ; preds = %bb8.loopexit, %bb7
%storemerge35 = phi i64 [ %10, %bb7 ], [ 0, %bb8.loopexit ]
%scevgep19 = getelementptr [8000 x [8000 x double]]* @A, i64 0, i64 %storemerge17, i64 %storemerge35
%scevgep20 = getelementptr [8000 x double]* @y, i64 0, i64 %storemerge35
%6 = load double* %scevgep20, align 8
%7 = load double* %scevgep19, align 8
%8 = fmul double %7, %.lcssa
%9 = fadd double %6, %8
store double %9, double* %scevgep20, align 8
%10 = add nsw i64 %storemerge35, 1
%exitcond = icmp eq i64 %10, 8000
br i1 %exitcond, label %bb9, label %bb7
bb8.loopexit: ; preds = %bb4
%.lcssa = phi double [ %4, %bb4 ]
store double %.lcssa, double* %scevgep24
br label %bb7
bb9: ; preds = %bb7
%11 = add nsw i64 %storemerge17, 1
%exitcond6 = icmp eq i64 %11, 8000
br i1 %exitcond6, label %return, label %bb.nph
return: ; preds = %bb9
ret void
}
; CHECK: for region: 'bb => return' in function 'scop_func':
; CHECK-NEXT: scop_func():

View File

@ -1,126 +0,0 @@
#include <stdio.h>
#include <unistd.h>
#include <string.h>
#include <math.h>
#include "instrument.h"
/* Default problem size. */
#ifndef NX
# define NX 8000
#endif
#ifndef NY
# define NY 8000
#endif
/* Default data type is double. */
#ifndef DATA_TYPE
# define DATA_TYPE double
#endif
/* Array declaration. Enable malloc if POLYBENCH_TEST_MALLOC. */
#ifndef POLYBENCH_TEST_MALLOC
DATA_TYPE A[NX][NY];
DATA_TYPE r[NX];
DATA_TYPE s[NX];
DATA_TYPE p[NX];
DATA_TYPE q[NX];
#else
DATA_TYPE** A = (DATA_TYPE**)malloc(NX * sizeof(DATA_TYPE*));
DATA_TYPE* r = (DATA_TYPE*)malloc(NX * sizeof(DATA_TYPE));
DATA_TYPE* s = (DATA_TYPE*)malloc(NX * sizeof(DATA_TYPE));
DATA_TYPE* p = (DATA_TYPE*)malloc(NX * sizeof(DATA_TYPE));
DATA_TYPE* q = (DATA_TYPE*)malloc(NX * sizeof(DATA_TYPE));
{
int i;
for (i = 0; i < NX; ++i)
A[i] = (DATA_TYPE*)malloc(NY * sizeof(DATA_TYPE));
}
#endif
inline
void init_array()
{
int i, j;
for (i = 0; i < NX; i++) {
r[i] = i * M_PI;
p[i] = i * M_PI;
for (j = 0; j < NY; j++) {
A[i][j] = ((DATA_TYPE) i*j)/NX;
}
}
}
/* Define the live-out variables. Code is not executed unless
POLYBENCH_DUMP_ARRAYS is defined. */
inline
void print_array(int argc, char** argv)
{
int i, j;
#ifndef POLYBENCH_DUMP_ARRAYS
if (argc > 42 && ! strcmp(argv[0], ""))
#endif
{
for (i = 0; i < NX; i++) {
fprintf(stderr, "%0.2lf ", s[i]);
fprintf(stderr, "%0.2lf ", q[i]);
if (i%80 == 20) fprintf(stderr, "\n");
}
fprintf(stderr, "\n");
}
}
#ifndef SCOP_PARAM
void scop_func() {
long nx = NX;
long ny = NY;
#else
void scop_func(long nx, long ny) {
#endif
long i, j;
#pragma scop
#pragma live-out s, q
for (i = 0; i < ny; i++)
s[i] = 0;
for (i = 0; i < nx; i++)
{
q[i] = 0;
for (j = 0; j < ny; j++)
{
s[j] = s[j] + r[i] * A[i][j];
q[i] = q[i] + A[i][j] * p[j];
}
}
#pragma endscop
}
int main(int argc, char** argv)
{
int i, j;
int nx = NX;
int ny = NY;
/* Initialize array. */
init_array();
/* Start timer. */
polybench_start_instruments;
#ifndef SCOP_PARAM
scop_func();
#else
scop_func(nx, ny);
#endif
/* Stop and print timer. */
polybench_stop_instruments;
polybench_print_instruments;
print_array(argc, argv);
return 0;
}

View File

@ -1,100 +0,0 @@
; RUN: opt %loadPolly %defaultOpts -polly-ast -analyze %s | FileCheck %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"
%struct._IO_FILE = type { i32, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, %struct._IO_marker*, %struct._IO_FILE*, i32, i32, i64, i16, i8, [1 x i8], i8*, i64, i8*, i8*, i8*, i8*, i64, i32, [20 x i8] }
%struct._IO_marker = type { %struct._IO_marker*, %struct._IO_FILE*, i32 }
@r = common global [8000 x double] zeroinitializer, align 32
@p = common global [8000 x double] zeroinitializer, align 32
@A = common global [8000 x [8000 x double]] zeroinitializer, align 32
@s = common global [8000 x double] zeroinitializer, align 32
@stderr = external global %struct._IO_FILE*
@.str = private constant [8 x i8] c"%0.2lf \00", align 1
@q = common global [8000 x double] zeroinitializer, align 32
define void @scop_func(i64 %nx, i64 %ny) nounwind {
entry:
%0 = icmp sgt i64 %ny, 0
br i1 %0, label %bb.preheader, label %bb7.preheader
bb.preheader: ; preds = %entry
br label %bb
bb: ; preds = %bb.preheader, %bb
%storemerge9 = phi i64 [ %1, %bb ], [ 0, %bb.preheader ]
%scevgep20 = getelementptr [8000 x double]* @s, i64 0, i64 %storemerge9
store double 0.000000e+00, double* %scevgep20, align 8
%1 = add nsw i64 %storemerge9, 1
%exitcond11 = icmp eq i64 %1, %ny
br i1 %exitcond11, label %bb7.preheader.loopexit, label %bb
bb7.preheader.loopexit: ; preds = %bb
br label %bb7.preheader
bb7.preheader: ; preds = %bb7.preheader.loopexit, %entry
%2 = icmp sgt i64 %nx, 0
br i1 %2, label %bb.nph8, label %return
bb.nph8: ; preds = %bb7.preheader
br i1 %0, label %bb.nph.us.preheader, label %bb6.preheader
bb.nph.us.preheader: ; preds = %bb.nph8
br label %bb.nph.us
bb6.preheader: ; preds = %bb.nph8
br label %bb6
bb6.us: ; preds = %bb4.us
%.lcssa = phi double [ %10, %bb4.us ]
store double %.lcssa, double* %scevgep15
%3 = add nsw i64 %storemerge14.us, 1
%exitcond = icmp eq i64 %3, %nx
br i1 %exitcond, label %return.loopexit1, label %bb.nph.us
bb4.us: ; preds = %bb.nph.us, %bb4.us
%.tmp.0.us = phi double [ 0.000000e+00, %bb.nph.us ], [ %10, %bb4.us ]
%storemerge23.us = phi i64 [ 0, %bb.nph.us ], [ %11, %bb4.us ]
%scevgep11 = getelementptr [8000 x [8000 x double]]* @A, i64 0, i64 %storemerge14.us, i64 %storemerge23.us
%scevgep12 = getelementptr [8000 x double]* @s, i64 0, i64 %storemerge23.us
%scevgep = getelementptr [8000 x double]* @p, i64 0, i64 %storemerge23.us
%4 = load double* %scevgep12, align 8
%5 = load double* %scevgep11, align 8
%6 = fmul double %12, %5
%7 = fadd double %4, %6
store double %7, double* %scevgep12, align 8
%8 = load double* %scevgep, align 8
%9 = fmul double %5, %8
%10 = fadd double %.tmp.0.us, %9
%11 = add nsw i64 %storemerge23.us, 1
%exitcond4 = icmp eq i64 %11, %ny
br i1 %exitcond4, label %bb6.us, label %bb4.us
bb.nph.us: ; preds = %bb.nph.us.preheader, %bb6.us
%storemerge14.us = phi i64 [ %3, %bb6.us ], [ 0, %bb.nph.us.preheader ]
%scevgep16 = getelementptr [8000 x double]* @r, i64 0, i64 %storemerge14.us
%scevgep15 = getelementptr [8000 x double]* @q, i64 0, i64 %storemerge14.us
store double 0.000000e+00, double* %scevgep15, align 8
%12 = load double* %scevgep16, align 8
br label %bb4.us
bb6: ; preds = %bb6.preheader, %bb6
%indvar = phi i64 [ %indvar.next, %bb6 ], [ 0, %bb6.preheader ]
%scevgep18 = getelementptr [8000 x double]* @q, i64 0, i64 %indvar
store double 0.000000e+00, double* %scevgep18, align 8
%indvar.next = add i64 %indvar, 1
%exitcond2 = icmp eq i64 %indvar.next, %nx
br i1 %exitcond2, label %return.loopexit, label %bb6
return.loopexit: ; preds = %bb6
br label %return
return.loopexit1: ; preds = %bb6.us
br label %return
return: ; preds = %return.loopexit1, %return.loopexit, %bb7.preheader
ret void
}
; CHECK: for region: 'entry.split => return' in function 'scop_func':
; CHECK-NEXT: scop_func():

View File

@ -1,68 +0,0 @@
; RUN: opt %loadPolly %defaultOpts -polly-ast -analyze %s | FileCheck %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"
%struct._IO_FILE = type { i32, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, %struct._IO_marker*, %struct._IO_FILE*, i32, i32, i64, i16, i8, [1 x i8], i8*, i64, i8*, i8*, i8*, i8*, i64, i32, [20 x i8] }
%struct._IO_marker = type { %struct._IO_marker*, %struct._IO_FILE*, i32 }
@r = common global [8000 x double] zeroinitializer, align 32
@p = common global [8000 x double] zeroinitializer, align 32
@A = common global [8000 x [8000 x double]] zeroinitializer, align 32
@s = common global [8000 x double] zeroinitializer, align 32
@stderr = external global %struct._IO_FILE*
@.str = private constant [8 x i8] c"%0.2lf \00", align 1
@q = common global [8000 x double] zeroinitializer, align 32
define void @scop_func() nounwind {
bb.nph10:
br label %bb
bb: ; preds = %bb, %bb.nph10
%storemerge9 = phi i64 [ 0, %bb.nph10 ], [ %0, %bb ]
%scevgep18 = getelementptr [8000 x double]* @s, i64 0, i64 %storemerge9
store double 0.000000e+00, double* %scevgep18, align 8
%0 = add nsw i64 %storemerge9, 1
%exitcond8 = icmp eq i64 %0, 8000
br i1 %exitcond8, label %bb.nph.us.preheader, label %bb
bb.nph.us.preheader: ; preds = %bb
br label %bb.nph.us
bb6.us: ; preds = %bb4.us
%.lcssa = phi double [ %8, %bb4.us ]
store double %.lcssa, double* %scevgep15
%1 = add nsw i64 %storemerge14.us, 1
%exitcond = icmp eq i64 %1, 8000
br i1 %exitcond, label %return, label %bb.nph.us
bb4.us: ; preds = %bb.nph.us, %bb4.us
%.tmp.0.us = phi double [ 0.000000e+00, %bb.nph.us ], [ %8, %bb4.us ]
%storemerge23.us = phi i64 [ 0, %bb.nph.us ], [ %9, %bb4.us ]
%scevgep11 = getelementptr [8000 x [8000 x double]]* @A, i64 0, i64 %storemerge14.us, i64 %storemerge23.us
%scevgep12 = getelementptr [8000 x double]* @s, i64 0, i64 %storemerge23.us
%scevgep = getelementptr [8000 x double]* @p, i64 0, i64 %storemerge23.us
%2 = load double* %scevgep12, align 8
%3 = load double* %scevgep11, align 8
%4 = fmul double %10, %3
%5 = fadd double %2, %4
store double %5, double* %scevgep12, align 8
%6 = load double* %scevgep, align 8
%7 = fmul double %3, %6
%8 = fadd double %.tmp.0.us, %7
%9 = add nsw i64 %storemerge23.us, 1
%exitcond1 = icmp eq i64 %9, 8000
br i1 %exitcond1, label %bb6.us, label %bb4.us
bb.nph.us: ; preds = %bb.nph.us.preheader, %bb6.us
%storemerge14.us = phi i64 [ %1, %bb6.us ], [ 0, %bb.nph.us.preheader ]
%scevgep16 = getelementptr [8000 x double]* @r, i64 0, i64 %storemerge14.us
%scevgep15 = getelementptr [8000 x double]* @q, i64 0, i64 %storemerge14.us
store double 0.000000e+00, double* %scevgep15, align 8
%10 = load double* %scevgep16, align 8
br label %bb4.us
return: ; preds = %bb6.us
ret void
}
; CHECK: for region: 'bb => return' in function 'scop_func':
; CHECK-NEXT: scop_func():

View File

@ -1,141 +0,0 @@
#include <stdio.h>
#include <unistd.h>
#include <string.h>
#include <math.h>
#include "instrument.h"
/* Default problem size. */
#ifndef NR
# define NR 128
#endif
#ifndef NQ
# define NQ 128
#endif
#ifndef NP
# define NP 128
#endif
/* Default data type is double. */
#ifndef DATA_TYPE
# define DATA_TYPE double
#endif
/* Array declaration. Enable malloc if POLYBENCH_TEST_MALLOC. */
#ifndef POLYBENCH_TEST_MALLOC
DATA_TYPE A[NR][NQ][NP];
DATA_TYPE sum[NR][NQ][NP];
DATA_TYPE C4[NP][NP];
#else
DATA_TYPE*** A = (DATA_TYPE***)malloc(NR * sizeof(DATA_TYPE**));
DATA_TYPE*** sum = (DATA_TYPE***)malloc(NR * sizeof(DATA_TYPE**));
DATA_TYPE** C4 = (DATA_TYPE**)malloc(NP * sizeof(DATA_TYPE*));
{
int i, j;
for (i = 0; i < NR; ++i)
{
A[i] = (DATA_TYPE**)malloc(NQ * sizeof(DATA_TYPE*));
sum[i] = (DATA_TYPE**)malloc(NQ * sizeof(DATA_TYPE*));
for (i = 0; i < NP; ++i)
{
A[i][j] = (DATA_TYPE*)malloc(NP * sizeof(DATA_TYPE));
sum[i][j] = (DATA_TYPE*)malloc(NP * sizeof(DATA_TYPE));
}
}
for (i = 0; i < NP; ++i)
C4[i] = (DATA_TYPE*)malloc(NP * sizeof(DATA_TYPE));
}
#endif
inline
void init_array()
{
int i, j, k;
for (i = 0; i < NR; i++)
for (j = 0; j < NQ; j++)
for (k = 0; k < NP; k++)
A[i][j][k] = ((DATA_TYPE) i*j + k) / NP;
for (i = 0; i < NP; i++)
for (j = 0; j < NP; j++)
C4[i][j] = ((DATA_TYPE) i*j) / NP;
}
/* Define the live-out variables. Code is not executed unless
POLYBENCH_DUMP_ARRAYS is defined. */
inline
void print_array(int argc, char** argv)
{
int i, j, k;
#ifndef POLYBENCH_DUMP_ARRAYS
if (argc > 42 && ! strcmp(argv[0], ""))
#endif
{
for (i = 0; i < NR; i++)
for (j = 0; j < NQ; j++)
for (k = 0; k < NP; k++) {
fprintf(stderr, "%0.2lf ", A[i][j][k]);
if ((i * NR + j * NQ + k)% 80 == 20) fprintf(stderr, "\n");
}
fprintf(stderr, "\n");
}
}
#ifndef SCOP_PARAM
void scop_func() {
long nr = NR;
long nq = NQ;
long np = NP;
#else
void scop_func(long nr, long nq, long np) {
#endif
long r, q, p, s;
#pragma scop
#pragma live-out A
for (r = 0; r < nr; r++)
for (q = 0; q < nq; q++) {
for (p = 0; p < np; p++) {
sum[r][q][p] = 0;
for (s = 0; s < np; s++)
sum[r][q][p] = sum[r][q][p] + A[r][q][s] * C4[s][p];
}
for (p = 0; p < np; p++)
A[r][q][p] = sum[r][q][p];
}
#pragma endscop
}
int main(int argc, char** argv)
{
int r, q, p, s;
int nr = NR;
int nq = NQ;
int np = NP;
/* Initialize array. */
init_array();
/* Start timer. */
polybench_start_instruments;
#ifndef SCOP_PARAM
scop_func();
#else
scop_func(nr, nq, np);
#endif
/* Stop and print timer. */
polybench_stop_instruments;
polybench_print_instruments;
print_array(argc, argv);
return 0;
}

View File

@ -1,103 +0,0 @@
; RUN: opt %loadPolly -correlated-propagation %defaultOpts -polly-ast -analyze %s | FileCheck %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"
%struct._IO_FILE = type { i32, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, %struct._IO_marker*, %struct._IO_FILE*, i32, i32, i64, i16, i8, [1 x i8], i8*, i64, i8*, i8*, i8*, i8*, i64, i32, [20 x i8] }
%struct._IO_marker = type { %struct._IO_marker*, %struct._IO_FILE*, i32 }
@A = common global [128 x [128 x [128 x double]]] zeroinitializer, align 32
@C4 = common global [128 x [128 x double]] zeroinitializer, align 32
@stderr = external global %struct._IO_FILE*
@.str = private constant [8 x i8] c"%0.2lf \00", align 1
@sum = common global [128 x [128 x [128 x double]]] zeroinitializer, align 32
define void @scop_func(i64 %nr, i64 %nq, i64 %np) nounwind {
entry:
%0 = icmp sgt i64 %nr, 0
br i1 %0, label %bb.nph50, label %return
bb5.us: ; preds = %bb3.us
%.lcssa = phi double [ %5, %bb3.us ]
store double %.lcssa, double* %scevgep54
%1 = add nsw i64 %storemerge26.us, 1
%exitcond = icmp eq i64 %1, %np
br i1 %exitcond, label %bb9.loopexit, label %bb.nph.us
bb3.us: ; preds = %bb.nph.us, %bb3.us
%.tmp.0.us = phi double [ 0.000000e+00, %bb.nph.us ], [ %5, %bb3.us ]
%storemerge45.us = phi i64 [ 0, %bb.nph.us ], [ %6, %bb3.us ]
%scevgep = getelementptr [128 x [128 x double]]* @C4, i64 0, i64 %storemerge45.us, i64 %storemerge26.us
%scevgep51 = getelementptr [128 x [128 x [128 x double]]]* @A, i64 0, i64 %storemerge43, i64 %storemerge113, i64 %storemerge45.us
%2 = load double* %scevgep51, align 8
%3 = load double* %scevgep, align 8
%4 = fmul double %2, %3
%5 = fadd double %.tmp.0.us, %4
%6 = add nsw i64 %storemerge45.us, 1
%exitcond1 = icmp eq i64 %6, %np
br i1 %exitcond1, label %bb5.us, label %bb3.us
bb.nph.us: ; preds = %bb.nph.us.preheader, %bb5.us
%storemerge26.us = phi i64 [ %1, %bb5.us ], [ 0, %bb.nph.us.preheader ]
%scevgep54 = getelementptr [128 x [128 x [128 x double]]]* @sum, i64 0, i64 %storemerge43, i64 %storemerge113, i64 %storemerge26.us
store double 0.000000e+00, double* %scevgep54, align 8
br label %bb3.us
bb8: ; preds = %bb8.preheader, %bb8
%storemerge311 = phi i64 [ %8, %bb8 ], [ 0, %bb8.preheader ]
%scevgep62 = getelementptr [128 x [128 x [128 x double]]]* @sum, i64 0, i64 %storemerge43, i64 %storemerge113, i64 %storemerge311
%scevgep61 = getelementptr [128 x [128 x [128 x double]]]* @A, i64 0, i64 %storemerge43, i64 %storemerge113, i64 %storemerge311
%7 = load double* %scevgep62, align 8
store double %7, double* %scevgep61, align 8
%8 = add nsw i64 %storemerge311, 1
%exitcond6 = icmp eq i64 %8, %np
br i1 %exitcond6, label %bb10.loopexit, label %bb8
bb9.loopexit: ; preds = %bb5.us
br i1 %14, label %bb8.preheader, label %bb10
bb8.preheader: ; preds = %bb9.loopexit
br label %bb8
bb10.loopexit: ; preds = %bb8
br label %bb10
bb10: ; preds = %bb10.loopexit, %bb6.preheader, %bb9.loopexit
%storemerge12566 = phi i64 [ %storemerge113, %bb9.loopexit ], [ %storemerge113, %bb6.preheader ], [ %storemerge113, %bb10.loopexit ]
%storemerge4464 = phi i64 [ %storemerge43, %bb9.loopexit ], [ %storemerge43, %bb6.preheader ], [ %storemerge43, %bb10.loopexit ]
%9 = add nsw i64 %storemerge12566, 1
%10 = icmp slt i64 %9, %nq
br i1 %10, label %bb6.preheader.backedge, label %bb12
bb6.preheader.backedge: ; preds = %bb10, %bb12
%storemerge43.be = phi i64 [ %storemerge4464, %bb10 ], [ %11, %bb12 ]
%storemerge113.be = phi i64 [ %9, %bb10 ], [ 0, %bb12 ]
br label %bb6.preheader
bb6.preheader: ; preds = %bb6.preheader.backedge, %bb6.preheader.preheader
%storemerge43 = phi i64 [ 0, %bb6.preheader.preheader ], [ %storemerge43.be, %bb6.preheader.backedge ]
%storemerge113 = phi i64 [ 0, %bb6.preheader.preheader ], [ %storemerge113.be, %bb6.preheader.backedge ]
br i1 %14, label %bb.nph.us.preheader, label %bb10
bb.nph.us.preheader: ; preds = %bb6.preheader
br label %bb.nph.us
bb12: ; preds = %bb10
%11 = add nsw i64 %storemerge4464, 1
%12 = icmp slt i64 %11, %nr
br i1 %12, label %bb6.preheader.backedge, label %return.loopexit
bb.nph50: ; preds = %entry
%13 = icmp sgt i64 %nq, 0
%14 = icmp sgt i64 %np, 0
br i1 %13, label %bb6.preheader.preheader, label %return
bb6.preheader.preheader: ; preds = %bb.nph50
br label %bb6.preheader
return.loopexit: ; preds = %bb12
br label %return
return: ; preds = %return.loopexit, %bb.nph50, %entry
ret void
}
; CHECK: for region: 'entry.split => return' in function 'scop_func':

View File

@ -1,78 +0,0 @@
; RUN: opt %loadPolly %defaultOpts -polly-detect -analyze %s | FileCheck %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"
%struct._IO_FILE = type { i32, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, %struct._IO_marker*, %struct._IO_FILE*, i32, i32, i64, i16, i8, [1 x i8], i8*, i64, i8*, i8*, i8*, i8*, i64, i32, [20 x i8] }
%struct._IO_marker = type { %struct._IO_marker*, %struct._IO_FILE*, i32 }
@A = common global [128 x [128 x [128 x double]]] zeroinitializer, align 32
@C4 = common global [128 x [128 x double]] zeroinitializer, align 32
@stderr = external global %struct._IO_FILE*
@.str = private constant [8 x i8] c"%0.2lf \00", align 1
@sum = common global [128 x [128 x [128 x double]]] zeroinitializer, align 32
define void @scop_func() nounwind {
bb.nph50.bb.nph50.split_crit_edge:
br label %bb11.preheader
bb5.us: ; preds = %bb3.us
%.lcssa = phi double [ %4, %bb3.us ]
store double %.lcssa, double* %scevgep54
%0 = add nsw i64 %storemerge26.us, 1
%exitcond = icmp eq i64 %0, 128
br i1 %exitcond, label %bb8.loopexit, label %bb.nph.us
bb3.us: ; preds = %bb.nph.us, %bb3.us
%.tmp.0.us = phi double [ 0.000000e+00, %bb.nph.us ], [ %4, %bb3.us ]
%storemerge45.us = phi i64 [ 0, %bb.nph.us ], [ %5, %bb3.us ]
%scevgep51 = getelementptr [128 x [128 x [128 x double]]]* @A, i64 0, i64 %storemerge30, i64 %storemerge113, i64 %storemerge45.us
%scevgep = getelementptr [128 x [128 x double]]* @C4, i64 0, i64 %storemerge45.us, i64 %storemerge26.us
%1 = load double* %scevgep51, align 8
%2 = load double* %scevgep, align 8
%3 = fmul double %1, %2
%4 = fadd double %.tmp.0.us, %3
%5 = add nsw i64 %storemerge45.us, 1
%exitcond1 = icmp eq i64 %5, 128
br i1 %exitcond1, label %bb5.us, label %bb3.us
bb.nph.us: ; preds = %bb6.preheader, %bb5.us
%storemerge26.us = phi i64 [ %0, %bb5.us ], [ 0, %bb6.preheader ]
%scevgep54 = getelementptr [128 x [128 x [128 x double]]]* @sum, i64 0, i64 %storemerge30, i64 %storemerge113, i64 %storemerge26.us
store double 0.000000e+00, double* %scevgep54, align 8
br label %bb3.us
bb8.loopexit: ; preds = %bb5.us
br label %bb8
bb8: ; preds = %bb8.loopexit, %bb8
%storemerge311 = phi i64 [ %7, %bb8 ], [ 0, %bb8.loopexit ]
%scevgep57 = getelementptr [128 x [128 x [128 x double]]]* @sum, i64 0, i64 %storemerge30, i64 %storemerge113, i64 %storemerge311
%scevgep56 = getelementptr [128 x [128 x [128 x double]]]* @A, i64 0, i64 %storemerge30, i64 %storemerge113, i64 %storemerge311
%6 = load double* %scevgep57, align 8
store double %6, double* %scevgep56, align 8
%7 = add nsw i64 %storemerge311, 1
%exitcond6 = icmp eq i64 %7, 128
br i1 %exitcond6, label %bb10, label %bb8
bb10: ; preds = %bb8
%8 = add nsw i64 %storemerge113, 1
%exitcond9 = icmp ne i64 %8, 128
br i1 %exitcond9, label %bb6.preheader, label %bb12
bb6.preheader: ; preds = %bb11.preheader, %bb10
%storemerge113 = phi i64 [ %8, %bb10 ], [ 0, %bb11.preheader ]
br label %bb.nph.us
bb12: ; preds = %bb10
%9 = add nsw i64 %storemerge30, 1
%exitcond14 = icmp ne i64 %9, 128
br i1 %exitcond14, label %bb11.preheader, label %return
bb11.preheader: ; preds = %bb12, %bb.nph50.bb.nph50.split_crit_edge
%storemerge30 = phi i64 [ 0, %bb.nph50.bb.nph50.split_crit_edge ], [ %9, %bb12 ]
br label %bb6.preheader
return: ; preds = %bb12
ret void
}
; CHECK: Valid Region for Scop: bb11.preheader => return

View File

@ -1 +0,0 @@
-DNI=1024 -DNJ=1024 -DNK=1024

View File

@ -1,139 +0,0 @@
#include <stdio.h>
#include <unistd.h>
#include <string.h>
#include <math.h>
#include "instrument.h"
/* Default problem size. */
#ifndef NI
# define NI 512
#endif
#ifndef NJ
# define NJ 512
#endif
#ifndef NK
# define NK 512
#endif
/* Default data type is double (dgemm). */
#ifndef DATA_TYPE
# define DATA_TYPE double
#endif
/* Array declaration. Enable malloc if POLYBENCH_TEST_MALLOC. */
DATA_TYPE alpha;
DATA_TYPE beta;
#ifndef POLYBENCH_TEST_MALLOC
DATA_TYPE C[NI][NJ];
DATA_TYPE A[NI][NK];
DATA_TYPE B[NK][NJ];
#else
DATA_TYPE** C = (DATA_TYPE**)malloc(NI * sizeof(DATA_TYPE*));
DATA_TYPE** A = (DATA_TYPE**)malloc(NI * sizeof(DATA_TYPE*));
DATA_TYPE** B = (DATA_TYPE**)malloc(NK * sizeof(DATA_TYPE*));
{
int i;
for (i = 0; i < NI; ++i)
{
C[i] = (DATA_TYPE*)malloc(NJ * sizeof(DATA_TYPE));
A[i] = (DATA_TYPE*)malloc(NK * sizeof(DATA_TYPE));
}
for (i = 0; i < NK; ++i)
B[i] = (DATA_TYPE*)malloc(NJ * sizeof(DATA_TYPE));
}
#endif
inline
void init_array()
{
int i, j;
alpha = 32412;
beta = 2123;
for (i = 0; i < NI; i++)
for (j = 0; j < NK; j++)
A[i][j] = ((DATA_TYPE) i*j)/NI;
for (i = 0; i < NK; i++)
for (j = 0; j < NJ; j++)
B[i][j] = ((DATA_TYPE) i*j + 1)/NJ;
for (i = 0; i < NI; i++)
for (j = 0; j < NJ; j++)
C[i][j] = ((DATA_TYPE) i*j + 2)/NJ;
}
/* Define the live-out variables. Code is not executed unless
POLYBENCH_DUMP_ARRAYS is defined. */
inline
void print_array(int argc, char** argv)
{
int i, j;
#ifndef POLYBENCH_DUMP_ARRAYS
if (argc > 42 && ! strcmp(argv[0], ""))
#endif
{
for (i = 0; i < NI; i++) {
for (j = 0; j < NJ; j++) {
fprintf(stderr, "%0.2lf ", C[i][j]);
if ((i * NI + j) % 80 == 20) fprintf(stderr, "\n");
}
fprintf(stderr, "\n");
}
}
}
#ifndef SCOP_PARAM
void scop_func() {
long ni = NI;
long nj = NJ;
long nk = NK;
#else
void scop_func(long ni, long nj, long nk) {
#endif
long i, j, k;
#pragma scop
#pragma live-out C
/* C := alpha*A*B + beta*C */
for (i = 0; i < ni; i++)
for (j = 0; j < nj; j++)
{
C[i][j] *= beta;
for (k = 0; k < nk; ++k)
C[i][j] += alpha * A[i][k] * B[k][j];
}
#pragma endscop
}
int main(int argc, char** argv)
{
int i, j, k;
int ni = NI;
int nj = NJ;
int nk = NK;
/* Initialize array. */
init_array();
/* Start timer. */
polybench_start_instruments;
#ifndef SCOP_PARAM
scop_func();
#else
scop_func(ni, nj, nk);
#endif
/* Stop and print timer. */
polybench_stop_instruments;
polybench_print_instruments;
print_array(argc, argv);
return 0;
}

View File

@ -1,97 +0,0 @@
; RUN: opt %loadPolly %defaultOpts -polly-detect -polly-ast -analyze %s | FileCheck %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"
%struct._IO_FILE = type { i32, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, %struct._IO_marker*, %struct._IO_FILE*, i32, i32, i64, i16, i8, [1 x i8], i8*, i64, i8*, i8*, i8*, i8*, i64, i32, [20 x i8] }
%struct._IO_marker = type { %struct._IO_marker*, %struct._IO_FILE*, i32 }
@alpha = common global double 0.000000e+00
@beta = common global double 0.000000e+00
@A = common global [512 x [512 x double]] zeroinitializer, align 32
@B = common global [512 x [512 x double]] zeroinitializer, align 32
@C = common global [512 x [512 x double]] zeroinitializer, align 32
@stderr = external global %struct._IO_FILE*
@.str = private constant [8 x i8] c"%0.2lf \00", align 1
define void @scop_func(i64 %ni, i64 %nj, i64 %nk) nounwind {
entry:
%0 = icmp sgt i64 %ni, 0
br i1 %0, label %bb.nph26, label %return
bb.nph8: ; preds = %bb.nph8.preheader, %bb6
%indvar3 = phi i64 [ 0, %bb.nph8.preheader ], [ %indvar.next4, %bb6 ]
br i1 %14, label %bb.nph.us.preheader, label %bb4.preheader
bb.nph.us.preheader: ; preds = %bb.nph8
br label %bb.nph.us
bb4.preheader: ; preds = %bb.nph8
br label %bb4
bb4.us: ; preds = %bb2.us
%.lcssa = phi double [ %6, %bb2.us ]
store double %.lcssa, double* %scevgep30
%1 = add nsw i64 %storemerge14.us, 1
%exitcond = icmp eq i64 %1, %nj
br i1 %exitcond, label %bb6.loopexit1, label %bb.nph.us
bb2.us: ; preds = %bb.nph.us, %bb2.us
%.tmp.0.us = phi double [ %9, %bb.nph.us ], [ %6, %bb2.us ]
%storemerge23.us = phi i64 [ 0, %bb.nph.us ], [ %7, %bb2.us ]
%scevgep27 = getelementptr [512 x [512 x double]]* @A, i64 0, i64 %indvar3, i64 %storemerge23.us
%scevgep = getelementptr [512 x [512 x double]]* @B, i64 0, i64 %storemerge23.us, i64 %storemerge14.us
%2 = load double* %scevgep27, align 8
%3 = fmul double %2, %15
%4 = load double* %scevgep, align 8
%5 = fmul double %3, %4
%6 = fadd double %.tmp.0.us, %5
%7 = add nsw i64 %storemerge23.us, 1
%exitcond6 = icmp eq i64 %7, %nk
br i1 %exitcond6, label %bb4.us, label %bb2.us
bb.nph.us: ; preds = %bb.nph.us.preheader, %bb4.us
%storemerge14.us = phi i64 [ %1, %bb4.us ], [ 0, %bb.nph.us.preheader ]
%scevgep30 = getelementptr [512 x [512 x double]]* @C, i64 0, i64 %indvar3, i64 %storemerge14.us
%8 = load double* %scevgep30, align 8
%9 = fmul double %8, %13
store double %9, double* %scevgep30, align 8
br label %bb2.us
bb4: ; preds = %bb4.preheader, %bb4
%indvar = phi i64 [ %indvar.next, %bb4 ], [ 0, %bb4.preheader ]
%scevgep35 = getelementptr [512 x [512 x double]]* @C, i64 0, i64 %indvar3, i64 %indvar
%10 = load double* %scevgep35, align 8
%11 = fmul double %10, %13
store double %11, double* %scevgep35, align 8
%indvar.next = add i64 %indvar, 1
%exitcond2 = icmp eq i64 %indvar.next, %nj
br i1 %exitcond2, label %bb6.loopexit, label %bb4
bb6.loopexit: ; preds = %bb4
br label %bb6
bb6.loopexit1: ; preds = %bb4.us
br label %bb6
bb6: ; preds = %bb6.loopexit1, %bb6.loopexit
%indvar.next4 = add i64 %indvar3, 1
%exitcond11 = icmp ne i64 %indvar.next4, %ni
br i1 %exitcond11, label %bb.nph8, label %return.loopexit
bb.nph26: ; preds = %entry
%12 = icmp sgt i64 %nj, 0
%13 = load double* @beta, align 8
%14 = icmp sgt i64 %nk, 0
%15 = load double* @alpha, align 8
br i1 %12, label %bb.nph8.preheader, label %return
bb.nph8.preheader: ; preds = %bb.nph26
br label %bb.nph8
return.loopexit: ; preds = %bb6
br label %return
return: ; preds = %return.loopexit, %bb.nph26, %entry
ret void
}
; CHECK: for region: 'entry.split => return' in function 'scop_func':

View File

@ -1,63 +0,0 @@
; RUN: opt %loadPolly %defaultOpts -polly-detect -analyze %s | FileCheck %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"
%struct._IO_FILE = type { i32, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, %struct._IO_marker*, %struct._IO_FILE*, i32, i32, i64, i16, i8, [1 x i8], i8*, i64, i8*, i8*, i8*, i8*, i64, i32, [20 x i8] }
%struct._IO_marker = type { %struct._IO_marker*, %struct._IO_FILE*, i32 }
@alpha = common global double 0.000000e+00
@beta = common global double 0.000000e+00
@A = common global [512 x [512 x double]] zeroinitializer, align 32
@B = common global [512 x [512 x double]] zeroinitializer, align 32
@C = common global [512 x [512 x double]] zeroinitializer, align 32
@stderr = external global %struct._IO_FILE*
@.str = private constant [8 x i8] c"%0.2lf \00", align 1
define void @scop_func() nounwind {
bb.nph26.bb.nph26.split_crit_edge:
%0 = load double* @beta, align 8
%1 = load double* @alpha, align 8
br label %bb5.preheader
bb4.us: ; preds = %bb2.us
%.lcssa = phi double [ %7, %bb2.us ]
store double %.lcssa, double* %scevgep30
%2 = add nsw i64 %storemerge14.us, 1
%exitcond = icmp eq i64 %2, 512
br i1 %exitcond, label %bb6, label %bb.nph.us
bb2.us: ; preds = %bb.nph.us, %bb2.us
%.tmp.0.us = phi double [ %10, %bb.nph.us ], [ %7, %bb2.us ]
%storemerge23.us = phi i64 [ 0, %bb.nph.us ], [ %8, %bb2.us ]
%scevgep27 = getelementptr [512 x [512 x double]]* @A, i64 0, i64 %storemerge9, i64 %storemerge23.us
%scevgep = getelementptr [512 x [512 x double]]* @B, i64 0, i64 %storemerge23.us, i64 %storemerge14.us
%3 = load double* %scevgep27, align 8
%4 = fmul double %3, %1
%5 = load double* %scevgep, align 8
%6 = fmul double %4, %5
%7 = fadd double %.tmp.0.us, %6
%8 = add nsw i64 %storemerge23.us, 1
%exitcond1 = icmp eq i64 %8, 512
br i1 %exitcond1, label %bb4.us, label %bb2.us
bb.nph.us: ; preds = %bb5.preheader, %bb4.us
%storemerge14.us = phi i64 [ %2, %bb4.us ], [ 0, %bb5.preheader ]
%scevgep30 = getelementptr [512 x [512 x double]]* @C, i64 0, i64 %storemerge9, i64 %storemerge14.us
%9 = load double* %scevgep30, align 8
%10 = fmul double %9, %0
store double %10, double* %scevgep30, align 8
br label %bb2.us
bb6: ; preds = %bb4.us
%11 = add nsw i64 %storemerge9, 1
%exitcond6 = icmp ne i64 %11, 512
br i1 %exitcond6, label %bb5.preheader, label %return
bb5.preheader: ; preds = %bb6, %bb.nph26.bb.nph26.split_crit_edge
%storemerge9 = phi i64 [ 0, %bb.nph26.bb.nph26.split_crit_edge ], [ %11, %bb6 ]
br label %bb.nph.us
return: ; preds = %bb6
ret void
}
; CHECK: Valid Region for Scop: bb5.preheader => return

View File

@ -1,146 +0,0 @@
#include <stdio.h>
#include <unistd.h>
#include <string.h>
#include <math.h>
#include "instrument.h"
/* Default problem size. */
#ifndef N
# define N 4000
#endif
/* Default data type is double. */
#ifndef DATA_TYPE
# define DATA_TYPE double
#endif
/* Array declaration. Enable malloc if POLYBENCH_TEST_MALLOC. */
DATA_TYPE alpha;
DATA_TYPE beta;
#ifndef POLYBENCH_TEST_MALLOC
DATA_TYPE A[N][N];
DATA_TYPE B[N][N];
DATA_TYPE x[N];
DATA_TYPE u1[N];
DATA_TYPE u2[N];
DATA_TYPE v2[N];
DATA_TYPE v1[N];
DATA_TYPE w[N];
DATA_TYPE y[N];
DATA_TYPE z[N];
#else
DATA_TYPE** A = (DATA_TYPE**)malloc(N * sizeof(DATA_TYPE*));
DATA_TYPE** B = (DATA_TYPE**)malloc(N * sizeof(DATA_TYPE*));
DATA_TYPE* x = (DATA_TYPE*)malloc(N * sizeof(DATA_TYPE));
DATA_TYPE* u1 = (DATA_TYPE*)malloc(N * sizeof(DATA_TYPE));
DATA_TYPE* u2 = (DATA_TYPE*)malloc(N * sizeof(DATA_TYPE));
DATA_TYPE* v1 = (DATA_TYPE*)malloc(N * sizeof(DATA_TYPE));
DATA_TYPE* v2 = (DATA_TYPE*)malloc(N * sizeof(DATA_TYPE));
DATA_TYPE* w = (DATA_TYPE*)malloc(N * sizeof(DATA_TYPE));
DATA_TYPE* y = (DATA_TYPE*)malloc(N * sizeof(DATA_TYPE));
DATA_TYPE* z = (DATA_TYPE*)malloc(N * sizeof(DATA_TYPE));
{
int i;
for (i = 0; i < N; ++i)
{
A[i] = (DATA_TYPE*)malloc(N * sizeof(DATA_TYPE));
B[i] = (DATA_TYPE*)malloc(N * sizeof(DATA_TYPE));
}
}
#endif
inline
void init_array()
{
int i, j;
alpha = 43532;
beta = 12313;
for (i = 0; i < N; i++)
{
u1[i] = i;
u2[i] = (i+1)/N/2.0;
v1[i] = (i+1)/N/4.0;
v2[i] = (i+1)/N/6.0;
y[i] = (i+1)/N/8.0;
z[i] = (i+1)/N/9.0;
x[i] = 0.0;
w[i] = 0.0;
for (j = 0; j < N; j++)
A[i][j] = ((DATA_TYPE) i*j) / N;
}
}
/* Define the live-out variables. Code is not executed unless
POLYBENCH_DUMP_ARRAYS is defined. */
inline
void print_array(int argc, char** argv)
{
int i, j;
#ifndef POLYBENCH_DUMP_ARRAYS
if (argc > 42 && ! strcmp(argv[0], ""))
#endif
{
for (i = 0; i < N; i++) {
fprintf(stderr, "%0.2lf ", w[i]);
if (i%80 == 20) fprintf(stderr, "\n");
}
fprintf(stderr, "\n");
}
}
#ifndef SCOP_PARAM
void scop_func() {
long n = N;
#else
void scop_func(long n) {
#endif
long i, j;
#pragma scop
#pragma live-out w
for (i = 0; i < n; i++)
for (j = 0; j < n; j++)
A[i][j] = A[i][j] + u1[i] * v1[j] + u2[i] * v2[j];
for (i = 0; i < n; i++)
for (j = 0; j < n; j++)
x[i] = x[i] + beta * A[j][i] * y[j];
for (i = 0; i < n; i++)
x[i] = x[i] + z[i];
for (i = 0; i < n; i++)
for (j = 0; j < n; j++)
w[i] = w[i] + alpha * A[i][j] * x[j];
#pragma endscop
}
int main(int argc, char** argv)
{
int i, j;
int n = N;
/* Initialize array. */
init_array();
/* Start timer. */
polybench_start_instruments;
#ifndef SCOP_PARAM
scop_func();
#else
scop_func(n);
#endif
/* Stop and print timer. */
polybench_stop_instruments;
polybench_print_instruments;
print_array(argc, argv);
return 0;
}

View File

@ -1,153 +0,0 @@
; RUN: opt %loadPolly %defaultOpts -polly-detect -polly-ast -analyze %s | FileCheck %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"
%struct._IO_FILE = type { i32, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, %struct._IO_marker*, %struct._IO_FILE*, i32, i32, i64, i16, i8, [1 x i8], i8*, i64, i8*, i8*, i8*, i8*, i64, i32, [20 x i8] }
%struct._IO_marker = type { %struct._IO_marker*, %struct._IO_FILE*, i32 }
@alpha = common global double 0.000000e+00
@beta = common global double 0.000000e+00
@u1 = common global [4000 x double] zeroinitializer, align 32
@u2 = common global [4000 x double] zeroinitializer, align 32
@v1 = common global [4000 x double] zeroinitializer, align 32
@v2 = common global [4000 x double] zeroinitializer, align 32
@y = common global [4000 x double] zeroinitializer, align 32
@z = common global [4000 x double] zeroinitializer, align 32
@x = common global [4000 x double] zeroinitializer, align 32
@w = common global [4000 x double] zeroinitializer, align 32
@A = common global [4000 x [4000 x double]] zeroinitializer, align 32
@stderr = external global %struct._IO_FILE*
@.str = private constant [8 x i8] c"%0.2lf \00", align 1
@B = common global [4000 x [4000 x double]] zeroinitializer, align 32
define void @scop_func(i64 %n) nounwind {
entry:
%0 = icmp sgt i64 %n, 0
br i1 %0, label %bb.nph40.preheader, label %return
bb.nph40.preheader: ; preds = %entry
br label %bb.nph40
bb.nph40: ; preds = %bb.nph40.preheader, %bb3
%i.041 = phi i64 [ %11, %bb3 ], [ 0, %bb.nph40.preheader ]
%scevgep66 = getelementptr [4000 x double]* @u1, i64 0, i64 %i.041
%scevgep67 = getelementptr [4000 x double]* @u2, i64 0, i64 %i.041
%1 = load double* %scevgep66, align 8
%2 = load double* %scevgep67, align 8
br label %bb1
bb1: ; preds = %bb1, %bb.nph40
%j.039 = phi i64 [ 0, %bb.nph40 ], [ %10, %bb1 ]
%scevgep63 = getelementptr [4000 x [4000 x double]]* @A, i64 0, i64 %i.041, i64 %j.039
%scevgep62 = getelementptr [4000 x double]* @v2, i64 0, i64 %j.039
%scevgep61 = getelementptr [4000 x double]* @v1, i64 0, i64 %j.039
%3 = load double* %scevgep63, align 8
%4 = load double* %scevgep61, align 8
%5 = fmul double %1, %4
%6 = fadd double %3, %5
%7 = load double* %scevgep62, align 8
%8 = fmul double %2, %7
%9 = fadd double %6, %8
store double %9, double* %scevgep63, align 8
%10 = add nsw i64 %j.039, 1
%exitcond16 = icmp eq i64 %10, %n
br i1 %exitcond16, label %bb3, label %bb1
bb3: ; preds = %bb1
%11 = add nsw i64 %i.041, 1
%exitcond20 = icmp eq i64 %11, %n
br i1 %exitcond20, label %bb10.preheader, label %bb.nph40
bb10.preheader: ; preds = %bb3
br i1 %0, label %bb.nph38.bb.nph38.split_crit_edge, label %return
bb.nph30: ; preds = %bb.nph38.bb.nph38.split_crit_edge, %bb9
%i.134 = phi i64 [ 0, %bb.nph38.bb.nph38.split_crit_edge ], [ %18, %bb9 ]
%scevgep59 = getelementptr [4000 x double]* @x, i64 0, i64 %i.134
%.promoted31 = load double* %scevgep59
br label %bb7
bb7: ; preds = %bb7, %bb.nph30
%.tmp.032 = phi double [ %.promoted31, %bb.nph30 ], [ %16, %bb7 ]
%j.129 = phi i64 [ 0, %bb.nph30 ], [ %17, %bb7 ]
%scevgep56 = getelementptr [4000 x [4000 x double]]* @A, i64 0, i64 %j.129, i64 %i.134
%scevgep55 = getelementptr [4000 x double]* @y, i64 0, i64 %j.129
%12 = load double* %scevgep56, align 8
%13 = fmul double %12, %19
%14 = load double* %scevgep55, align 8
%15 = fmul double %13, %14
%16 = fadd double %.tmp.032, %15
%17 = add nsw i64 %j.129, 1
%exitcond10 = icmp eq i64 %17, %n
br i1 %exitcond10, label %bb9, label %bb7
bb9: ; preds = %bb7
%.lcssa9 = phi double [ %16, %bb7 ]
store double %.lcssa9, double* %scevgep59
%18 = add nsw i64 %i.134, 1
%exitcond13 = icmp eq i64 %18, %n
br i1 %exitcond13, label %bb13.preheader, label %bb.nph30
bb.nph38.bb.nph38.split_crit_edge: ; preds = %bb10.preheader
%19 = load double* @beta, align 8
br label %bb.nph30
bb13.preheader: ; preds = %bb9
br i1 %0, label %bb12.preheader, label %return
bb12.preheader: ; preds = %bb13.preheader
br label %bb12
bb12: ; preds = %bb12.preheader, %bb12
%i.227 = phi i64 [ %23, %bb12 ], [ 0, %bb12.preheader ]
%scevgep52 = getelementptr [4000 x double]* @z, i64 0, i64 %i.227
%scevgep51 = getelementptr [4000 x double]* @x, i64 0, i64 %i.227
%20 = load double* %scevgep51, align 8
%21 = load double* %scevgep52, align 8
%22 = fadd double %20, %21
store double %22, double* %scevgep51, align 8
%23 = add nsw i64 %i.227, 1
%exitcond6 = icmp eq i64 %23, %n
br i1 %exitcond6, label %bb19.preheader, label %bb12
bb19.preheader: ; preds = %bb12
br i1 %0, label %bb.nph26.bb.nph26.split_crit_edge, label %return
bb.nph: ; preds = %bb.nph26.bb.nph26.split_crit_edge, %bb18
%i.322 = phi i64 [ 0, %bb.nph26.bb.nph26.split_crit_edge ], [ %30, %bb18 ]
%scevgep49 = getelementptr [4000 x double]* @w, i64 0, i64 %i.322
%.promoted = load double* %scevgep49
br label %bb16
bb16: ; preds = %bb16, %bb.nph
%.tmp.0 = phi double [ %.promoted, %bb.nph ], [ %28, %bb16 ]
%j.221 = phi i64 [ 0, %bb.nph ], [ %29, %bb16 ]
%scevgep46 = getelementptr [4000 x [4000 x double]]* @A, i64 0, i64 %i.322, i64 %j.221
%scevgep = getelementptr [4000 x double]* @x, i64 0, i64 %j.221
%24 = load double* %scevgep46, align 8
%25 = fmul double %24, %31
%26 = load double* %scevgep, align 8
%27 = fmul double %25, %26
%28 = fadd double %.tmp.0, %27
%29 = add nsw i64 %j.221, 1
%exitcond1 = icmp eq i64 %29, %n
br i1 %exitcond1, label %bb18, label %bb16
bb18: ; preds = %bb16
%.lcssa = phi double [ %28, %bb16 ]
store double %.lcssa, double* %scevgep49
%30 = add nsw i64 %i.322, 1
%exitcond = icmp eq i64 %30, %n
br i1 %exitcond, label %return.loopexit, label %bb.nph
bb.nph26.bb.nph26.split_crit_edge: ; preds = %bb19.preheader
%31 = load double* @alpha, align 8
br label %bb.nph
return.loopexit: ; preds = %bb18
br label %return
return: ; preds = %return.loopexit, %bb19.preheader, %bb13.preheader, %bb10.preheader, %entry
ret void
}
; CHECK: for region: 'entry.split => return' in function 'scop_func':

View File

@ -1,137 +0,0 @@
; RUN: opt %loadPolly %defaultOpts -polly-detect -polly-ast -analyze %s | FileCheck %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"
%struct._IO_FILE = type { i32, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, %struct._IO_marker*, %struct._IO_FILE*, i32, i32, i64, i16, i8, [1 x i8], i8*, i64, i8*, i8*, i8*, i8*, i64, i32, [20 x i8] }
%struct._IO_marker = type { %struct._IO_marker*, %struct._IO_FILE*, i32 }
@alpha = common global double 0.000000e+00
@beta = common global double 0.000000e+00
@u1 = common global [4000 x double] zeroinitializer, align 32
@u2 = common global [4000 x double] zeroinitializer, align 32
@v1 = common global [4000 x double] zeroinitializer, align 32
@v2 = common global [4000 x double] zeroinitializer, align 32
@y = common global [4000 x double] zeroinitializer, align 32
@z = common global [4000 x double] zeroinitializer, align 32
@x = common global [4000 x double] zeroinitializer, align 32
@w = common global [4000 x double] zeroinitializer, align 32
@A = common global [4000 x [4000 x double]] zeroinitializer, align 32
@stderr = external global %struct._IO_FILE*
@.str = private constant [8 x i8] c"%0.2lf \00", align 1
@B = common global [4000 x [4000 x double]] zeroinitializer, align 32
define void @scop_func() nounwind {
bb.nph31.bb.nph31.split_crit_edge:
br label %bb.nph26
bb.nph26: ; preds = %bb3, %bb.nph31.bb.nph31.split_crit_edge
%storemerge27 = phi i64 [ 0, %bb.nph31.bb.nph31.split_crit_edge ], [ %10, %bb3 ]
%scevgep52 = getelementptr [4000 x double]* @u1, i64 0, i64 %storemerge27
%scevgep53 = getelementptr [4000 x double]* @u2, i64 0, i64 %storemerge27
%0 = load double* %scevgep52, align 8
%1 = load double* %scevgep53, align 8
br label %bb1
bb1: ; preds = %bb1, %bb.nph26
%storemerge625 = phi i64 [ 0, %bb.nph26 ], [ %9, %bb1 ]
%scevgep47 = getelementptr [4000 x [4000 x double]]* @A, i64 0, i64 %storemerge27, i64 %storemerge625
%scevgep49 = getelementptr [4000 x double]* @v2, i64 0, i64 %storemerge625
%scevgep48 = getelementptr [4000 x double]* @v1, i64 0, i64 %storemerge625
%2 = load double* %scevgep47, align 8
%3 = load double* %scevgep48, align 8
%4 = fmul double %0, %3
%5 = fadd double %2, %4
%6 = load double* %scevgep49, align 8
%7 = fmul double %1, %6
%8 = fadd double %5, %7
store double %8, double* %scevgep47, align 8
%9 = add nsw i64 %storemerge625, 1
%exitcond16 = icmp eq i64 %9, 4000
br i1 %exitcond16, label %bb3, label %bb1
bb3: ; preds = %bb1
%10 = add nsw i64 %storemerge27, 1
%exitcond20 = icmp eq i64 %10, 4000
br i1 %exitcond20, label %bb.nph24.bb.nph24.split_crit_edge, label %bb.nph26
bb.nph16: ; preds = %bb.nph24.bb.nph24.split_crit_edge, %bb9
%storemerge120 = phi i64 [ 0, %bb.nph24.bb.nph24.split_crit_edge ], [ %17, %bb9 ]
%scevgep45 = getelementptr [4000 x double]* @x, i64 0, i64 %storemerge120
%.promoted17 = load double* %scevgep45
br label %bb7
bb7: ; preds = %bb7, %bb.nph16
%.tmp.018 = phi double [ %.promoted17, %bb.nph16 ], [ %15, %bb7 ]
%storemerge515 = phi i64 [ 0, %bb.nph16 ], [ %16, %bb7 ]
%scevgep42 = getelementptr [4000 x [4000 x double]]* @A, i64 0, i64 %storemerge515, i64 %storemerge120
%scevgep41 = getelementptr [4000 x double]* @y, i64 0, i64 %storemerge515
%11 = load double* %scevgep42, align 8
%12 = fmul double %11, %18
%13 = load double* %scevgep41, align 8
%14 = fmul double %12, %13
%15 = fadd double %.tmp.018, %14
%16 = add nsw i64 %storemerge515, 1
%exitcond10 = icmp eq i64 %16, 4000
br i1 %exitcond10, label %bb9, label %bb7
bb9: ; preds = %bb7
%.lcssa9 = phi double [ %15, %bb7 ]
store double %.lcssa9, double* %scevgep45
%17 = add nsw i64 %storemerge120, 1
%exitcond13 = icmp eq i64 %17, 4000
br i1 %exitcond13, label %bb12.preheader, label %bb.nph16
bb12.preheader: ; preds = %bb9
br label %bb12
bb.nph24.bb.nph24.split_crit_edge: ; preds = %bb3
%18 = load double* @beta, align 8
br label %bb.nph16
bb12: ; preds = %bb12.preheader, %bb12
%storemerge213 = phi i64 [ %22, %bb12 ], [ 0, %bb12.preheader ]
%scevgep38 = getelementptr [4000 x double]* @x, i64 0, i64 %storemerge213
%scevgep37 = getelementptr [4000 x double]* @z, i64 0, i64 %storemerge213
%19 = load double* %scevgep38, align 8
%20 = load double* %scevgep37, align 8
%21 = fadd double %19, %20
store double %21, double* %scevgep38, align 8
%22 = add nsw i64 %storemerge213, 1
%exitcond6 = icmp eq i64 %22, 4000
br i1 %exitcond6, label %bb.nph12.bb.nph12.split_crit_edge, label %bb12
bb.nph: ; preds = %bb.nph12.bb.nph12.split_crit_edge, %bb18
%storemerge38 = phi i64 [ 0, %bb.nph12.bb.nph12.split_crit_edge ], [ %29, %bb18 ]
%scevgep35 = getelementptr [4000 x double]* @w, i64 0, i64 %storemerge38
%.promoted = load double* %scevgep35
br label %bb16
bb16: ; preds = %bb16, %bb.nph
%.tmp.0 = phi double [ %.promoted, %bb.nph ], [ %27, %bb16 ]
%storemerge47 = phi i64 [ 0, %bb.nph ], [ %28, %bb16 ]
%scevgep32 = getelementptr [4000 x [4000 x double]]* @A, i64 0, i64 %storemerge38, i64 %storemerge47
%scevgep = getelementptr [4000 x double]* @x, i64 0, i64 %storemerge47
%23 = load double* %scevgep32, align 8
%24 = fmul double %23, %30
%25 = load double* %scevgep, align 8
%26 = fmul double %24, %25
%27 = fadd double %.tmp.0, %26
%28 = add nsw i64 %storemerge47, 1
%exitcond1 = icmp eq i64 %28, 4000
br i1 %exitcond1, label %bb18, label %bb16
bb18: ; preds = %bb16
%.lcssa = phi double [ %27, %bb16 ]
store double %.lcssa, double* %scevgep35
%29 = add nsw i64 %storemerge38, 1
%exitcond = icmp eq i64 %29, 4000
br i1 %exitcond, label %return, label %bb.nph
bb.nph12.bb.nph12.split_crit_edge: ; preds = %bb12
%30 = load double* @alpha, align 8
br label %bb.nph
return: ; preds = %bb18
ret void
}
; CHECK: for region: 'bb.nph26 => return' in function 'scop_func':

View File

@ -1,127 +0,0 @@
#include <stdio.h>
#include <unistd.h>
#include <string.h>
#include <math.h>
#include "instrument.h"
/* Default problem size. */
#ifndef N
# define N 4000
#endif
/* Default data type is double. */
#ifndef DATA_TYPE
# define DATA_TYPE double
#endif
/* Array declaration. Enable malloc if POLYBENCH_TEST_MALLOC. */
DATA_TYPE alpha;
DATA_TYPE beta;
#ifndef POLYBENCH_TEST_MALLOC
DATA_TYPE A[N][N];
DATA_TYPE B[N][N];
DATA_TYPE x[N];
DATA_TYPE y[N];
DATA_TYPE tmp[N];
#else
DATA_TYPE** A = (DATA_TYPE**)malloc(N * sizeof(DATA_TYPE*));
DATA_TYPE** B = (DATA_TYPE**)malloc(N * sizeof(DATA_TYPE*));
DATA_TYPE* x = (DATA_TYPE*)malloc(N * sizeof(DATA_TYPE));
DATA_TYPE* y = (DATA_TYPE*)malloc(N * sizeof(DATA_TYPE));
DATA_TYPE* tmp = (DATA_TYPE*)malloc(N * sizeof(DATA_TYPE));
{
int i;
for (i = 0; i < N; ++i)
{
A[i] = (DATA_TYPE*)malloc(N * sizeof(DATA_TYPE));
B[i] = (DATA_TYPE*)malloc(N * sizeof(DATA_TYPE));
}
}
#endif
inline
void init_array()
{
int i, j;
alpha = 43532;
beta = 12313;
for (i = 0; i < N; i++)
{
x[i] = ((DATA_TYPE) i) / N;
for (j = 0; j < N; j++)
A[i][j] = ((DATA_TYPE) i*j) / N;
}
}
/* Define the live-out variables. Code is not executed unless
POLYBENCH_DUMP_ARRAYS is defined. */
inline
void print_array(int argc, char** argv)
{
int i, j;
#ifndef POLYBENCH_DUMP_ARRAYS
if (argc > 42 && ! strcmp(argv[0], ""))
#endif
{
for (i = 0; i < N; i++) {
fprintf(stderr, "%0.2lf ", y[i]);
if (i%80 == 20) fprintf(stderr, "\n");
}
fprintf(stderr, "\n");
}
}
#ifndef SCOP_PARAM
void scop_func() {
long n = N;
#else
void scop_func(long n) {
#endif
long i, j;
#pragma scop
#pragma live-out y
for (i = 0; i < n; i++)
{
tmp[i] = 0;
y[i] = 0;
for (j = 0; j < n; j++)
{
tmp[i] = A[i][j] * x[j] + tmp[i];
y[i] = B[i][j] * x[j] + y[i];
}
y[i] = alpha * tmp[i] + beta * y[i];
}
#pragma endscop
}
int main(int argc, char** argv)
{
int i, j;
int n = N;
/* Initialize array. */
init_array();
/* Start timer. */
polybench_start_instruments;
#ifndef SCOP_PARAM
scop_func();
#else
scop_func(n);
#endif
/* Stop and print timer. */
polybench_stop_instruments;
polybench_print_instruments;
print_array(argc, argv);
return 0;
}

View File

@ -1,72 +0,0 @@
; RUN: opt %loadPolly %defaultOpts -polly-ast -analyze %s | FileCheck %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"
%struct._IO_FILE = type { i32, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, %struct._IO_marker*, %struct._IO_FILE*, i32, i32, i64, i16, i8, [1 x i8], i8*, i64, i8*, i8*, i8*, i8*, i64, i32, [20 x i8] }
%struct._IO_marker = type { %struct._IO_marker*, %struct._IO_FILE*, i32 }
@alpha = common global double 0.000000e+00
@beta = common global double 0.000000e+00
@x = common global [4000 x double] zeroinitializer, align 32
@A = common global [4000 x [4000 x double]] zeroinitializer, align 32
@y = common global [4000 x double] zeroinitializer, align 32
@stderr = external global %struct._IO_FILE*
@.str = private constant [8 x i8] c"%0.2lf \00", align 1
@tmp = common global [4000 x double] zeroinitializer, align 32
@B = common global [4000 x [4000 x double]] zeroinitializer, align 32
define void @scop_func(i64 %n) nounwind {
entry:
%0 = icmp sgt i64 %n, 0
br i1 %0, label %bb.nph10.split.us, label %return
bb.nph10.split.us: ; preds = %entry
%1 = load double* @alpha, align 8
%2 = load double* @beta, align 8
br label %bb.nph.us
bb3.us: ; preds = %bb1.us
%.lcssa1 = phi double [ %13, %bb1.us ]
%.lcssa = phi double [ %10, %bb1.us ]
store double %.lcssa, double* %scevgep17
%3 = fmul double %.lcssa, %1
%4 = fmul double %.lcssa1, %2
%5 = fadd double %3, %4
store double %5, double* %scevgep18, align 8
%6 = add nsw i64 %storemerge6.us, 1
%exitcond = icmp eq i64 %6, %n
br i1 %exitcond, label %return.loopexit, label %bb.nph.us
bb1.us: ; preds = %bb.nph.us, %bb1.us
%.tmp3.0.us = phi double [ 0.000000e+00, %bb.nph.us ], [ %13, %bb1.us ]
%.tmp.0.us = phi double [ 0.000000e+00, %bb.nph.us ], [ %10, %bb1.us ]
%storemerge12.us = phi i64 [ 0, %bb.nph.us ], [ %14, %bb1.us ]
%scevgep13 = getelementptr [4000 x [4000 x double]]* @A, i64 0, i64 %storemerge6.us, i64 %storemerge12.us
%scevgep = getelementptr [4000 x [4000 x double]]* @B, i64 0, i64 %storemerge6.us, i64 %storemerge12.us
%scevgep12 = getelementptr [4000 x double]* @x, i64 0, i64 %storemerge12.us
%7 = load double* %scevgep13, align 8
%8 = load double* %scevgep12, align 8
%9 = fmul double %7, %8
%10 = fadd double %9, %.tmp.0.us
%11 = load double* %scevgep, align 8
%12 = fmul double %11, %8
%13 = fadd double %12, %.tmp3.0.us
%14 = add nsw i64 %storemerge12.us, 1
%exitcond2 = icmp eq i64 %14, %n
br i1 %exitcond2, label %bb3.us, label %bb1.us
bb.nph.us: ; preds = %bb3.us, %bb.nph10.split.us
%storemerge6.us = phi i64 [ 0, %bb.nph10.split.us ], [ %6, %bb3.us ]
%scevgep18 = getelementptr [4000 x double]* @y, i64 0, i64 %storemerge6.us
%scevgep17 = getelementptr [4000 x double]* @tmp, i64 0, i64 %storemerge6.us
store double 0.000000e+00, double* %scevgep17, align 8
store double 0.000000e+00, double* %scevgep18, align 8
br label %bb1.us
return.loopexit: ; preds = %bb3.us
br label %return
return: ; preds = %return.loopexit, %entry
ret void
}
; CHECK: for region: 'entry.split => return' in function 'scop_func':

View File

@ -1,65 +0,0 @@
; RUN: opt %loadPolly %defaultOpts -polly-detect -analyze %s | FileCheck %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"
%struct._IO_FILE = type { i32, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, %struct._IO_marker*, %struct._IO_FILE*, i32, i32, i64, i16, i8, [1 x i8], i8*, i64, i8*, i8*, i8*, i8*, i64, i32, [20 x i8] }
%struct._IO_marker = type { %struct._IO_marker*, %struct._IO_FILE*, i32 }
@alpha = common global double 0.000000e+00
@beta = common global double 0.000000e+00
@x = common global [4000 x double] zeroinitializer, align 32
@A = common global [4000 x [4000 x double]] zeroinitializer, align 32
@y = common global [4000 x double] zeroinitializer, align 32
@stderr = external global %struct._IO_FILE*
@.str = private constant [8 x i8] c"%0.2lf \00", align 1
@tmp = common global [4000 x double] zeroinitializer, align 32
@B = common global [4000 x [4000 x double]] zeroinitializer, align 32
define void @scop_func() nounwind {
bb.nph10.split.us:
%0 = load double* @alpha, align 8
%1 = load double* @beta, align 8
br label %bb.nph.us
bb3.us: ; preds = %bb1.us
%.lcssa1 = phi double [ %12, %bb1.us ]
%.lcssa = phi double [ %9, %bb1.us ]
store double %.lcssa, double* %scevgep17
%2 = fmul double %.lcssa, %0
%3 = fmul double %.lcssa1, %1
%4 = fadd double %2, %3
store double %4, double* %scevgep18, align 8
%5 = add nsw i64 %storemerge6.us, 1
%exitcond = icmp eq i64 %5, 4000
br i1 %exitcond, label %return, label %bb.nph.us
bb1.us: ; preds = %bb.nph.us, %bb1.us
%.tmp3.0.us = phi double [ 0.000000e+00, %bb.nph.us ], [ %12, %bb1.us ]
%.tmp.0.us = phi double [ 0.000000e+00, %bb.nph.us ], [ %9, %bb1.us ]
%storemerge12.us = phi i64 [ 0, %bb.nph.us ], [ %13, %bb1.us ]
%scevgep13 = getelementptr [4000 x [4000 x double]]* @A, i64 0, i64 %storemerge6.us, i64 %storemerge12.us
%scevgep = getelementptr [4000 x [4000 x double]]* @B, i64 0, i64 %storemerge6.us, i64 %storemerge12.us
%scevgep12 = getelementptr [4000 x double]* @x, i64 0, i64 %storemerge12.us
%6 = load double* %scevgep13, align 8
%7 = load double* %scevgep12, align 8
%8 = fmul double %6, %7
%9 = fadd double %8, %.tmp.0.us
%10 = load double* %scevgep, align 8
%11 = fmul double %10, %7
%12 = fadd double %11, %.tmp3.0.us
%13 = add nsw i64 %storemerge12.us, 1
%exitcond2 = icmp eq i64 %13, 4000
br i1 %exitcond2, label %bb3.us, label %bb1.us
bb.nph.us: ; preds = %bb3.us, %bb.nph10.split.us
%storemerge6.us = phi i64 [ 0, %bb.nph10.split.us ], [ %5, %bb3.us ]
%scevgep18 = getelementptr [4000 x double]* @y, i64 0, i64 %storemerge6.us
%scevgep17 = getelementptr [4000 x double]* @tmp, i64 0, i64 %storemerge6.us
store double 0.000000e+00, double* %scevgep17, align 8
store double 0.000000e+00, double* %scevgep18, align 8
br label %bb1.us
return: ; preds = %bb3.us
ret void
}
; CHECK: Valid Region for Scop: bb.nph.us => return

View File

@ -1,133 +0,0 @@
#include <stdio.h>
#include <unistd.h>
#include <string.h>
#include <math.h>
#include "instrument.h"
/* Default problem size. */
#ifndef M
# define M 512
#endif
#ifndef N
# define N 512
#endif
/* Default data type is double. */
#ifndef DATA_TYPE
# define DATA_TYPE double
#endif
#ifndef DATA_PRINTF_MODIFIER
# define DATA_PRINTF_MODIFIER "%0.2lf "
#endif
/* Array declaration. Enable malloc if POLYBENCH_TEST_MALLOC. */
DATA_TYPE nrm;
#ifndef POLYBENCH_TEST_MALLOC
DATA_TYPE A[M][N];
DATA_TYPE R[M][N];
DATA_TYPE Q[M][N];
#else
DATA_TYPE** A = (DATA_TYPE**)malloc(M * sizeof(DATA_TYPE*));
DATA_TYPE** R = (DATA_TYPE**)malloc(M * sizeof(DATA_TYPE*));
DATA_TYPE** Q = (DATA_TYPE**)malloc(M * sizeof(DATA_TYPE*));
{
int i;
for (i = 0; i < M; ++i)
{
A[i] = (DATA_TYPE*)malloc(N * sizeof(DATA_TYPE));
R[i] = (DATA_TYPE*)malloc(N * sizeof(DATA_TYPE));
Q[i] = (DATA_TYPE*)malloc(N * sizeof(DATA_TYPE));
}
}
#endif
inline
void init_array()
{
int i, j;
for (i = 0; i < M; i++)
for (j = 0; j < N; j++)
A[i][j] = ((DATA_TYPE) i*j) / M;
}
/* Define the live-out variables. Code is not executed unless
POLYBENCH_DUMP_ARRAYS is defined. */
inline
void print_array(int argc, char** argv)
{
int i, j;
#ifndef POLYBENCH_DUMP_ARRAYS
if (argc > 42 && ! strcmp(argv[0], ""))
#endif
{
for (i = 0; i < M; i++)
for (j = 0; j < N; j++) {
fprintf(stderr, DATA_PRINTF_MODIFIER, A[i][j]);
if ((i * M + j) % 80 == 20) fprintf(stderr, "\n");
}
fprintf(stderr, "\n");
}
}
#ifndef SCOP_PARAM
void scop_func() {
long m = M;
long n = N;
#else
void scop_func(long m, long n) {
#endif
long i, j, k;
#pragma scop
#pragma live-out A
for (k = 0; k < n; k++)
{
nrm = 0;
for (i = 0; i < m; i++)
nrm += A[i][k] * A[i][k];
R[k][k] = sqrt(nrm);
for (i = 0; i < m; i++)
Q[i][k] = A[i][k] / R[k][k];
for (j = k + 1; j < n; j++)
{
R[k][j] = 0;
for (i = 0; i < m; i++)
R[k][j] += Q[i][k] * A[i][j];
for (i = 0; i < m; i++)
A[i][j] = A[i][j] - Q[i][k] * R[k][j];
}
}
#pragma endscop
}
int main(int argc, char** argv)
{
int i, j, k;
int m = M;
int n = N;
/* Initialize array. */
init_array();
/* Start timer. */
polybench_start_instruments;
#ifndef SCOP_PARAM
scop_func();
#else
scop_func(m, n);
#endif
/* Stop and print timer. */
polybench_stop_instruments;
polybench_print_instruments;
print_array(argc, argv);
return 0;
}

View File

@ -1,174 +0,0 @@
; RUN: opt %loadPolly %defaultOpts -polly-prepare -polly-ast -analyze %s | FileCheck %s
; XFAIL: *
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"
@nrm = common global double 0.000000e+00, align 8
@A = common global [512 x [512 x double]] zeroinitializer, align 16
@R = common global [512 x [512 x double]] zeroinitializer, align 16
@Q = common global [512 x [512 x double]] zeroinitializer, align 16
define void @scop_func(i64 %m, i64 %n) nounwind {
bb:
%tmp3 = icmp sgt i64 %m, 0
%smax4 = select i1 %tmp3, i64 %m, i64 0
%tmp = icmp sgt i64 %m, 0
%smax = select i1 %tmp, i64 %m, i64 0
%tmp12 = icmp sgt i64 %m, 0
%smax13 = select i1 %tmp12, i64 %m, i64 0
%tmp25 = icmp sgt i64 %m, 0
%smax26 = select i1 %tmp25, i64 %m, i64 0
%tmp40 = add i64 %n, -1
%tmp60 = icmp sgt i64 %n, 0
%smax61 = select i1 %tmp60, i64 %n, i64 0
br label %bb1
bb1: ; preds = %bb58, %bb
%tmp2 = phi i64 [ 0, %bb ], [ %tmp59, %bb58 ]
%tmp63 = mul i64 %tmp2, 513
%tmp64 = add i64 %tmp63, 1
%tmp67 = add i64 %tmp2, 1
%tmp71 = mul i64 %tmp2, -1
%tmp45 = add i64 %tmp40, %tmp71
%scevgep50 = getelementptr [512 x [512 x double]]* @R, i64 0, i64 0, i64 %tmp63
%exitcond62 = icmp ne i64 %tmp2, %smax61
br i1 %exitcond62, label %bb3, label %bb60
bb3: ; preds = %bb1
store double 0.000000e+00, double* @nrm, align 8
br label %bb4
bb4: ; preds = %bb12, %bb3
%i.0 = phi i64 [ 0, %bb3 ], [ %tmp14, %bb12 ]
%scevgep = getelementptr [512 x [512 x double]]* @A, i64 0, i64 %i.0, i64 %tmp2
%exitcond5 = icmp ne i64 %i.0, %smax4
br i1 %exitcond5, label %bb5, label %bb15
bb5: ; preds = %bb4
%tmp7 = load double* %scevgep
%tmp8 = load double* %scevgep
%tmp9 = fmul double %tmp7, %tmp8
%tmp10 = load double* @nrm, align 8
%tmp11 = fadd double %tmp10, %tmp9
store double %tmp11, double* @nrm, align 8
br label %bb12
bb12: ; preds = %bb5
%tmp14 = add nsw i64 %i.0, 1
br label %bb4
bb15: ; preds = %bb4
%tmp16 = load double* @nrm, align 8
%tmp17 = call double @sqrt(double %tmp16)
store double %tmp17, double* %scevgep50
br label %bb18
bb18: ; preds = %bb25, %bb15
%i.1 = phi i64 [ 0, %bb15 ], [ %tmp26, %bb25 ]
%scevgep5 = getelementptr [512 x [512 x double]]* @A, i64 0, i64 %i.1, i64 %tmp2
%scevgep4 = getelementptr [512 x [512 x double]]* @Q, i64 0, i64 %i.1, i64 %tmp2
%exitcond = icmp ne i64 %i.1, %smax
br i1 %exitcond, label %bb19, label %bb27
bb19: ; preds = %bb18
%tmp21 = load double* %scevgep5
%tmp23 = load double* %scevgep50
%tmp24 = fdiv double %tmp21, %tmp23
store double %tmp24, double* %scevgep4
br label %bb25
bb25: ; preds = %bb19
%tmp26 = add nsw i64 %i.1, 1
br label %bb18
bb27: ; preds = %bb18
br label %bb28
bb28: ; preds = %bb56, %bb27
%indvar = phi i64 [ %indvar.next, %bb56 ], [ 0, %bb27 ]
%tmp65 = add i64 %tmp64, %indvar
%scevgep31 = getelementptr [512 x [512 x double]]* @R, i64 0, i64 0, i64 %tmp65
%tmp68 = add i64 %tmp67, %indvar
%exitcond46 = icmp ne i64 %indvar, %tmp45
br i1 %exitcond46, label %bb29, label %bb57
bb29: ; preds = %bb28
store double 0.000000e+00, double* %scevgep31
br label %bb30
bb30: ; preds = %bb43, %bb29
%i.2 = phi i64 [ 0, %bb29 ], [ %tmp44, %bb43 ]
%scevgep11 = getelementptr [512 x [512 x double]]* @A, i64 0, i64 %i.2, i64 %tmp68
%scevgep12 = getelementptr [512 x [512 x double]]* @Q, i64 0, i64 %i.2, i64 %tmp2
%exitcond14 = icmp ne i64 %i.2, %smax13
br i1 %exitcond14, label %bb31, label %bb45
bb31: ; preds = %bb30
%tmp33 = load double* %scevgep12
%tmp34 = load double* %scevgep11
%tmp38 = fmul double %tmp33, %tmp34
%tmp41 = load double* %scevgep31
%tmp42 = fadd double %tmp41, %tmp38
store double %tmp42, double* %scevgep31
br label %bb43
bb43: ; preds = %bb31
%tmp44 = add nsw i64 %i.2, 1
br label %bb30
bb45: ; preds = %bb30
br label %bb46
bb46: ; preds = %bb53, %bb45
%i.3 = phi i64 [ 0, %bb45 ], [ %tmp54, %bb53 ]
%scevgep18 = getelementptr [512 x [512 x double]]* @A, i64 0, i64 %i.3, i64 %tmp68
%scevgep19 = getelementptr [512 x [512 x double]]* @Q, i64 0, i64 %i.3, i64 %tmp2
%exitcond27 = icmp ne i64 %i.3, %smax26
br i1 %exitcond27, label %bb47, label %bb55
bb47: ; preds = %bb46
%tmp48 = load double* %scevgep18
%tmp49 = load double* %scevgep19
%tmp50 = load double* %scevgep31
%tmp51 = fmul double %tmp49, %tmp50
%tmp52 = fsub double %tmp48, %tmp51
store double %tmp52, double* %scevgep18
br label %bb53
bb53: ; preds = %bb47
%tmp54 = add nsw i64 %i.3, 1
br label %bb46
bb55: ; preds = %bb46
br label %bb56
bb56: ; preds = %bb55
%indvar.next = add i64 %indvar, 1
br label %bb28
bb57: ; preds = %bb28
br label %bb58
bb58: ; preds = %bb57
%tmp59 = add nsw i64 %tmp2, 1
br label %bb1
bb60: ; preds = %bb1
ret void
}
declare double @sqrt(double) nounwind readnone
define i32 @main(i32 %argc, i8** %argv) nounwind {
bb:
call void (...)* @init_array()
%tmp = sext i32 512 to i64
%tmp1 = sext i32 512 to i64
call void @scop_func(i64 %tmp, i64 %tmp1)
call void @print_array(i32 %argc, i8** %argv)
ret i32 0
}
declare void @init_array(...)
declare void @print_array(i32, i8**)

View File

@ -1,161 +0,0 @@
; RUN: opt %loadPolly %defaultOpts -polly-prepare -polly-ast -analyze %s | FileCheck %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"
@nrm = common global double 0.000000e+00, align 8
@A = common global [512 x [512 x double]] zeroinitializer, align 16
@R = common global [512 x [512 x double]] zeroinitializer, align 16
@Q = common global [512 x [512 x double]] zeroinitializer, align 16
define void @scop_func() nounwind {
bb:
br label %bb1
bb1: ; preds = %bb51, %bb
%tmp2 = phi i64 [ 0, %bb ], [ %tmp52, %bb51 ]
%tmp49 = mul i64 %tmp2, 513
%tmp50 = add i64 %tmp49, 1
%tmp53 = add i64 %tmp2, 1
%tmp57 = mul i64 %tmp2, -1
%tmp28 = add i64 %tmp57, 511
%scevgep39 = getelementptr [512 x [512 x double]]* @R, i64 0, i64 0, i64 %tmp49
%exitcond48 = icmp ne i64 %tmp2, 512
br i1 %exitcond48, label %bb3, label %bb53
bb3: ; preds = %bb1
store double 0.000000e+00, double* @nrm, align 8
br label %bb4
bb4: ; preds = %bb11, %bb3
%i.0 = phi i64 [ 0, %bb3 ], [ %tmp12, %bb11 ]
%scevgep = getelementptr [512 x [512 x double]]* @A, i64 0, i64 %i.0, i64 %tmp2
%exitcond2 = icmp ne i64 %i.0, 512
br i1 %exitcond2, label %bb5, label %bb13
bb5: ; preds = %bb4
%tmp6 = load double* %scevgep
%tmp7 = load double* %scevgep
%tmp8 = fmul double %tmp6, %tmp7
%tmp9 = load double* @nrm, align 8
%tmp10 = fadd double %tmp9, %tmp8
store double %tmp10, double* @nrm, align 8
br label %bb11
bb11: ; preds = %bb5
%tmp12 = add nsw i64 %i.0, 1
br label %bb4
bb13: ; preds = %bb4
%tmp15 = load double* @nrm, align 8
%tmp16 = call double @sqrt(double %tmp15)
store double %tmp16, double* %scevgep39
br label %bb17
bb17: ; preds = %bb22, %bb13
%i.1 = phi i64 [ 0, %bb13 ], [ %tmp23, %bb22 ]
%scevgep3 = getelementptr [512 x [512 x double]]* @A, i64 0, i64 %i.1, i64 %tmp2
%scevgep2 = getelementptr [512 x [512 x double]]* @Q, i64 0, i64 %i.1, i64 %tmp2
%exitcond = icmp ne i64 %i.1, 512
br i1 %exitcond, label %bb18, label %bb24
bb18: ; preds = %bb17
%tmp19 = load double* %scevgep3
%tmp20 = load double* %scevgep39
%tmp21 = fdiv double %tmp19, %tmp20
store double %tmp21, double* %scevgep2
br label %bb22
bb22: ; preds = %bb18
%tmp23 = add nsw i64 %i.1, 1
br label %bb17
bb24: ; preds = %bb17
br label %bb25
bb25: ; preds = %bb49, %bb24
%indvar = phi i64 [ %indvar.next, %bb49 ], [ 0, %bb24 ]
%tmp51 = add i64 %tmp50, %indvar
%scevgep23 = getelementptr [512 x [512 x double]]* @R, i64 0, i64 0, i64 %tmp51
%tmp54 = add i64 %tmp53, %indvar
%exitcond29 = icmp ne i64 %indvar, %tmp28
br i1 %exitcond29, label %bb26, label %bb50
bb26: ; preds = %bb25
store double 0.000000e+00, double* %scevgep23
br label %bb27
bb27: ; preds = %bb36, %bb26
%i.2 = phi i64 [ 0, %bb26 ], [ %tmp37, %bb36 ]
%scevgep6 = getelementptr [512 x [512 x double]]* @A, i64 0, i64 %i.2, i64 %tmp54
%scevgep7 = getelementptr [512 x [512 x double]]* @Q, i64 0, i64 %i.2, i64 %tmp2
%exitcond9 = icmp ne i64 %i.2, 512
br i1 %exitcond9, label %bb28, label %bb38
bb28: ; preds = %bb27
%tmp30 = load double* %scevgep7
%tmp31 = load double* %scevgep6
%tmp33 = fmul double %tmp30, %tmp31
%tmp34 = load double* %scevgep23
%tmp35 = fadd double %tmp34, %tmp33
store double %tmp35, double* %scevgep23
br label %bb36
bb36: ; preds = %bb28
%tmp37 = add nsw i64 %i.2, 1
br label %bb27
bb38: ; preds = %bb27
br label %bb39
bb39: ; preds = %bb46, %bb38
%i.3 = phi i64 [ 0, %bb38 ], [ %tmp47, %bb46 ]
%scevgep11 = getelementptr [512 x [512 x double]]* @A, i64 0, i64 %i.3, i64 %tmp54
%scevgep12 = getelementptr [512 x [512 x double]]* @Q, i64 0, i64 %i.3, i64 %tmp2
%exitcond16 = icmp ne i64 %i.3, 512
br i1 %exitcond16, label %bb40, label %bb48
bb40: ; preds = %bb39
%tmp41 = load double* %scevgep11
%tmp42 = load double* %scevgep12
%tmp43 = load double* %scevgep23
%tmp44 = fmul double %tmp42, %tmp43
%tmp45 = fsub double %tmp41, %tmp44
store double %tmp45, double* %scevgep11
br label %bb46
bb46: ; preds = %bb40
%tmp47 = add nsw i64 %i.3, 1
br label %bb39
bb48: ; preds = %bb39
br label %bb49
bb49: ; preds = %bb48
%indvar.next = add i64 %indvar, 1
br label %bb25
bb50: ; preds = %bb25
br label %bb51
bb51: ; preds = %bb50
%tmp52 = add nsw i64 %tmp2, 1
br label %bb1
bb53: ; preds = %bb1
ret void
}
declare double @sqrt(double) nounwind readnone
define i32 @main(i32 %argc, i8** %argv) nounwind {
bb:
call void (...)* @init_array()
call void @scop_func()
call void @print_array(i32 %argc, i8** %argv)
ret i32 0
}
declare void @init_array(...)
declare void @print_array(i32, i8**)
; CHECK: for region: 'bb1 => bb53' in function 'scop_func':

View File

@ -1,110 +0,0 @@
#include <stdio.h>
#include <unistd.h>
#include <string.h>
#include <math.h>
#include "instrument.h"
/* Default problem size. */
#ifndef N
# define N 1024
#endif
/* Default data type is double. */
#ifndef DATA_TYPE
# define DATA_TYPE double
#endif
#ifndef DATA_PRINTF_MODIFIER
# define DATA_PRINTF_MODIFIER "%0.2lf "
#endif
/* Array declaration. Enable malloc if POLYBENCH_TEST_MALLOC. */
#ifndef POLYBENCH_TEST_MALLOC
DATA_TYPE A[N][N];
#else
DATA_TYPE** A = (DATA_TYPE**)malloc(N * sizeof(DATA_TYPE*));
{
int i;
for (i = 0; i < M; ++i)
A[i] = (DATA_TYPE*)malloc(N * sizeof(DATA_TYPE));
}
#endif
inline
void init_array()
{
int i, j;
for (i = 0; i < N; i++)
for (j = 0; j < N; j++)
A[i][j] = ((DATA_TYPE) i*j + 1) / N;
}
/* Define the live-out variables. Code is not executed unless
POLYBENCH_DUMP_ARRAYS is defined. */
inline
void print_array(int argc, char** argv)
{
int i, j;
#ifndef POLYBENCH_DUMP_ARRAYS
if (argc > 42 && ! strcmp(argv[0], ""))
#endif
{
for (i = 0; i < N; i++)
for (j = 0; j < N; j++) {
fprintf(stderr, DATA_PRINTF_MODIFIER, A[i][j]);
if ((i * N + j) % 80 == 20) fprintf(stderr, "\n");
}
fprintf(stderr, "\n");
}
}
#ifndef SCOP_PARAM
void scop_func() {
long n = N;
#else
void scop_func(long n) {
#endif
long i, j, k;
#pragma scop
#pragma live-out A
for (k = 0; k < n; k++)
{
for (j = k + 1; j < n; j++)
A[k][j] = A[k][j] / A[k][k];
for(i = k + 1; i < n; i++)
for (j = k + 1; j < n; j++)
A[i][j] = A[i][j] - A[i][k] * A[k][j];
}
#pragma endscop
}
int main(int argc, char** argv)
{
int i, j, k;
int n = N;
/* Initialize array. */
init_array();
/* Start timer. */
polybench_start_instruments;
#ifndef SCOP_PARAM
scop_func();
#else
scop_func(n);
#endif
/* Stop and print timer. */
polybench_stop_instruments;
polybench_print_instruments;
print_array(argc, argv);
return 0;
}

View File

@ -1,94 +0,0 @@
; RUN: opt %loadPolly %defaultOpts -polly-detect -polly-codegen-scev -analyze %s | FileCheck %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"
%struct._IO_FILE = type { i32, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, %struct._IO_marker*, %struct._IO_FILE*, i32, i32, i64, i16, i8, [1 x i8], i8*, i64, i8*, i8*, i8*, i8*, i64, i32, [20 x i8] }
%struct._IO_marker = type { %struct._IO_marker*, %struct._IO_FILE*, i32 }
@A = common global [1024 x [1024 x double]] zeroinitializer, align 32
@stderr = external global %struct._IO_FILE*
@.str = private constant [8 x i8] c"%0.2lf \00", align 1
define void @scop_func(i64 %n) nounwind {
entry:
%0 = icmp sgt i64 %n, 0
br i1 %0, label %bb.nph28, label %return
bb1: ; preds = %bb1.preheader, %bb1
%indvar = phi i64 [ %indvar.next, %bb1 ], [ 0, %bb1.preheader ]
%tmp27 = add i64 %tmp26, %indvar
%scevgep = getelementptr [1024 x [1024 x double]]* @A, i64 0, i64 0, i64 %tmp27
%1 = load double* %scevgep, align 8
%2 = load double* %scevgep69, align 8
%3 = fdiv double %1, %2
store double %3, double* %scevgep, align 8
%indvar.next = add i64 %indvar, 1
%exitcond20 = icmp eq i64 %indvar.next, %tmp1
br i1 %exitcond20, label %bb8.loopexit, label %bb1
bb5: ; preds = %bb6.preheader, %bb5
%indvar34 = phi i64 [ %indvar.next35, %bb5 ], [ 0, %bb6.preheader ]
%tmp34 = add i64 %tmp26, %indvar34
%scevgep45 = getelementptr [1024 x [1024 x double]]* @A, i64 0, i64 %tmp32, i64 %tmp34
%scevgep46 = getelementptr [1024 x [1024 x double]]* @A, i64 0, i64 0, i64 %tmp34
%4 = load double* %scevgep45, align 8
%5 = load double* %scevgep55, align 8
%6 = load double* %scevgep46, align 8
%7 = fmul double %5, %6
%8 = fsub double %4, %7
store double %8, double* %scevgep45, align 8
%indvar.next35 = add i64 %indvar34, 1
%exitcond2 = icmp eq i64 %indvar.next35, %tmp1
br i1 %exitcond2, label %bb8.loopexit4, label %bb5
bb8.loopexit: ; preds = %bb1
br i1 %10, label %bb6.preheader.preheader, label %bb9
bb6.preheader.preheader: ; preds = %bb8.loopexit
br label %bb6.preheader
bb8.loopexit4: ; preds = %bb5
%exitcond11 = icmp eq i64 %tmp57, %tmp1
br i1 %exitcond11, label %bb9.loopexit, label %bb6.preheader
bb6.preheader: ; preds = %bb6.preheader.preheader, %bb8.loopexit4
%indvar39 = phi i64 [ %tmp57, %bb8.loopexit4 ], [ 0, %bb6.preheader.preheader ]
%tmp32 = add i64 %indvar39, 1
%scevgep55 = getelementptr [1024 x [1024 x double]]* @A, i64 0, i64 %tmp32, i64 %tmp25
%tmp57 = add i64 %indvar39, 1
br label %bb5
bb9.loopexit: ; preds = %bb8.loopexit4
br label %bb9
bb9: ; preds = %bb9.loopexit, %bb2.preheader, %bb8.loopexit
%exitcond = icmp eq i64 %9, %n
br i1 %exitcond, label %return.loopexit, label %bb2.preheader
bb.nph28: ; preds = %entry
%tmp29 = add i64 %n, -1
br label %bb2.preheader
bb2.preheader: ; preds = %bb.nph28, %bb9
%storemerge17 = phi i64 [ 0, %bb.nph28 ], [ %9, %bb9 ]
%tmp25 = mul i64 %storemerge17, 1025
%tmp26 = add i64 %tmp25, 1
%tmp30 = mul i64 %storemerge17, -1
%tmp1 = add i64 %tmp29, %tmp30
%storemerge15 = add i64 %storemerge17, 1
%scevgep69 = getelementptr [1024 x [1024 x double]]* @A, i64 0, i64 0, i64 %tmp25
%9 = add i64 %storemerge17, 1
%10 = icmp slt i64 %storemerge15, %n
br i1 %10, label %bb1.preheader, label %bb9
bb1.preheader: ; preds = %bb2.preheader
br label %bb1
return.loopexit: ; preds = %bb9
br label %return
return: ; preds = %return.loopexit, %entry
ret void
}
; CHECK: Valid Region for Scop: entry.split => return

View File

@ -1,86 +0,0 @@
; RUN: opt %loadPolly %defaultOpts -polly-detect -analyze %s | FileCheck %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"
%struct._IO_FILE = type { i32, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, %struct._IO_marker*, %struct._IO_FILE*, i32, i32, i64, i16, i8, [1 x i8], i8*, i64, i8*, i8*, i8*, i8*, i64, i32, [20 x i8] }
%struct._IO_marker = type { %struct._IO_marker*, %struct._IO_FILE*, i32 }
@A = common global [1024 x [1024 x double]] zeroinitializer, align 32
@stderr = external global %struct._IO_FILE*
@.str = private constant [8 x i8] c"%0.2lf \00", align 1
define void @scop_func() nounwind {
bb.nph28:
br label %bb2.preheader
bb1: ; preds = %bb1.preheader, %bb1
%indvar = phi i64 [ %indvar.next, %bb1 ], [ 0, %bb1.preheader ]
%tmp27 = add i64 %tmp26, %indvar
%scevgep = getelementptr [1024 x [1024 x double]]* @A, i64 0, i64 0, i64 %tmp27
%0 = load double* %scevgep, align 8
%1 = load double* %scevgep68, align 8
%2 = fdiv double %0, %1
store double %2, double* %scevgep, align 8
%indvar.next = add i64 %indvar, 1
%exitcond20 = icmp eq i64 %indvar.next, %tmp1
br i1 %exitcond20, label %bb8.loopexit, label %bb1
bb5: ; preds = %bb6.preheader, %bb5
%indvar33 = phi i64 [ %indvar.next34, %bb5 ], [ 0, %bb6.preheader ]
%tmp33 = add i64 %tmp26, %indvar33
%scevgep44 = getelementptr [1024 x [1024 x double]]* @A, i64 0, i64 %tmp31, i64 %tmp33
%scevgep45 = getelementptr [1024 x [1024 x double]]* @A, i64 0, i64 0, i64 %tmp33
%3 = load double* %scevgep44, align 8
%4 = load double* %scevgep54, align 8
%5 = load double* %scevgep45, align 8
%6 = fmul double %4, %5
%7 = fsub double %3, %6
store double %7, double* %scevgep44, align 8
%indvar.next34 = add i64 %indvar33, 1
%exitcond2 = icmp eq i64 %indvar.next34, %tmp1
br i1 %exitcond2, label %bb8.loopexit4, label %bb5
bb8.loopexit: ; preds = %bb1
br i1 %9, label %bb6.preheader.preheader, label %bb9
bb6.preheader.preheader: ; preds = %bb8.loopexit
br label %bb6.preheader
bb8.loopexit4: ; preds = %bb5
%exitcond11 = icmp eq i64 %tmp56, %tmp1
br i1 %exitcond11, label %bb9.loopexit, label %bb6.preheader
bb6.preheader: ; preds = %bb6.preheader.preheader, %bb8.loopexit4
%indvar38 = phi i64 [ %tmp56, %bb8.loopexit4 ], [ 0, %bb6.preheader.preheader ]
%tmp31 = add i64 %indvar38, 1
%scevgep54 = getelementptr [1024 x [1024 x double]]* @A, i64 0, i64 %tmp31, i64 %tmp25
%tmp56 = add i64 %indvar38, 1
br label %bb5
bb9.loopexit: ; preds = %bb8.loopexit4
br label %bb9
bb9: ; preds = %bb9.loopexit, %bb2.preheader, %bb8.loopexit
%exitcond = icmp eq i64 %8, 1024
br i1 %exitcond, label %return, label %bb2.preheader
bb2.preheader: ; preds = %bb9, %bb.nph28
%storemerge17 = phi i64 [ 0, %bb.nph28 ], [ %8, %bb9 ]
%tmp25 = mul i64 %storemerge17, 1025
%tmp26 = add i64 %tmp25, 1
%tmp29 = mul i64 %storemerge17, -1
%tmp1 = add i64 %tmp29, 1023
%storemerge15 = add i64 %storemerge17, 1
%scevgep68 = getelementptr [1024 x [1024 x double]]* @A, i64 0, i64 0, i64 %tmp25
%8 = add i64 %storemerge17, 1
%9 = icmp slt i64 %storemerge15, 1024
br i1 %9, label %bb1.preheader, label %bb9
bb1.preheader: ; preds = %bb2.preheader
br label %bb1
return: ; preds = %bb9
ret void
}
; CHECK: Valid Region for Scop: bb2.preheader => return

View File

@ -1,145 +0,0 @@
#include <stdio.h>
#include <unistd.h>
#include <string.h>
#include <math.h>
#include "instrument.h"
/* Default problem size. */
#ifndef N
# define N 1024
#endif
/* Default data type is double. */
#ifndef DATA_TYPE
# define DATA_TYPE double
#endif
#ifndef DATA_PRINTF_MODIFIER
# define DATA_PRINTF_MODIFIER "%0.2lf "
#endif
/* Array declaration. Enable malloc if POLYBENCH_TEST_MALLOC. */
DATA_TYPE w;
#ifndef POLYBENCH_TEST_MALLOC
DATA_TYPE a[N+1][N+1];
DATA_TYPE x[N+1];
DATA_TYPE y[N+1];
DATA_TYPE b[N+1];
#else
DATA_TYPE** a = (DATA_TYPE**)malloc((N + 1) * sizeof(DATA_TYPE*));
DATA_TYPE* x = (DATA_TYPE*)malloc((N + 1) * sizeof(DATA_TYPE));
DATA_TYPE* y = (DATA_TYPE*)malloc((N + 1) * sizeof(DATA_TYPE));
DATA_TYPE* b = (DATA_TYPE*)malloc((N + 1) * sizeof(DATA_TYPE));
{
int i;
for (i = 0; i <= N; ++i)
a[i] = (DATA_TYPE*)malloc((N + 1) * sizeof(DATA_TYPE));
}
#endif
inline
void init_array()
{
int i, j;
for (i = 0; i <= N; i++)
{
x[i] = ((DATA_TYPE) i + 1) / N;
b[i] = ((DATA_TYPE) i + 2) / N;
for (j = 0; j <= N; j++)
a[i][j] = ((DATA_TYPE) i*j + 1) / N;
}
}
/* Define the live-out variables. Code is not executed unless
POLYBENCH_DUMP_ARRAYS is defined. */
inline
void print_array(int argc, char** argv)
{
int i, j;
#ifndef POLYBENCH_DUMP_ARRAYS
if (argc > 42 && ! strcmp(argv[0], ""))
#endif
{
for (i = 0; i <= N; i++) {
fprintf(stderr, DATA_PRINTF_MODIFIER, x[i]);
if (i % 80 == 20) fprintf(stderr, "\n");
}
fprintf(stderr, "\n");
}
}
#ifndef SCOP_PARAM
void scop_func() {
long n = N;
#else
void scop_func(long n) {
#endif
long i, j, k;
#pragma scop
#pragma live-out x
b[0] = 1.0;
for (i = 0; i < n; i++)
{
for (j = i+1; j <= n; j++)
{
w = a[j][i];
for (k = 0; k < i; k++)
w = w- a[j][k] * a[k][i];
a[j][i] = w / a[i][i];
}
for (j = i+1; j <= n; j++)
{
w = a[i+1][j];
for (k = 0; k <= i; k++)
w = w - a[i+1][k] * a[k][j];
a[i+1][j] = w;
}
}
y[0] = b[0];
for (i = 1; i <= n; i++)
{
w = b[i];
for (j = 0; j < i; j++)
w = w - a[i][j] * y[j];
y[i] = w;
}
x[n] = y[n] / a[n][n];
for (i = 0; i <= n - 1; i++)
{
w = y[n - 1 - (i)];
for (j = n - i; j <= n; j++)
w = w - a[n - 1 - i][j] * x[j];
x[n - 1 - i] = w / a[n - 1 - (i)][n - 1-(i)];
}
#pragma endscop
}
int main(int argc, char** argv)
{
int i, j, k;
int n = N;
/* Initialize array. */
init_array();
/* Start timer. */
polybench_start_instruments;
#ifndef SCOP_PARAM
scop_func();
#else
scop_func(n);
#endif
/* Stop and print timer. */
polybench_stop_instruments;
polybench_print_instruments;
print_array(argc, argv);
return 0;
}

View File

@ -1,300 +0,0 @@
; RUN: opt %loadPolly %defaultOpts -polly-analyze-ir -print-top-scop-only -analyze %s | FileCheck %s
; XFAIL: *
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"
%struct._IO_FILE = type { i32, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, %struct._IO_marker*, %struct._IO_FILE*, i32, i32, i64, i16, i8, [1 x i8], i8*, i64, i8*, i8*, i8*, i8*, i64, i32, [20 x i8] }
%struct._IO_marker = type { %struct._IO_marker*, %struct._IO_FILE*, i32 }
@x = common global [1025 x double] zeroinitializer, align 32
@b = common global [1025 x double] zeroinitializer, align 32
@a = common global [1025 x [1025 x double]] zeroinitializer, align 32
@stderr = external global %struct._IO_FILE*
@.str = private constant [8 x i8] c"%0.2lf \00", align 1
@w = common global double 0.000000e+00
@y = common global [1025 x double] zeroinitializer, align 32
define void @scop_func(i64 %n) nounwind {
entry:
store double 1.000000e+00, double* getelementptr inbounds ([1025 x double]* @b, i64 0, i64 0), align 32
%0 = icmp sgt i64 %n, 0
br i1 %0, label %bb.nph81, label %bb14
bb.nph43: ; preds = %bb5.preheader
%1 = icmp sgt i64 %storemerge60, 0
br i1 %1, label %bb.nph43.split.us, label %bb4.preheader
bb4.preheader: ; preds = %bb.nph43
br label %bb4
bb.nph43.split.us: ; preds = %bb.nph43
br label %bb.nph35.us
bb4.us: ; preds = %bb2.us
%.lcssa63 = phi double [ %9, %bb2.us ]
%2 = load double* %scevgep110, align 8
%3 = fdiv double %.lcssa63, %2
store double %3, double* %scevgep148, align 8
%4 = icmp sgt i64 %storemerge5.us, %n
br i1 %4, label %bb11.loopexit.loopexit1, label %bb.nph35.us
bb2.us: ; preds = %bb.nph35.us, %bb2.us
%5 = phi double [ %11, %bb.nph35.us ], [ %9, %bb2.us ]
%storemerge834.us = phi i64 [ 0, %bb.nph35.us ], [ %10, %bb2.us ]
%scevgep141 = getelementptr [1025 x [1025 x double]]* @a, i64 0, i64 %tmp96, i64 %storemerge834.us
%scevgep136 = getelementptr [1025 x [1025 x double]]* @a, i64 0, i64 %storemerge834.us, i64 %storemerge60
%6 = load double* %scevgep141, align 8
%7 = load double* %scevgep136, align 8
%8 = fmul double %6, %7
%9 = fsub double %5, %8
%10 = add nsw i64 %storemerge834.us, 1
%exitcond64 = icmp eq i64 %10, %storemerge60
br i1 %exitcond64, label %bb4.us, label %bb2.us
bb.nph35.us: ; preds = %bb4.us, %bb.nph43.split.us
%indvar137 = phi i64 [ %tmp146, %bb4.us ], [ 0, %bb.nph43.split.us ]
%storemerge5.us = add i64 %tmp, %indvar137
%tmp93 = add i64 %indvar137, 1
%scevgep148 = getelementptr [1025 x [1025 x double]]* @a, i64 0, i64 %tmp93, i64 %tmp87
%tmp96 = add i64 %storemerge538, %indvar137
%tmp146 = add i64 %indvar137, 1
%11 = load double* %scevgep148, align 8
br label %bb2.us
bb4: ; preds = %bb4.preheader, %bb4
%indvar152 = phi i64 [ %indvar.next153, %bb4 ], [ 0, %bb4.preheader ]
%tmp99 = add i64 %indvar152, 1
%scevgep157 = getelementptr [1025 x [1025 x double]]* @a, i64 0, i64 %tmp99, i64 %tmp87
%storemerge5 = add i64 %tmp, %indvar152
%12 = load double* %scevgep157, align 8
%13 = load double* %scevgep110, align 8
%14 = fdiv double %12, %13
store double %14, double* %scevgep157, align 8
%15 = icmp sgt i64 %storemerge5, %n
%indvar.next153 = add i64 %indvar152, 1
br i1 %15, label %bb11.loopexit.loopexit, label %bb4
bb.nph56: ; preds = %bb11.loopexit
br i1 false, label %bb10.us.preheader, label %bb.nph47.preheader
bb10.us.preheader: ; preds = %bb.nph56
br label %bb10.us
bb.nph47.preheader: ; preds = %bb.nph56
br label %bb.nph47
bb10.us: ; preds = %bb10.us.preheader, %bb10.us
%indvar122 = phi i64 [ %indvar.next123, %bb10.us ], [ 0, %bb10.us.preheader ]
%storemerge6.us = add i64 %tmp, %indvar122
%tmp89 = add i64 %tmp88, %indvar122
%scevgep128 = getelementptr [1025 x [1025 x double]]* @a, i64 0, i64 1, i64 %tmp89
%16 = load double* %scevgep128, align 8
store double %16, double* %scevgep128, align 8
%17 = icmp sgt i64 %storemerge6.us, %n
%indvar.next123 = add i64 %indvar122, 1
br i1 %17, label %bb13.loopexit.loopexit2, label %bb10.us
bb.nph47: ; preds = %bb.nph47.preheader, %bb10
%indvar162 = phi i64 [ %indvar.next163, %bb10 ], [ 0, %bb.nph47.preheader ]
%storemerge6 = add i64 %tmp, %indvar162
%tmp104 = add i64 %tmp88, %indvar162
%scevgep180 = getelementptr [1025 x [1025 x double]]* @a, i64 0, i64 1, i64 %tmp104
%tmp107 = add i64 %storemerge538, %indvar162
%18 = load double* %scevgep180, align 8
br label %bb8
bb8: ; preds = %bb8, %bb.nph47
%w.tmp.048 = phi double [ %18, %bb.nph47 ], [ %22, %bb8 ]
%storemerge746 = phi i64 [ 0, %bb.nph47 ], [ %23, %bb8 ]
%scevgep166 = getelementptr [1025 x [1025 x double]]* @a, i64 0, i64 %storemerge746, i64 %tmp107
%scevgep167 = getelementptr [1025 x [1025 x double]]* @a, i64 0, i64 %storemerge538, i64 %storemerge746
%19 = load double* %scevgep167, align 8
%20 = load double* %scevgep166, align 8
%21 = fmul double %19, %20
%22 = fsub double %w.tmp.048, %21
%23 = add nsw i64 %storemerge746, 1
%exitcond = icmp eq i64 %23, %smax
br i1 %exitcond, label %bb10, label %bb8
bb10: ; preds = %bb8
%.lcssa40 = phi double [ %22, %bb8 ]
store double %.lcssa40, double* %scevgep180, align 8
%24 = icmp sgt i64 %storemerge6, %n
%indvar.next163 = add i64 %indvar162, 1
br i1 %24, label %bb13.loopexit.loopexit, label %bb.nph47
bb11.loopexit.loopexit: ; preds = %bb4
%.lcssa57 = phi double [ %12, %bb4 ]
br label %bb11.loopexit
bb11.loopexit.loopexit1: ; preds = %bb4.us
%.lcssa63.lcssa = phi double [ %.lcssa63, %bb4.us ]
br label %bb11.loopexit
bb11.loopexit: ; preds = %bb11.loopexit.loopexit1, %bb11.loopexit.loopexit, %bb5.preheader
%w.tmp.082 = phi double [ %w.tmp.1, %bb5.preheader ], [ %.lcssa57, %bb11.loopexit.loopexit ], [ %.lcssa63.lcssa, %bb11.loopexit.loopexit1 ]
%25 = icmp sgt i64 %storemerge538, %n
br i1 %25, label %bb13.loopexit, label %bb.nph56
bb13.loopexit.loopexit: ; preds = %bb10
%.lcssa40.lcssa = phi double [ %.lcssa40, %bb10 ]
br label %bb13.loopexit
bb13.loopexit.loopexit2: ; preds = %bb10.us
%.lcssa77 = phi double [ %16, %bb10.us ]
br label %bb13.loopexit
bb13.loopexit: ; preds = %bb13.loopexit.loopexit2, %bb13.loopexit.loopexit, %bb11.loopexit
%w.tmp.2 = phi double [ %w.tmp.082, %bb11.loopexit ], [ %.lcssa40.lcssa, %bb13.loopexit.loopexit ], [ %.lcssa77, %bb13.loopexit.loopexit2 ]
%indvar.next42 = add i64 %storemerge60, 1
%exitcond84 = icmp ne i64 %indvar.next42, %n
br i1 %exitcond84, label %bb5.preheader, label %bb13.bb14_crit_edge
bb13.bb14_crit_edge: ; preds = %bb13.loopexit
%w.tmp.2.lcssa = phi double [ %w.tmp.2, %bb13.loopexit ]
store double %w.tmp.2.lcssa, double* @w
br label %bb14
bb.nph81: ; preds = %entry
%w.promoted = load double* @w
br label %bb5.preheader
bb5.preheader: ; preds = %bb.nph81, %bb13.loopexit
%storemerge60 = phi i64 [ 0, %bb.nph81 ], [ %indvar.next42, %bb13.loopexit ]
%w.tmp.1 = phi double [ %w.promoted, %bb.nph81 ], [ %w.tmp.2, %bb13.loopexit ]
%tmp = add i64 %storemerge60, 2
%tmp87 = mul i64 %storemerge60, 1026
%tmp88 = add i64 %tmp87, 1
%storemerge538 = add i64 %storemerge60, 1
%scevgep110 = getelementptr [1025 x [1025 x double]]* @a, i64 0, i64 0, i64 %tmp87
%tmp44 = icmp sgt i64 %storemerge538, 1
%smax = select i1 %tmp44, i64 %storemerge538, i64 1
%26 = icmp sgt i64 %storemerge538, %n
br i1 %26, label %bb11.loopexit, label %bb.nph43
bb14: ; preds = %bb13.bb14_crit_edge, %entry
store double 1.000000e+00, double* getelementptr inbounds ([1025 x double]* @y, i64 0, i64 0), align 32
%27 = icmp slt i64 %n, 1
br i1 %27, label %bb20, label %bb15.preheader
bb15.preheader: ; preds = %bb14
br label %bb15
bb15: ; preds = %bb15.preheader, %bb18
%indvar111 = phi i64 [ %28, %bb18 ], [ 0, %bb15.preheader ]
%storemerge126 = add i64 %indvar111, 1
%tmp117 = add i64 %indvar111, 2
%scevgep119 = getelementptr [1025 x double]* @b, i64 0, i64 %storemerge126
%scevgep118 = getelementptr [1025 x double]* @y, i64 0, i64 %storemerge126
%28 = add i64 %indvar111, 1
%29 = load double* %scevgep119, align 8
%30 = icmp sgt i64 %storemerge126, 0
br i1 %30, label %bb16.preheader, label %bb18
bb16.preheader: ; preds = %bb15
br label %bb16
bb16: ; preds = %bb16.preheader, %bb16
%31 = phi double [ %35, %bb16 ], [ %29, %bb16.preheader ]
%storemerge423 = phi i64 [ %36, %bb16 ], [ 0, %bb16.preheader ]
%scevgep114 = getelementptr [1025 x [1025 x double]]* @a, i64 0, i64 %storemerge126, i64 %storemerge423
%scevgep113 = getelementptr [1025 x double]* @y, i64 0, i64 %storemerge423
%32 = load double* %scevgep114, align 8
%33 = load double* %scevgep113, align 8
%34 = fmul double %32, %33
%35 = fsub double %31, %34
%36 = add nsw i64 %storemerge423, 1
%exitcond4 = icmp eq i64 %36, %storemerge126
br i1 %exitcond4, label %bb18.loopexit, label %bb16
bb18.loopexit: ; preds = %bb16
%.lcssa = phi double [ %35, %bb16 ]
br label %bb18
bb18: ; preds = %bb18.loopexit, %bb15
%w.tmp.032 = phi double [ %29, %bb15 ], [ %.lcssa, %bb18.loopexit ]
store double %w.tmp.032, double* %scevgep118, align 8
%37 = icmp sgt i64 %tmp117, %n
br i1 %37, label %bb19.bb20_crit_edge, label %bb15
bb19.bb20_crit_edge: ; preds = %bb18
%w.tmp.032.lcssa = phi double [ %w.tmp.032, %bb18 ]
store double %w.tmp.032.lcssa, double* @w
br label %bb20
bb20: ; preds = %bb19.bb20_crit_edge, %bb14
%38 = getelementptr inbounds [1025 x double]* @y, i64 0, i64 %n
%39 = load double* %38, align 8
%40 = getelementptr inbounds [1025 x [1025 x double]]* @a, i64 0, i64 %n, i64 %n
%41 = load double* %40, align 8
%42 = fdiv double %39, %41
%43 = getelementptr inbounds [1025 x double]* @x, i64 0, i64 %n
store double %42, double* %43, align 8
%44 = add nsw i64 %n, -1
%45 = icmp slt i64 %44, 0
br i1 %45, label %return, label %bb.nph19
bb.nph19: ; preds = %bb20
%tmp86 = mul i64 %n, 1026
%tmp90 = add i64 %n, 1
%tmp94 = add i64 %tmp86, -1
%tmp34 = add i64 %n, -1
br label %bb21
bb21: ; preds = %bb24, %bb.nph19
%storemerge211 = phi i64 [ 0, %bb.nph19 ], [ %46, %bb24 ]
%tmp23 = mul i64 %storemerge211, -1026
%tmp24 = add i64 %tmp86, %tmp23
%tmp27 = mul i64 %storemerge211, -1
%tmp106 = add i64 %n, %tmp27
%tmp31 = add i64 %tmp90, %tmp27
%tmp109 = add i64 %storemerge211, 1
%tmp35 = add i64 %tmp34, %tmp27
%scevgep100 = getelementptr [1025 x double]* @y, i64 0, i64 %tmp35
%scevgep99 = getelementptr [1025 x double]* @x, i64 0, i64 %tmp35
%tmp38 = add i64 %tmp94, %tmp23
%scevgep96 = getelementptr [1025 x [1025 x double]]* @a, i64 0, i64 -1, i64 %tmp38
%46 = add i64 %storemerge211, 1
%47 = load double* %scevgep100, align 8
%48 = icmp sgt i64 %tmp106, %n
br i1 %48, label %bb24, label %bb22.preheader
bb22.preheader: ; preds = %bb21
br label %bb22
bb22: ; preds = %bb22.preheader, %bb22
%indvar = phi i64 [ %indvar.next, %bb22 ], [ 0, %bb22.preheader ]
%w.tmp.0 = phi double [ %52, %bb22 ], [ %47, %bb22.preheader ]
%tmp25 = add i64 %tmp24, %indvar
%scevgep89 = getelementptr [1025 x [1025 x double]]* @a, i64 0, i64 -1, i64 %tmp25
%tmp29 = add i64 %tmp106, %indvar
%scevgep = getelementptr [1025 x double]* @x, i64 0, i64 %tmp29
%tmp92 = add i64 %tmp31, %indvar
%49 = load double* %scevgep89, align 8
%50 = load double* %scevgep, align 8
%51 = fmul double %49, %50
%52 = fsub double %w.tmp.0, %51
%53 = icmp sgt i64 %tmp92, %n
%indvar.next = add i64 %indvar, 1
br i1 %53, label %bb24.loopexit, label %bb22
bb24.loopexit: ; preds = %bb22
%.lcssa12 = phi double [ %52, %bb22 ]
br label %bb24
bb24: ; preds = %bb24.loopexit, %bb21
%w.tmp.021 = phi double [ %47, %bb21 ], [ %.lcssa12, %bb24.loopexit ]
%54 = load double* %scevgep96, align 8
%55 = fdiv double %w.tmp.021, %54
store double %55, double* %scevgep99, align 8
%56 = icmp slt i64 %44, %tmp109
br i1 %56, label %bb25.return_crit_edge, label %bb21
bb25.return_crit_edge: ; preds = %bb24
%w.tmp.021.lcssa = phi double [ %w.tmp.021, %bb24 ]
store double %w.tmp.021.lcssa, double* @w
ret void
return: ; preds = %bb20
ret void
}

View File

@ -1,246 +0,0 @@
; RUN: opt %loadPolly %defaultOpts -polly-detect -polly-ast -analyze %s | FileCheck %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"
%struct._IO_FILE = type { i32, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, %struct._IO_marker*, %struct._IO_FILE*, i32, i32, i64, i16, i8, [1 x i8], i8*, i64, i8*, i8*, i8*, i8*, i64, i32, [20 x i8] }
%struct._IO_marker = type { %struct._IO_marker*, %struct._IO_FILE*, i32 }
@x = common global [1025 x double] zeroinitializer, align 32
@b = common global [1025 x double] zeroinitializer, align 32
@a = common global [1025 x [1025 x double]] zeroinitializer, align 32
@stderr = external global %struct._IO_FILE*
@.str = private constant [8 x i8] c"%0.2lf \00", align 1
@w = common global double 0.000000e+00
@y = common global [1025 x double] zeroinitializer, align 32
define void @scop_func() nounwind {
bb.nph76:
store double 1.000000e+00, double* getelementptr inbounds ([1025 x double]* @b, i64 0, i64 0), align 32
%w.promoted = load double* @w
br label %bb5.preheader
bb.nph38: ; preds = %bb5.preheader
%0 = icmp sgt i64 %storemerge55, 0
br i1 %0, label %bb.nph38.split.us, label %bb4.preheader
bb4.preheader: ; preds = %bb.nph38
br label %bb4
bb.nph38.split.us: ; preds = %bb.nph38
br label %bb.nph30.us
bb4.us: ; preds = %bb2.us
%.lcssa62 = phi double [ %7, %bb2.us ]
%1 = load double* %scevgep109, align 8
%2 = fdiv double %.lcssa62, %1
store double %2, double* %scevgep141, align 8
%exitcond70 = icmp eq i64 %tmp139, %tmp46
br i1 %exitcond70, label %bb11.loopexit.loopexit1, label %bb.nph30.us
bb2.us: ; preds = %bb.nph30.us, %bb2.us
%3 = phi double [ %9, %bb.nph30.us ], [ %7, %bb2.us ]
%storemerge829.us = phi i64 [ 0, %bb.nph30.us ], [ %8, %bb2.us ]
%scevgep134 = getelementptr [1025 x [1025 x double]]* @a, i64 0, i64 %tmp95, i64 %storemerge829.us
%scevgep129 = getelementptr [1025 x [1025 x double]]* @a, i64 0, i64 %storemerge829.us, i64 %storemerge55
%4 = load double* %scevgep134, align 8
%5 = load double* %scevgep129, align 8
%6 = fmul double %4, %5
%7 = fsub double %3, %6
%8 = add nsw i64 %storemerge829.us, 1
%exitcond63 = icmp eq i64 %8, %storemerge55
br i1 %exitcond63, label %bb4.us, label %bb2.us
bb.nph30.us: ; preds = %bb4.us, %bb.nph38.split.us
%indvar130 = phi i64 [ %tmp139, %bb4.us ], [ 0, %bb.nph38.split.us ]
%tmp92 = add i64 %indvar130, 1
%scevgep141 = getelementptr [1025 x [1025 x double]]* @a, i64 0, i64 %tmp92, i64 %tmp86
%tmp95 = add i64 %storemerge533, %indvar130
%tmp139 = add i64 %indvar130, 1
%9 = load double* %scevgep141, align 8
br label %bb2.us
bb4: ; preds = %bb4.preheader, %bb4
%indvar145 = phi i64 [ %indvar.next146, %bb4 ], [ 0, %bb4.preheader ]
%tmp99 = add i64 %indvar145, 1
%scevgep150 = getelementptr [1025 x [1025 x double]]* @a, i64 0, i64 %tmp99, i64 %tmp86
%10 = load double* %scevgep150, align 8
%11 = load double* %scevgep109, align 8
%12 = fdiv double %10, %11
store double %12, double* %scevgep150, align 8
%indvar.next146 = add i64 %indvar145, 1
%exitcond58 = icmp eq i64 %indvar.next146, %tmp46
br i1 %exitcond58, label %bb11.loopexit.loopexit, label %bb4
bb.nph51: ; preds = %bb11.loopexit
br i1 false, label %bb10.us.preheader, label %bb.nph42.preheader
bb10.us.preheader: ; preds = %bb.nph51
br label %bb10.us
bb.nph42.preheader: ; preds = %bb.nph51
br label %bb.nph42
bb10.us: ; preds = %bb10.us.preheader, %bb10.us
%indvar114 = phi i64 [ %indvar.next115, %bb10.us ], [ 0, %bb10.us.preheader ]
%tmp88 = add i64 %tmp87, %indvar114
%scevgep121 = getelementptr [1025 x [1025 x double]]* @a, i64 0, i64 1, i64 %tmp88
%13 = load double* %scevgep121, align 8
store double %13, double* %scevgep121, align 8
%indvar.next115 = add i64 %indvar114, 1
%exitcond80 = icmp eq i64 %indvar.next115, %tmp46
br i1 %exitcond80, label %bb13.loopexit.loopexit2, label %bb10.us
bb.nph42: ; preds = %bb.nph42.preheader, %bb10
%indvar155 = phi i64 [ %indvar.next156, %bb10 ], [ 0, %bb.nph42.preheader ]
%tmp102 = add i64 %tmp87, %indvar155
%scevgep173 = getelementptr [1025 x [1025 x double]]* @a, i64 0, i64 1, i64 %tmp102
%tmp104 = add i64 %storemerge533, %indvar155
%14 = load double* %scevgep173, align 8
br label %bb8
bb8: ; preds = %bb8, %bb.nph42
%w.tmp.043 = phi double [ %14, %bb.nph42 ], [ %18, %bb8 ]
%storemerge741 = phi i64 [ 0, %bb.nph42 ], [ %19, %bb8 ]
%scevgep159 = getelementptr [1025 x [1025 x double]]* @a, i64 0, i64 %storemerge741, i64 %tmp104
%scevgep160 = getelementptr [1025 x [1025 x double]]* @a, i64 0, i64 %storemerge533, i64 %storemerge741
%15 = load double* %scevgep160, align 8
%16 = load double* %scevgep159, align 8
%17 = fmul double %15, %16
%18 = fsub double %w.tmp.043, %17
%19 = add nsw i64 %storemerge741, 1
%exitcond41 = icmp eq i64 %19, %storemerge533
br i1 %exitcond41, label %bb10, label %bb8
bb10: ; preds = %bb8
%.lcssa37 = phi double [ %18, %bb8 ]
store double %.lcssa37, double* %scevgep173, align 8
%indvar.next156 = add i64 %indvar155, 1
%exitcond47 = icmp eq i64 %indvar.next156, %tmp46
br i1 %exitcond47, label %bb13.loopexit.loopexit, label %bb.nph42
bb11.loopexit.loopexit: ; preds = %bb4
%.lcssa55 = phi double [ %10, %bb4 ]
br label %bb11.loopexit
bb11.loopexit.loopexit1: ; preds = %bb4.us
%.lcssa62.lcssa = phi double [ %.lcssa62, %bb4.us ]
br label %bb11.loopexit
bb11.loopexit: ; preds = %bb11.loopexit.loopexit1, %bb11.loopexit.loopexit, %bb5.preheader
%w.tmp.077 = phi double [ %w.tmp.1, %bb5.preheader ], [ %.lcssa55, %bb11.loopexit.loopexit ], [ %.lcssa62.lcssa, %bb11.loopexit.loopexit1 ]
br i1 false, label %bb13.loopexit, label %bb.nph51
bb13.loopexit.loopexit: ; preds = %bb10
%.lcssa37.lcssa = phi double [ %.lcssa37, %bb10 ]
br label %bb13.loopexit
bb13.loopexit.loopexit2: ; preds = %bb10.us
%.lcssa77 = phi double [ %13, %bb10.us ]
br label %bb13.loopexit
bb13.loopexit: ; preds = %bb13.loopexit.loopexit2, %bb13.loopexit.loopexit, %bb11.loopexit
%w.tmp.2 = phi double [ %w.tmp.077, %bb11.loopexit ], [ %.lcssa37.lcssa, %bb13.loopexit.loopexit ], [ %.lcssa77, %bb13.loopexit.loopexit2 ]
%indvar.next39 = add i64 %storemerge55, 1
%exitcond85 = icmp ne i64 %indvar.next39, 1024
br i1 %exitcond85, label %bb5.preheader, label %bb.nph25
bb5.preheader: ; preds = %bb13.loopexit, %bb.nph76
%storemerge55 = phi i64 [ %indvar.next39, %bb13.loopexit ], [ 0, %bb.nph76 ]
%w.tmp.1 = phi double [ %w.promoted, %bb.nph76 ], [ %w.tmp.2, %bb13.loopexit ]
%tmp86 = mul i64 %storemerge55, 1026
%tmp87 = add i64 %tmp86, 1
%tmp90 = mul i64 %storemerge55, -1
%tmp46 = add i64 %tmp90, 1024
%storemerge533 = add i64 %storemerge55, 1
%scevgep109 = getelementptr [1025 x [1025 x double]]* @a, i64 0, i64 0, i64 %tmp86
br i1 false, label %bb11.loopexit, label %bb.nph38
bb.nph25: ; preds = %bb13.loopexit
%w.tmp.2.lcssa = phi double [ %w.tmp.2, %bb13.loopexit ]
store double %w.tmp.2.lcssa, double* @w
store double 1.000000e+00, double* getelementptr inbounds ([1025 x double]* @y, i64 0, i64 0), align 32
br label %bb.nph19
bb.nph19: ; preds = %bb18, %bb.nph25
%indvar102 = phi i64 [ 0, %bb.nph25 ], [ %tmp, %bb18 ]
%tmp29 = add i64 %indvar102, 1
%scevgep111 = getelementptr [1025 x double]* @b, i64 0, i64 %tmp29
%scevgep110 = getelementptr [1025 x double]* @y, i64 0, i64 %tmp29
%tmp = add i64 %indvar102, 1
%20 = load double* %scevgep111, align 8
br label %bb16
bb16: ; preds = %bb16, %bb.nph19
%21 = phi double [ %20, %bb.nph19 ], [ %25, %bb16 ]
%storemerge418 = phi i64 [ 0, %bb.nph19 ], [ %26, %bb16 ]
%scevgep106 = getelementptr [1025 x [1025 x double]]* @a, i64 0, i64 %tmp29, i64 %storemerge418
%scevgep105 = getelementptr [1025 x double]* @y, i64 0, i64 %storemerge418
%22 = load double* %scevgep106, align 8
%23 = load double* %scevgep105, align 8
%24 = fmul double %22, %23
%25 = fsub double %21, %24
%26 = add nsw i64 %storemerge418, 1
%exitcond = icmp eq i64 %26, %tmp29
br i1 %exitcond, label %bb18, label %bb16
bb18: ; preds = %bb16
%.lcssa28 = phi double [ %25, %bb16 ]
store double %.lcssa28, double* %scevgep110, align 8
%exitcond32 = icmp eq i64 %tmp, 1024
br i1 %exitcond32, label %bb.nph14, label %bb.nph19
bb.nph14: ; preds = %bb18
%.lcssa28.lcssa = phi double [ %.lcssa28, %bb18 ]
store double %.lcssa28.lcssa, double* @w
%27 = load double* getelementptr inbounds ([1025 x double]* @y, i64 0, i64 1024), align 32
%28 = load double* getelementptr inbounds ([1025 x [1025 x double]]* @a, i64 0, i64 1024, i64 1024), align 32
%29 = fdiv double %27, %28
store double %29, double* getelementptr inbounds ([1025 x double]* @x, i64 0, i64 1024), align 32
br label %bb.nph
bb.nph: ; preds = %bb24, %bb.nph14
%storemerge210 = phi i64 [ 0, %bb.nph14 ], [ %37, %bb24 ]
%tmp14 = mul i64 %storemerge210, -1026
%tmp15 = add i64 %tmp14, 1024
%tmp18 = mul i64 %storemerge210, -1
%tmp19 = add i64 %tmp18, 1024
%tmp3 = add i64 %storemerge210, 1
%tmp23 = add i64 %tmp18, 1023
%scevgep100 = getelementptr [1025 x double]* @y, i64 0, i64 %tmp23
%scevgep99 = getelementptr [1025 x double]* @x, i64 0, i64 %tmp23
%tmp26 = add i64 %tmp14, 1023
%scevgep97 = getelementptr [1025 x [1025 x double]]* @a, i64 0, i64 1023, i64 %tmp26
%30 = load double* %scevgep100, align 8
br label %bb22
bb22: ; preds = %bb22, %bb.nph
%indvar = phi i64 [ 0, %bb.nph ], [ %indvar.next, %bb22 ]
%w.tmp.0 = phi double [ %30, %bb.nph ], [ %34, %bb22 ]
%tmp16 = add i64 %tmp15, %indvar
%scevgep83 = getelementptr [1025 x [1025 x double]]* @a, i64 0, i64 1023, i64 %tmp16
%tmp20 = add i64 %tmp19, %indvar
%scevgep = getelementptr [1025 x double]* @x, i64 0, i64 %tmp20
%31 = load double* %scevgep83, align 8
%32 = load double* %scevgep, align 8
%33 = fmul double %31, %32
%34 = fsub double %w.tmp.0, %33
%indvar.next = add i64 %indvar, 1
%exitcond4 = icmp eq i64 %indvar.next, %tmp3
br i1 %exitcond4, label %bb24, label %bb22
bb24: ; preds = %bb22
%.lcssa = phi double [ %34, %bb22 ]
%35 = load double* %scevgep97, align 8
%36 = fdiv double %.lcssa, %35
store double %36, double* %scevgep99, align 8
%37 = add nsw i64 %storemerge210, 1
%exitcond13 = icmp eq i64 %37, 1024
br i1 %exitcond13, label %return, label %bb.nph
return: ; preds = %bb24
%.lcssa.lcssa = phi double [ %.lcssa, %bb24 ]
store double %.lcssa.lcssa, double* @w
ret void
}
; CHECK: Valid Region for Scop: bb5.preheader => return

View File

@ -1,14 +0,0 @@
#!/bin/sh
if [ $# -ne 3 ]; then
echo "Usage: compile.sh <compiler command> <input file> <output file>";
exit 1;
fi;
COMPILER_COMMAND="$1";
INPUT_FILE="$2";
OUTPUT_FILE="$3";
$COMPILER_COMMAND -DPOLYBENCH_TIME -lm -I utilities utilities/instrument.c $INPUT_FILE -o $OUTPUT_FILE
exit 0;

View File

@ -1,40 +0,0 @@
#!/bin/sh
if [ $# -ne 1 ]; then
echo "Usage: runall.sh <machine-acronym>";
exit 1;
fi;
## Default value for the compilation line.
if [ -z "$COMPILER_COMMAND" ]; then
COMPILER_COMMAND="gcc -O3 -fopenmp";
fi;
echo "Machine: $1";
for i in `ls`; do
if [ -d "$i" ] && [ -f "$i/$i.c" ]; then
echo "Testing benchmark $i";
rm -f data/$1-$i.dat
if [ -f "$i/compiler.opts" ]; then
read comp_opts < $i/compiler.opts;
COMPILER_F_COMMAND="$COMPILER_COMMAND $comp_opts";
else
COMPILER_F_COMMAND="$COMPILER_COMMAND";
fi;
for j in `find $i -name "*.c"`; do
echo "Testing $j";
scripts/compile.sh "$COMPILER_F_COMMAND" "$j" "transfo" > /dev/null;
if [ $? -ne 0 ]; then
echo "Problem when compiling $j";
else
val=`./transfo`;
if [ $? -ne 0 ]; then
echo "Problem when executing $j";
else
echo "execution time: $val";
echo "$j $val" >> data/$1-$i.dat
fi;
fi;
done;
fi;
done;

View File

@ -1,147 +0,0 @@
#include <stdio.h>
#include <unistd.h>
#include <string.h>
#include <math.h>
#include "instrument.h"
/* Default problem size. */
#ifndef TSTEPS
# define TSTEPS 10
#endif
#ifndef N
# define N 1024
#endif
/* Default data type is double. */
#ifndef DATA_TYPE
# define DATA_TYPE double
#endif
#ifndef DATA_PRINTF_MODIFIER
# define DATA_PRINTF_MODIFIER "%0.2lf "
#endif
/* Array declaration. Enable malloc if POLYBENCH_TEST_MALLOC. */
#ifndef POLYBENCH_TEST_MALLOC
DATA_TYPE X[N][N];
DATA_TYPE A[N][N];
DATA_TYPE B[N][N];
#else
DATA_TYPE** X = (DATA_TYPE**)malloc(MAXGRID * sizeof(DATA_TYPE*));
DATA_TYPE** A = (DATA_TYPE**)malloc(MAXGRID * sizeof(DATA_TYPE*));
DATA_TYPE** B = (DATA_TYPE**)malloc(MAXGRID * sizeof(DATA_TYPE*));
{
int i;
for (i = 0; i < N; ++i)
{
X[i] = (DATA_TYPE*)malloc(N * sizeof(DATA_TYPE));
A[i] = (DATA_TYPE*)malloc(N * sizeof(DATA_TYPE));
B[i] = (DATA_TYPE*)malloc(N * sizeof(DATA_TYPE));
}
}
#endif
inline
void init_array()
{
int i, j;
for (i = 0; i < N; i++)
for (j = 0; j < N; j++)
{
X[i][j] = ((DATA_TYPE) i*j + 1) / N;
A[i][j] = ((DATA_TYPE) i*j + 2) / N;
B[i][j] = ((DATA_TYPE) i*j + 3) / N;
}
}
/* Define the live-out variables. Code is not executed unless
POLYBENCH_DUMP_ARRAYS is defined. */
inline
void print_array(int argc, char** argv)
{
int i, j;
#ifndef POLYBENCH_DUMP_ARRAYS
if (argc > 42 && ! strcmp(argv[0], ""))
#endif
{
for (i = 0; i < N; i++)
for (j = 0; j < N; j++) {
fprintf(stderr, DATA_PRINTF_MODIFIER, A[i][j]);
if ((i * N + j) % 80 == 20) fprintf(stderr, "\n");
}
fprintf(stderr, "\n");
}
}
#ifndef SCOP_PARAM
void scop_func() {
long n = N;
#else
void scop_func(long n) {
#endif
long t, i1, i2;
long tsteps = TSTEPS;
#pragma scop
#pragma live-out X
for (t = 0; t < tsteps; t++)
{
for (i1 = 0; i1 < n; i1++)
for (i2 = 1; i2 < n; i2++)
{
X[i1][i2] = X[i1][i2] - X[i1][i2-1] * A[i1][i2] / B[i1][i2-1];
B[i1][i2] = B[i1][i2] - A[i1][i2] * A[i1][i2] / B[i1][i2-1];
}
for (i1 = 0; i1 < n; i1++)
X[i1][n-1] = X[i1][n-1] / B[i1][n-1];
for (i1 = 0; i1 < n; i1++)
for (i2 = 0; i2 < n-2; i2++)
X[i1][n-i2-2] = (X[i1][n-2-i2] - X[i1][n-2-i2-1] * A[i1][n-i2-3]) / B[i1][n-3-i2];
for (i1 = 1; i1 < n; i1++)
for (i2 = 0; i2 < n; i2++) {
X[i1][i2] = X[i1][i2] - X[i1-1][i2] * A[i1][i2] / B[i1-1][i2];
B[i1][i2] = B[i1][i2] - A[i1][i2] * A[i1][i2] / B[i1-1][i2];
}
for (i2 = 0; i2 < n; i2++)
X[n-1][i2] = X[n-1][i2] / B[n-1][i2];
for (i1 = 0; i1 < n-2; i1++)
for (i2 = 0; i2 < n; i2++)
X[n-2-i1][i2] = (X[n-2-i1][i2] - X[n-i1-3][i2] * A[n-3-i1][i2]) / B[n-2-i1][i2];
}
#pragma endscop
}
int main(int argc, char** argv)
{
int t, i1, i2;
int n = N;
int tsteps = TSTEPS;
/* Initialize array. */
init_array();
/* Start timer. */
polybench_start_instruments;
#ifndef SCOP_PARAM
scop_func();
#else
scop_func(n);
#endif
/* Stop and print timer. */
polybench_stop_instruments;
polybench_print_instruments;
print_array(argc, argv);
return 0;
}

View File

@ -1,250 +0,0 @@
; RUN: opt %loadPolly %defaultOpts -polly-analyze-ir -print-top-scop-only -analyze %s | FileCheck %s
; XFAIL: *
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"
%struct._IO_FILE = type { i32, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, %struct._IO_marker*, %struct._IO_FILE*, i32, i32, i64, i16, i8, [1 x i8], i8*, i64, i8*, i8*, i8*, i8*, i64, i32, [20 x i8] }
%struct._IO_marker = type { %struct._IO_marker*, %struct._IO_FILE*, i32 }
@X = common global [1024 x [1024 x double]] zeroinitializer, align 32
@A = common global [1024 x [1024 x double]] zeroinitializer, align 32
@B = common global [1024 x [1024 x double]] zeroinitializer, align 32
@stderr = external global %struct._IO_FILE*
@.str = private constant [8 x i8] c"%0.2lf \00", align 1
define void @scop_func(i64 %n) nounwind {
bb.nph81:
%0 = icmp sgt i64 %n, 0
%1 = icmp sgt i64 %n, 1
%2 = add nsw i64 %n, -2
%3 = icmp sgt i64 %2, 0
%4 = add nsw i64 %n, -3
%tmp = add i64 %n, -1
br label %bb5.preheader
bb.nph: ; preds = %bb.nph.preheader, %bb4
%storemerge112 = phi i64 [ %16, %bb4 ], [ 0, %bb.nph.preheader ]
%scevgep86.phi.trans.insert = getelementptr [1024 x [1024 x double]]* @B, i64 0, i64 %storemerge112, i64 0
%scevgep85.phi.trans.insert = getelementptr [1024 x [1024 x double]]* @X, i64 0, i64 %storemerge112, i64 0
%.pre = load double* %scevgep85.phi.trans.insert, align 32
%.pre149 = load double* %scevgep86.phi.trans.insert, align 32
br label %bb2
bb2: ; preds = %bb2, %bb.nph
%5 = phi double [ %.pre149, %bb.nph ], [ %15, %bb2 ]
%6 = phi double [ %.pre, %bb.nph ], [ %11, %bb2 ]
%indvar = phi i64 [ 0, %bb.nph ], [ %tmp90, %bb2 ]
%tmp42 = add i64 %indvar, 1
%scevgep84 = getelementptr [1024 x [1024 x double]]* @B, i64 0, i64 %storemerge112, i64 %tmp42
%scevgep83 = getelementptr [1024 x [1024 x double]]* @A, i64 0, i64 %storemerge112, i64 %tmp42
%scevgep = getelementptr [1024 x [1024 x double]]* @X, i64 0, i64 %storemerge112, i64 %tmp42
%tmp90 = add i64 %indvar, 1
%7 = load double* %scevgep, align 8
%8 = load double* %scevgep83, align 8
%9 = fmul double %6, %8
%10 = fdiv double %9, %5
%11 = fsub double %7, %10
store double %11, double* %scevgep, align 8
%12 = load double* %scevgep84, align 8
%13 = fmul double %8, %8
%14 = fdiv double %13, %5
%15 = fsub double %12, %14
store double %15, double* %scevgep84, align 8
%exitcond37 = icmp eq i64 %tmp90, %tmp
br i1 %exitcond37, label %bb4, label %bb2
bb4: ; preds = %bb2
%16 = add nsw i64 %storemerge112, 1
%exitcond = icmp eq i64 %16, %n
br i1 %exitcond, label %bb8.loopexit.loopexit, label %bb.nph
bb.nph16: ; preds = %bb5.preheader
br i1 %1, label %bb.nph.preheader, label %bb8.loopexit
bb.nph.preheader: ; preds = %bb.nph16
br label %bb.nph
bb7: ; preds = %bb7.preheader, %bb7
%storemerge217 = phi i64 [ %20, %bb7 ], [ 0, %bb7.preheader ]
%scevgep96 = getelementptr [1024 x [1024 x double]]* @B, i64 0, i64 %storemerge217, i64 %tmp
%scevgep95 = getelementptr [1024 x [1024 x double]]* @X, i64 0, i64 %storemerge217, i64 %tmp
%17 = load double* %scevgep95, align 8
%18 = load double* %scevgep96, align 8
%19 = fdiv double %17, %18
store double %19, double* %scevgep95, align 8
%20 = add nsw i64 %storemerge217, 1
%exitcond18 = icmp eq i64 %20, %n
br i1 %exitcond18, label %bb14.loopexit, label %bb7
bb8.loopexit.loopexit: ; preds = %bb4
br label %bb8.loopexit
bb8.loopexit: ; preds = %bb8.loopexit.loopexit, %bb.nph16
br i1 %0, label %bb7.preheader, label %bb20.loopexit
bb7.preheader: ; preds = %bb8.loopexit
br label %bb7
bb11: ; preds = %bb12.preheader, %bb11
%storemerge920 = phi i64 [ %28, %bb11 ], [ 0, %bb12.preheader ]
%tmp30 = mul i64 %storemerge920, -1
%tmp31 = add i64 %4, %tmp30
%scevgep104 = getelementptr [1024 x [1024 x double]]* @B, i64 0, i64 %storemerge323, i64 %tmp31
%scevgep103 = getelementptr [1024 x [1024 x double]]* @A, i64 0, i64 %storemerge323, i64 %tmp31
%scevgep102 = getelementptr [1024 x [1024 x double]]* @X, i64 0, i64 %storemerge323, i64 %tmp31
%tmp35 = add i64 %2, %tmp30
%scevgep100 = getelementptr [1024 x [1024 x double]]* @X, i64 0, i64 %storemerge323, i64 %tmp35
%21 = load double* %scevgep100, align 8
%22 = load double* %scevgep102, align 8
%23 = load double* %scevgep103, align 8
%24 = fmul double %22, %23
%25 = fsub double %21, %24
%26 = load double* %scevgep104, align 8
%27 = fdiv double %25, %26
store double %27, double* %scevgep100, align 8
%28 = add nsw i64 %storemerge920, 1
%exitcond21 = icmp eq i64 %28, %2
br i1 %exitcond21, label %bb13, label %bb11
bb13: ; preds = %bb11
%29 = add nsw i64 %storemerge323, 1
%exitcond29 = icmp eq i64 %29, %n
br i1 %exitcond29, label %bb20.loopexit.loopexit, label %bb12.preheader
bb14.loopexit: ; preds = %bb7
%.not = xor i1 %0, true
%.not150 = xor i1 %3, true
%brmerge = or i1 %.not, %.not150
br i1 %brmerge, label %bb20.loopexit, label %bb12.preheader.preheader
bb12.preheader.preheader: ; preds = %bb14.loopexit
br label %bb12.preheader
bb12.preheader: ; preds = %bb12.preheader.preheader, %bb13
%storemerge323 = phi i64 [ %29, %bb13 ], [ 0, %bb12.preheader.preheader ]
br label %bb11
bb17: ; preds = %bb18.preheader, %bb17
%storemerge828 = phi i64 [ %41, %bb17 ], [ 0, %bb18.preheader ]
%scevgep119 = getelementptr [1024 x [1024 x double]]* @B, i64 0, i64 %indvar114, i64 %storemerge828
%scevgep118 = getelementptr [1024 x [1024 x double]]* @X, i64 0, i64 %indvar114, i64 %storemerge828
%scevgep121 = getelementptr [1024 x [1024 x double]]* @B, i64 0, i64 %tmp11, i64 %storemerge828
%scevgep120 = getelementptr [1024 x [1024 x double]]* @A, i64 0, i64 %tmp11, i64 %storemerge828
%scevgep117 = getelementptr [1024 x [1024 x double]]* @X, i64 0, i64 %tmp11, i64 %storemerge828
%30 = load double* %scevgep117, align 8
%31 = load double* %scevgep118, align 8
%32 = load double* %scevgep120, align 8
%33 = fmul double %31, %32
%34 = load double* %scevgep119, align 8
%35 = fdiv double %33, %34
%36 = fsub double %30, %35
store double %36, double* %scevgep117, align 8
%37 = load double* %scevgep121, align 8
%38 = fmul double %32, %32
%39 = fdiv double %38, %34
%40 = fsub double %37, %39
store double %40, double* %scevgep121, align 8
%41 = add nsw i64 %storemerge828, 1
%exitcond1 = icmp eq i64 %41, %n
br i1 %exitcond1, label %bb19, label %bb17
bb19: ; preds = %bb17
%tmp125 = add i64 %indvar114, 1
%exitcond8 = icmp eq i64 %tmp125, %tmp
br i1 %exitcond8, label %bb23.loopexit.loopexit, label %bb18.preheader
bb20.loopexit.loopexit: ; preds = %bb13
br label %bb20.loopexit
bb20.loopexit: ; preds = %bb20.loopexit.loopexit, %bb5.preheader, %bb14.loopexit, %bb8.loopexit
br i1 %1, label %bb.nph34, label %bb23.loopexit
bb.nph34: ; preds = %bb20.loopexit
br i1 %0, label %bb18.preheader.preheader, label %bb29.loopexit
bb18.preheader.preheader: ; preds = %bb.nph34
br label %bb18.preheader
bb18.preheader: ; preds = %bb18.preheader.preheader, %bb19
%indvar114 = phi i64 [ %tmp125, %bb19 ], [ 0, %bb18.preheader.preheader ]
%tmp11 = add i64 %indvar114, 1
br label %bb17
bb22: ; preds = %bb22.preheader, %bb22
%storemerge535 = phi i64 [ %45, %bb22 ], [ 0, %bb22.preheader ]
%scevgep131 = getelementptr [1024 x [1024 x double]]* @B, i64 0, i64 %tmp, i64 %storemerge535
%scevgep130 = getelementptr [1024 x [1024 x double]]* @X, i64 0, i64 %tmp, i64 %storemerge535
%42 = load double* %scevgep130, align 8
%43 = load double* %scevgep131, align 8
%44 = fdiv double %42, %43
store double %44, double* %scevgep130, align 8
%45 = add nsw i64 %storemerge535, 1
%exitcond15 = icmp eq i64 %45, %n
br i1 %exitcond15, label %bb29.loopexit.loopexit, label %bb22
bb23.loopexit.loopexit: ; preds = %bb19
br label %bb23.loopexit
bb23.loopexit: ; preds = %bb23.loopexit.loopexit, %bb20.loopexit
br i1 %0, label %bb22.preheader, label %bb29.loopexit
bb22.preheader: ; preds = %bb23.loopexit
br label %bb22
bb26: ; preds = %bb27.preheader, %bb26
%storemerge737 = phi i64 [ %53, %bb26 ], [ 0, %bb27.preheader ]
%scevgep138 = getelementptr [1024 x [1024 x double]]* @A, i64 0, i64 %tmp58, i64 %storemerge737
%scevgep137 = getelementptr [1024 x [1024 x double]]* @X, i64 0, i64 %tmp58, i64 %storemerge737
%scevgep139 = getelementptr [1024 x [1024 x double]]* @B, i64 0, i64 %tmp61, i64 %storemerge737
%scevgep135 = getelementptr [1024 x [1024 x double]]* @X, i64 0, i64 %tmp61, i64 %storemerge737
%46 = load double* %scevgep135, align 8
%47 = load double* %scevgep137, align 8
%48 = load double* %scevgep138, align 8
%49 = fmul double %47, %48
%50 = fsub double %46, %49
%51 = load double* %scevgep139, align 8
%52 = fdiv double %50, %51
store double %52, double* %scevgep135, align 8
%53 = add nsw i64 %storemerge737, 1
%exitcond48 = icmp eq i64 %53, %n
br i1 %exitcond48, label %bb28, label %bb26
bb28: ; preds = %bb26
%54 = add nsw i64 %storemerge640, 1
%exitcond56 = icmp eq i64 %54, %2
br i1 %exitcond56, label %bb30.loopexit, label %bb27.preheader
bb29.loopexit.loopexit: ; preds = %bb22
br label %bb29.loopexit
bb29.loopexit: ; preds = %bb29.loopexit.loopexit, %bb23.loopexit, %bb.nph34
%.not151 = xor i1 %3, true
%.not152 = xor i1 %0, true
%brmerge153 = or i1 %.not151, %.not152
br i1 %brmerge153, label %bb30, label %bb27.preheader.preheader
bb27.preheader.preheader: ; preds = %bb29.loopexit
br label %bb27.preheader
bb27.preheader: ; preds = %bb27.preheader.preheader, %bb28
%storemerge640 = phi i64 [ %54, %bb28 ], [ 0, %bb27.preheader.preheader ]
%tmp57 = mul i64 %storemerge640, -1
%tmp58 = add i64 %4, %tmp57
%tmp61 = add i64 %2, %tmp57
br label %bb26
bb30.loopexit: ; preds = %bb28
br label %bb30
bb30: ; preds = %bb30.loopexit, %bb29.loopexit
%55 = add nsw i64 %storemerge46, 1
%exitcond64 = icmp eq i64 %55, 10
br i1 %exitcond64, label %return, label %bb5.preheader
bb5.preheader: ; preds = %bb30, %bb.nph81
%storemerge46 = phi i64 [ 0, %bb.nph81 ], [ %55, %bb30 ]
br i1 %0, label %bb.nph16, label %bb20.loopexit
return: ; preds = %bb30
ret void
}

View File

@ -1,199 +0,0 @@
; RUN: opt %loadPolly %defaultOpts -polly-detect -analyze %s | FileCheck %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"
%struct._IO_FILE = type { i32, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, %struct._IO_marker*, %struct._IO_FILE*, i32, i32, i64, i16, i8, [1 x i8], i8*, i64, i8*, i8*, i8*, i8*, i64, i32, [20 x i8] }
%struct._IO_marker = type { %struct._IO_marker*, %struct._IO_FILE*, i32 }
@X = common global [1024 x [1024 x double]] zeroinitializer, align 32
@A = common global [1024 x [1024 x double]] zeroinitializer, align 32
@B = common global [1024 x [1024 x double]] zeroinitializer, align 32
@stderr = external global %struct._IO_FILE*
@.str = private constant [8 x i8] c"%0.2lf \00", align 1
define void @scop_func() nounwind {
bb.nph79:
br label %bb5.preheader
bb.nph: ; preds = %bb5.preheader, %bb4
%storemerge112 = phi i64 [ %11, %bb4 ], [ 0, %bb5.preheader ]
%scevgep83.phi.trans.insert = getelementptr [1024 x [1024 x double]]* @B, i64 0, i64 %storemerge112, i64 0
%scevgep82.phi.trans.insert = getelementptr [1024 x [1024 x double]]* @X, i64 0, i64 %storemerge112, i64 0
%.pre = load double* %scevgep82.phi.trans.insert, align 32
%.pre143 = load double* %scevgep83.phi.trans.insert, align 32
br label %bb2
bb2: ; preds = %bb2, %bb.nph
%0 = phi double [ %.pre143, %bb.nph ], [ %10, %bb2 ]
%1 = phi double [ %.pre, %bb.nph ], [ %6, %bb2 ]
%indvar = phi i64 [ 0, %bb.nph ], [ %tmp87, %bb2 ]
%tmp5 = add i64 %indvar, 1
%scevgep81 = getelementptr [1024 x [1024 x double]]* @B, i64 0, i64 %storemerge112, i64 %tmp5
%scevgep80 = getelementptr [1024 x [1024 x double]]* @A, i64 0, i64 %storemerge112, i64 %tmp5
%scevgep = getelementptr [1024 x [1024 x double]]* @X, i64 0, i64 %storemerge112, i64 %tmp5
%tmp87 = add i64 %indvar, 1
%2 = load double* %scevgep, align 8
%3 = load double* %scevgep80, align 8
%4 = fmul double %1, %3
%5 = fdiv double %4, %0
%6 = fsub double %2, %5
store double %6, double* %scevgep, align 8
%7 = load double* %scevgep81, align 8
%8 = fmul double %3, %3
%9 = fdiv double %8, %0
%10 = fsub double %7, %9
store double %10, double* %scevgep81, align 8
%exitcond1 = icmp eq i64 %tmp87, 1023
br i1 %exitcond1, label %bb4, label %bb2
bb4: ; preds = %bb2
%11 = add nsw i64 %storemerge112, 1
%exitcond = icmp eq i64 %11, 1024
br i1 %exitcond, label %bb7.loopexit, label %bb.nph
bb7.loopexit: ; preds = %bb4
br label %bb7
bb7: ; preds = %bb7.loopexit, %bb7
%storemerge217 = phi i64 [ %15, %bb7 ], [ 0, %bb7.loopexit ]
%scevgep93 = getelementptr [1024 x [1024 x double]]* @B, i64 0, i64 %storemerge217, i64 1023
%scevgep92 = getelementptr [1024 x [1024 x double]]* @X, i64 0, i64 %storemerge217, i64 1023
%12 = load double* %scevgep92, align 8
%13 = load double* %scevgep93, align 8
%14 = fdiv double %12, %13
store double %14, double* %scevgep92, align 8
%15 = add nsw i64 %storemerge217, 1
%exitcond11 = icmp eq i64 %15, 1024
br i1 %exitcond11, label %bb12.preheader.loopexit, label %bb7
bb11: ; preds = %bb12.preheader, %bb11
%storemerge920 = phi i64 [ %23, %bb11 ], [ 0, %bb12.preheader ]
%tmp22 = mul i64 %storemerge920, -1
%tmp23 = add i64 %tmp22, 1021
%scevgep100 = getelementptr [1024 x [1024 x double]]* @B, i64 0, i64 %storemerge323, i64 %tmp23
%scevgep99 = getelementptr [1024 x [1024 x double]]* @A, i64 0, i64 %storemerge323, i64 %tmp23
%scevgep98 = getelementptr [1024 x [1024 x double]]* @X, i64 0, i64 %storemerge323, i64 %tmp23
%tmp27 = add i64 %tmp22, 1022
%scevgep96 = getelementptr [1024 x [1024 x double]]* @X, i64 0, i64 %storemerge323, i64 %tmp27
%16 = load double* %scevgep96, align 8
%17 = load double* %scevgep98, align 8
%18 = load double* %scevgep99, align 8
%19 = fmul double %17, %18
%20 = fsub double %16, %19
%21 = load double* %scevgep100, align 8
%22 = fdiv double %20, %21
store double %22, double* %scevgep96, align 8
%23 = add nsw i64 %storemerge920, 1
%exitcond14 = icmp eq i64 %23, 1022
br i1 %exitcond14, label %bb13, label %bb11
bb13: ; preds = %bb11
%24 = add nsw i64 %storemerge323, 1
%exitcond21 = icmp eq i64 %24, 1024
br i1 %exitcond21, label %bb18.preheader.loopexit, label %bb12.preheader
bb12.preheader.loopexit: ; preds = %bb7
br label %bb12.preheader
bb12.preheader: ; preds = %bb12.preheader.loopexit, %bb13
%storemerge323 = phi i64 [ %24, %bb13 ], [ 0, %bb12.preheader.loopexit ]
br label %bb11
bb17: ; preds = %bb18.preheader, %bb17
%storemerge828 = phi i64 [ %36, %bb17 ], [ 0, %bb18.preheader ]
%scevgep114 = getelementptr [1024 x [1024 x double]]* @B, i64 0, i64 %indvar110, i64 %storemerge828
%scevgep113 = getelementptr [1024 x [1024 x double]]* @X, i64 0, i64 %indvar110, i64 %storemerge828
%scevgep116 = getelementptr [1024 x [1024 x double]]* @B, i64 0, i64 %tmp38, i64 %storemerge828
%scevgep115 = getelementptr [1024 x [1024 x double]]* @A, i64 0, i64 %tmp38, i64 %storemerge828
%scevgep112 = getelementptr [1024 x [1024 x double]]* @X, i64 0, i64 %tmp38, i64 %storemerge828
%25 = load double* %scevgep112, align 8
%26 = load double* %scevgep113, align 8
%27 = load double* %scevgep115, align 8
%28 = fmul double %26, %27
%29 = load double* %scevgep114, align 8
%30 = fdiv double %28, %29
%31 = fsub double %25, %30
store double %31, double* %scevgep112, align 8
%32 = load double* %scevgep116, align 8
%33 = fmul double %27, %27
%34 = fdiv double %33, %29
%35 = fsub double %32, %34
store double %35, double* %scevgep116, align 8
%36 = add nsw i64 %storemerge828, 1
%exitcond29 = icmp eq i64 %36, 1024
br i1 %exitcond29, label %bb19, label %bb17
bb19: ; preds = %bb17
%tmp120 = add i64 %indvar110, 1
%exitcond35 = icmp eq i64 %tmp120, 1023
br i1 %exitcond35, label %bb22.loopexit, label %bb18.preheader
bb18.preheader.loopexit: ; preds = %bb13
br label %bb18.preheader
bb18.preheader: ; preds = %bb18.preheader.loopexit, %bb19
%indvar110 = phi i64 [ %tmp120, %bb19 ], [ 0, %bb18.preheader.loopexit ]
%tmp38 = add i64 %indvar110, 1
br label %bb17
bb22.loopexit: ; preds = %bb19
br label %bb22
bb22: ; preds = %bb22.loopexit, %bb22
%storemerge535 = phi i64 [ %40, %bb22 ], [ 0, %bb22.loopexit ]
%scevgep126 = getelementptr [1024 x [1024 x double]]* @B, i64 0, i64 1023, i64 %storemerge535
%scevgep125 = getelementptr [1024 x [1024 x double]]* @X, i64 0, i64 1023, i64 %storemerge535
%37 = load double* %scevgep125, align 8
%38 = load double* %scevgep126, align 8
%39 = fdiv double %37, %38
store double %39, double* %scevgep125, align 8
%40 = add nsw i64 %storemerge535, 1
%exitcond42 = icmp eq i64 %40, 1024
br i1 %exitcond42, label %bb27.preheader.loopexit, label %bb22
bb26: ; preds = %bb27.preheader, %bb26
%storemerge737 = phi i64 [ %48, %bb26 ], [ 0, %bb27.preheader ]
%scevgep132 = getelementptr [1024 x [1024 x double]]* @A, i64 0, i64 %tmp54, i64 %storemerge737
%scevgep131 = getelementptr [1024 x [1024 x double]]* @X, i64 0, i64 %tmp54, i64 %storemerge737
%scevgep133 = getelementptr [1024 x [1024 x double]]* @B, i64 0, i64 %tmp57, i64 %storemerge737
%scevgep129 = getelementptr [1024 x [1024 x double]]* @X, i64 0, i64 %tmp57, i64 %storemerge737
%41 = load double* %scevgep129, align 8
%42 = load double* %scevgep131, align 8
%43 = load double* %scevgep132, align 8
%44 = fmul double %42, %43
%45 = fsub double %41, %44
%46 = load double* %scevgep133, align 8
%47 = fdiv double %45, %46
store double %47, double* %scevgep129, align 8
%48 = add nsw i64 %storemerge737, 1
%exitcond45 = icmp eq i64 %48, 1024
br i1 %exitcond45, label %bb28, label %bb26
bb28: ; preds = %bb26
%49 = add nsw i64 %storemerge639, 1
%exitcond52 = icmp eq i64 %49, 1022
br i1 %exitcond52, label %bb30, label %bb27.preheader
bb27.preheader.loopexit: ; preds = %bb22
br label %bb27.preheader
bb27.preheader: ; preds = %bb27.preheader.loopexit, %bb28
%storemerge639 = phi i64 [ %49, %bb28 ], [ 0, %bb27.preheader.loopexit ]
%tmp53 = mul i64 %storemerge639, -1
%tmp54 = add i64 %tmp53, 1021
%tmp57 = add i64 %tmp53, 1022
br label %bb26
bb30: ; preds = %bb28
%50 = add nsw i64 %storemerge44, 1
%exitcond60 = icmp eq i64 %50, 10
br i1 %exitcond60, label %return, label %bb5.preheader
bb5.preheader: ; preds = %bb30, %bb.nph79
%storemerge44 = phi i64 [ 0, %bb.nph79 ], [ %50, %bb30 ]
br label %bb.nph
return: ; preds = %bb30
ret void
}
; CHECK: Valid Region for Scop: bb5.preheader => return

View File

@ -1,123 +0,0 @@
#include <stdio.h>
#include <unistd.h>
#include <string.h>
#include <math.h>
#include "instrument.h"
/* Default problem size. */
#ifndef TSTEPS
# define TSTEPS 20
#endif
#ifndef N
# define N 1024
#endif
/* Default data type is double. */
#ifndef DATA_TYPE
# define DATA_TYPE double
#endif
#ifndef DATA_PRINTF_MODIFIER
# define DATA_PRINTF_MODIFIER "%0.2lf "
#endif
/* Array declaration. Enable malloc if POLYBENCH_TEST_MALLOC. */
#ifndef POLYBENCH_TEST_MALLOC
DATA_TYPE A[N][N];
DATA_TYPE B[N][N];
#else
DATA_TYPE** A = (DATA_TYPE**)malloc(N * sizeof(DATA_TYPE*));
DATA_TYPE** B = (DATA_TYPE**)malloc(N * sizeof(DATA_TYPE*));
{
int i;
for (i = 0; i < N; ++i)
{
A[i] = (DATA_TYPE*)malloc(N * sizeof(DATA_TYPE));
B[i] = (DATA_TYPE*)malloc(N * sizeof(DATA_TYPE));
}
}
#endif
inline
void init_array()
{
int i, j;
for (i = 0; i < N; i++)
for (j = 0; j < N; j++)
{
A[i][j] = ((DATA_TYPE) i*j + 10) / N;
B[i][j] = ((DATA_TYPE) i*j + 11) / N;
}
}
/* Define the live-out variables. Code is not executed unless
POLYBENCH_DUMP_ARRAYS is defined. */
inline
void print_array(int argc, char** argv)
{
int i, j;
#ifndef POLYBENCH_DUMP_ARRAYS
if (argc > 42 && ! strcmp(argv[0], ""))
#endif
{
for (i = 0; i < N; i++)
for (j = 0; j < N; j++) {
fprintf(stderr, DATA_PRINTF_MODIFIER, A[i][j]);
if ((i * N + j) % 80 == 20) fprintf(stderr, "\n");
}
fprintf(stderr, "\n");
}
}
#ifndef SCOP_PARAM
void scop_func() {
long n = N;
#else
void scop_func(long n) {
#endif
long t, i, j;
long tsteps = TSTEPS;
#pragma scop
#pragma live-out A
for (t = 0; t < tsteps; t++)
{
for (i = 2; i < n - 1; i++)
for (j = 2; j < n - 1; j++)
B[i][j] = 0.2 * (A[i][j] + A[i][j-1] + A[i][1+j] + A[1+i][j] + A[i-1][j]);
for (i = 2; i < n-1; i++)
for (j = 2; j < n-1; j++)
A[i][j] = B[i][j];
}
#pragma endscop
}
int main(int argc, char** argv)
{
int t, i, j;
int tsteps = TSTEPS;
int n = N;
/* Initialize array. */
init_array();
/* Start timer. */
polybench_start_instruments;
#ifndef SCOP_PARAM
scop_func();
#else
scop_func(n);
#endif
/* Stop and print timer. */
polybench_stop_instruments;
polybench_print_instruments;
print_array(argc, argv);
return 0;
}

View File

@ -1,106 +0,0 @@
; RUN: opt %loadPolly %defaultOpts -polly-detect -analyze %s | FileCheck %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"
%struct._IO_FILE = type { i32, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, %struct._IO_marker*, %struct._IO_FILE*, i32, i32, i64, i16, i8, [1 x i8], i8*, i64, i8*, i8*, i8*, i8*, i64, i32, [20 x i8] }
%struct._IO_marker = type { %struct._IO_marker*, %struct._IO_FILE*, i32 }
@A = common global [1024 x [1024 x double]] zeroinitializer, align 32
@B = common global [1024 x [1024 x double]] zeroinitializer, align 32
@stderr = external global %struct._IO_FILE*
@.str = private constant [8 x i8] c"%0.2lf \00", align 1
define void @scop_func(i64 %n) nounwind {
bb.nph35:
%0 = add nsw i64 %n, -1
%1 = icmp sgt i64 %0, 2
%tmp = add i64 %n, -3
br label %bb5.preheader
bb.nph: ; preds = %bb.nph.preheader, %bb4
%indvar36 = phi i64 [ %tmp50, %bb4 ], [ 0, %bb.nph.preheader ]
%tmp13 = add i64 %indvar36, 1
%tmp16 = add i64 %indvar36, 3
%tmp18 = add i64 %indvar36, 2
%scevgep40.phi.trans.insert = getelementptr [1024 x [1024 x double]]* @A, i64 0, i64 %tmp18, i64 2
%.pre = load double* %scevgep40.phi.trans.insert, align 16
br label %bb2
bb2: ; preds = %bb2, %bb.nph
%2 = phi double [ %.pre, %bb.nph ], [ %5, %bb2 ]
%indvar = phi i64 [ 0, %bb.nph ], [ %tmp58, %bb2 ]
%tmp14 = add i64 %indvar, 2
%scevgep44 = getelementptr [1024 x [1024 x double]]* @A, i64 0, i64 %tmp13, i64 %tmp14
%scevgep42 = getelementptr [1024 x [1024 x double]]* @A, i64 0, i64 %tmp16, i64 %tmp14
%scevgep = getelementptr [1024 x [1024 x double]]* @B, i64 0, i64 %tmp18, i64 %tmp14
%tmp20 = add i64 %indvar, 3
%scevgep48 = getelementptr [1024 x [1024 x double]]* @A, i64 0, i64 %tmp18, i64 %tmp20
%tmp22 = add i64 %indvar, 1
%scevgep46 = getelementptr [1024 x [1024 x double]]* @A, i64 0, i64 %tmp18, i64 %tmp22
%tmp58 = add i64 %indvar, 1
%3 = load double* %scevgep46, align 8
%4 = fadd double %2, %3
%5 = load double* %scevgep48, align 8
%6 = fadd double %4, %5
%7 = load double* %scevgep42, align 8
%8 = fadd double %6, %7
%9 = load double* %scevgep44, align 8
%10 = fadd double %8, %9
%11 = fmul double %10, 2.000000e-01
store double %11, double* %scevgep, align 8
%exitcond1 = icmp eq i64 %tmp58, %tmp
br i1 %exitcond1, label %bb4, label %bb2
bb4: ; preds = %bb2
%tmp50 = add i64 %indvar36, 1
%exitcond = icmp eq i64 %tmp50, %tmp
br i1 %exitcond, label %bb11.loopexit, label %bb.nph
bb8: ; preds = %bb9.preheader, %bb8
%indvar62 = phi i64 [ %indvar.next63, %bb8 ], [ 0, %bb9.preheader ]
%tmp32 = add i64 %indvar62, 2
%scevgep70 = getelementptr [1024 x [1024 x double]]* @B, i64 0, i64 %tmp31, i64 %tmp32
%scevgep69 = getelementptr [1024 x [1024 x double]]* @A, i64 0, i64 %tmp31, i64 %tmp32
%12 = load double* %scevgep70, align 8
store double %12, double* %scevgep69, align 8
%indvar.next63 = add i64 %indvar62, 1
%exitcond25 = icmp eq i64 %indvar.next63, %tmp
br i1 %exitcond25, label %bb10, label %bb8
bb10: ; preds = %bb8
%indvar.next66 = add i64 %indvar65, 1
%exitcond30 = icmp eq i64 %indvar.next66, %tmp
br i1 %exitcond30, label %bb12.loopexit, label %bb9.preheader
bb11.loopexit: ; preds = %bb4
br i1 %1, label %bb9.preheader.preheader, label %bb12
bb9.preheader.preheader: ; preds = %bb11.loopexit
br label %bb9.preheader
bb9.preheader: ; preds = %bb9.preheader.preheader, %bb10
%indvar65 = phi i64 [ %indvar.next66, %bb10 ], [ 0, %bb9.preheader.preheader ]
%tmp31 = add i64 %indvar65, 2
br label %bb8
bb12.loopexit: ; preds = %bb10
br label %bb12
bb12: ; preds = %bb12.loopexit, %bb5.preheader, %bb11.loopexit
%13 = add nsw i64 %storemerge20, 1
%exitcond35 = icmp eq i64 %13, 20
br i1 %exitcond35, label %return, label %bb5.preheader
bb5.preheader: ; preds = %bb12, %bb.nph35
%storemerge20 = phi i64 [ 0, %bb.nph35 ], [ %13, %bb12 ]
br i1 %1, label %bb.nph.preheader, label %bb12
bb.nph.preheader: ; preds = %bb5.preheader
br label %bb.nph
return: ; preds = %bb12
ret void
}
; CHECK: Valid Region for Scop: bb5.preheader => return

View File

@ -1,92 +0,0 @@
; RUN: opt %loadPolly %defaultOpts -polly-detect -analyze %s | FileCheck %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"
%struct._IO_FILE = type { i32, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, %struct._IO_marker*, %struct._IO_FILE*, i32, i32, i64, i16, i8, [1 x i8], i8*, i64, i8*, i8*, i8*, i8*, i64, i32, [20 x i8] }
%struct._IO_marker = type { %struct._IO_marker*, %struct._IO_FILE*, i32 }
@A = common global [1024 x [1024 x double]] zeroinitializer, align 32
@B = common global [1024 x [1024 x double]] zeroinitializer, align 32
@stderr = external global %struct._IO_FILE*
@.str = private constant [8 x i8] c"%0.2lf \00", align 1
define void @scop_func() nounwind {
bb.nph35:
br label %bb5.preheader
bb.nph: ; preds = %bb5.preheader, %bb4
%indvar36 = phi i64 [ %tmp49, %bb4 ], [ 0, %bb5.preheader ]
%tmp12 = add i64 %indvar36, 1
%tmp15 = add i64 %indvar36, 3
%tmp17 = add i64 %indvar36, 2
%scevgep39.phi.trans.insert = getelementptr [1024 x [1024 x double]]* @A, i64 0, i64 %tmp17, i64 2
%.pre = load double* %scevgep39.phi.trans.insert, align 16
br label %bb2
bb2: ; preds = %bb2, %bb.nph
%0 = phi double [ %.pre, %bb.nph ], [ %3, %bb2 ]
%indvar = phi i64 [ 0, %bb.nph ], [ %tmp57, %bb2 ]
%tmp13 = add i64 %indvar, 2
%scevgep43 = getelementptr [1024 x [1024 x double]]* @A, i64 0, i64 %tmp12, i64 %tmp13
%scevgep41 = getelementptr [1024 x [1024 x double]]* @A, i64 0, i64 %tmp15, i64 %tmp13
%scevgep = getelementptr [1024 x [1024 x double]]* @B, i64 0, i64 %tmp17, i64 %tmp13
%tmp19 = add i64 %indvar, 3
%scevgep47 = getelementptr [1024 x [1024 x double]]* @A, i64 0, i64 %tmp17, i64 %tmp19
%tmp21 = add i64 %indvar, 1
%scevgep45 = getelementptr [1024 x [1024 x double]]* @A, i64 0, i64 %tmp17, i64 %tmp21
%tmp57 = add i64 %indvar, 1
%1 = load double* %scevgep45, align 8
%2 = fadd double %0, %1
%3 = load double* %scevgep47, align 8
%4 = fadd double %2, %3
%5 = load double* %scevgep41, align 8
%6 = fadd double %4, %5
%7 = load double* %scevgep43, align 8
%8 = fadd double %6, %7
%9 = fmul double %8, 2.000000e-01
store double %9, double* %scevgep, align 8
%exitcond1 = icmp eq i64 %tmp57, 1021
br i1 %exitcond1, label %bb4, label %bb2
bb4: ; preds = %bb2
%tmp49 = add i64 %indvar36, 1
%exitcond = icmp eq i64 %tmp49, 1021
br i1 %exitcond, label %bb9.preheader.loopexit, label %bb.nph
bb8: ; preds = %bb9.preheader, %bb8
%indvar61 = phi i64 [ %indvar.next62, %bb8 ], [ 0, %bb9.preheader ]
%tmp30 = add i64 %indvar61, 2
%scevgep68 = getelementptr [1024 x [1024 x double]]* @B, i64 0, i64 %tmp29, i64 %tmp30
%scevgep67 = getelementptr [1024 x [1024 x double]]* @A, i64 0, i64 %tmp29, i64 %tmp30
%10 = load double* %scevgep68, align 8
store double %10, double* %scevgep67, align 8
%indvar.next62 = add i64 %indvar61, 1
%exitcond24 = icmp eq i64 %indvar.next62, 1021
br i1 %exitcond24, label %bb10, label %bb8
bb10: ; preds = %bb8
%indvar.next65 = add i64 %indvar64, 1
%exitcond28 = icmp eq i64 %indvar.next65, 1021
br i1 %exitcond28, label %bb12, label %bb9.preheader
bb9.preheader.loopexit: ; preds = %bb4
br label %bb9.preheader
bb9.preheader: ; preds = %bb9.preheader.loopexit, %bb10
%indvar64 = phi i64 [ %indvar.next65, %bb10 ], [ 0, %bb9.preheader.loopexit ]
%tmp29 = add i64 %indvar64, 2
br label %bb8
bb12: ; preds = %bb10
%11 = add nsw i64 %storemerge20, 1
%exitcond33 = icmp eq i64 %11, 20
br i1 %exitcond33, label %return, label %bb5.preheader
bb5.preheader: ; preds = %bb12, %bb.nph35
%storemerge20 = phi i64 [ 0, %bb.nph35 ], [ %11, %bb12 ]
br label %bb.nph
return: ; preds = %bb12
ret void
}
; CHECK: Valid Region for Scop: bb5.preheader => return

View File

@ -1,112 +0,0 @@
#include <stdio.h>
#include <unistd.h>
#include <string.h>
#include <math.h>
#include "instrument.h"
/* Default problem size. */
#ifndef TSTEPS
# define TSTEPS 20
#endif
#ifndef N
# define N 1024
#endif
/* Default data type is double. */
#ifndef DATA_TYPE
# define DATA_TYPE double
#endif
#ifndef DATA_PRINTF_MODIFIER
# define DATA_PRINTF_MODIFIER "%0.2lf "
#endif
/* Array declaration. Enable malloc if POLYBENCH_TEST_MALLOC. */
#ifndef POLYBENCH_TEST_MALLOC
DATA_TYPE A[N][N];
#else
DATA_TYPE** A = (DATA_TYPE**)malloc(N * sizeof(DATA_TYPE*));
{
int i;
for (i = 0; i < N; ++i)
A[i] = (DATA_TYPE*)malloc(N * sizeof(DATA_TYPE));
}
#endif
inline
void init_array()
{
int i, j;
for (i = 0; i < N; i++)
for (j = 0; j < N; j++)
A[i][j] = ((DATA_TYPE) i*j + 10) / N;
}
/* Define the live-out variables. Code is not executed unless
POLYBENCH_DUMP_ARRAYS is defined. */
inline
void print_array(int argc, char** argv)
{
int i, j;
#ifndef POLYBENCH_DUMP_ARRAYS
if (argc > 42 && ! strcmp(argv[0], ""))
#endif
{
for (i = 0; i < N; i++)
for (j = 0; j < N; j++) {
fprintf(stderr, DATA_PRINTF_MODIFIER, A[i][j]);
if ((i * N + j) % 80 == 20) fprintf(stderr, "\n");
}
fprintf(stderr, "\n");
}
}
#ifndef SCOP_PARAM
void scop_func() {
long n = N;
#else
void scop_func(long n) {
#endif
long t, i, j;
long tsteps = TSTEPS;
#pragma scop
#pragma live-out A
for (t = 0; t <= tsteps - 1; t++)
for (i = 1; i<= n - 2; i++)
for (j = 1; j <= n - 2; j++)
A[i][j] = (A[i-1][j-1] + A[i-1][j] + A[i-1][j+1]
+ A[i][j-1] + A[i][j] + A[i][j+1]
+ A[i+1][j-1] + A[i+1][j] + A[i+1][j+1])/9.0;
#pragma endscop
}
int main(int argc, char** argv)
{
int t, i, j;
int tsteps = TSTEPS;
int n = N;
/* Initialize array. */
init_array();
/* Start timer. */
polybench_start_instruments;
#ifndef SCOP_PARAM
scop_func();
#else
scop_func(n);
#endif
/* Stop and print timer. */
polybench_stop_instruments;
polybench_print_instruments;
print_array(argc, argv);
return 0;
}

View File

@ -1,95 +0,0 @@
; RUN: opt %loadPolly %defaultOpts -polly-analyze-ir -print-top-scop-only -analyze %s | FileCheck %s
; XFAIL: *
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"
%struct._IO_FILE = type { i32, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, %struct._IO_marker*, %struct._IO_FILE*, i32, i32, i64, i16, i8, [1 x i8], i8*, i64, i8*, i8*, i8*, i8*, i64, i32, [20 x i8] }
%struct._IO_marker = type { %struct._IO_marker*, %struct._IO_FILE*, i32 }
@A = common global [1024 x [1024 x double]] zeroinitializer, align 32
@stderr = external global %struct._IO_FILE*
@.str = private constant [8 x i8] c"%0.2lf \00", align 1
define void @scop_func(i64 %n) nounwind {
bb.nph20:
%0 = add nsw i64 %n, -2
%1 = icmp slt i64 %0, 1
br i1 %1, label %return, label %bb.nph8.preheader
bb.nph8.preheader: ; preds = %bb.nph20
br label %bb.nph8
bb.nph: ; preds = %bb.nph.preheader, %bb4
%indvar21 = phi i64 [ %tmp39, %bb4 ], [ 0, %bb.nph.preheader ]
%tmp5 = add i64 %indvar21, 1
%tmp43 = add i64 %indvar21, 2
%scevgep26.phi.trans.insert = getelementptr [1024 x [1024 x double]]* @A, i64 0, i64 %indvar21, i64 1
%scevgep.phi.trans.insert = getelementptr [1024 x [1024 x double]]* @A, i64 0, i64 %tmp43, i64 1
%scevgep30.phi.trans.insert = getelementptr [1024 x [1024 x double]]* @A, i64 0, i64 %tmp5, i64 0
%scevgep25.phi.trans.insert = getelementptr [1024 x [1024 x double]]* @A, i64 0, i64 %tmp5, i64 1
%tmp39 = add i64 %indvar21, 1
%.pre = load double* %scevgep26.phi.trans.insert, align 8
%.pre47 = load double* %scevgep25.phi.trans.insert, align 8
%.pre48 = load double* %scevgep.phi.trans.insert, align 8
%.pre49 = load double* %scevgep30.phi.trans.insert, align 32
br label %bb2
bb2: ; preds = %bb2, %bb.nph
%2 = phi double [ %.pre49, %bb.nph ], [ %19, %bb2 ]
%3 = phi double [ %.pre48, %bb.nph ], [ %17, %bb2 ]
%4 = phi double [ %.pre47, %bb.nph ], [ %12, %bb2 ]
%5 = phi double [ %.pre, %bb.nph ], [ %8, %bb2 ]
%indvar = phi i64 [ 0, %bb.nph ], [ %tmp37, %bb2 ]
%tmp4 = add i64 %indvar, 2
%scevgep29 = getelementptr [1024 x [1024 x double]]* @A, i64 0, i64 %indvar21, i64 %tmp4
%scevgep27 = getelementptr [1024 x [1024 x double]]* @A, i64 0, i64 %indvar21, i64 %indvar
%scevgep31 = getelementptr [1024 x [1024 x double]]* @A, i64 0, i64 %tmp5, i64 %tmp4
%tmp6 = add i64 %indvar, 1
%scevgep25 = getelementptr [1024 x [1024 x double]]* @A, i64 0, i64 %tmp5, i64 %tmp6
%scevgep33 = getelementptr [1024 x [1024 x double]]* @A, i64 0, i64 %tmp43, i64 %tmp4
%scevgep32 = getelementptr [1024 x [1024 x double]]* @A, i64 0, i64 %tmp43, i64 %indvar
%tmp34 = add i64 %indvar, 2
%tmp37 = add i64 %indvar, 1
%6 = load double* %scevgep27, align 8
%7 = fadd double %6, %5
%8 = load double* %scevgep29, align 8
%9 = fadd double %7, %8
%10 = fadd double %9, %2
%11 = fadd double %10, %4
%12 = load double* %scevgep31, align 8
%13 = fadd double %11, %12
%14 = load double* %scevgep32, align 8
%15 = fadd double %13, %14
%16 = fadd double %15, %3
%17 = load double* %scevgep33, align 8
%18 = fadd double %16, %17
%19 = fdiv double %18, 9.000000e+00
store double %19, double* %scevgep25, align 8
%20 = icmp slt i64 %0, %tmp34
br i1 %20, label %bb4, label %bb2
bb4: ; preds = %bb2
%21 = icmp slt i64 %0, %tmp43
br i1 %21, label %bb6.loopexit, label %bb.nph
bb.nph8: ; preds = %bb.nph8.preheader, %bb6
%storemerge9 = phi i64 [ %22, %bb6 ], [ 0, %bb.nph8.preheader ]
br i1 %1, label %bb6, label %bb.nph.preheader
bb.nph.preheader: ; preds = %bb.nph8
br label %bb.nph
bb6.loopexit: ; preds = %bb4
br label %bb6
bb6: ; preds = %bb6.loopexit, %bb.nph8
%22 = add nsw i64 %storemerge9, 1
%exitcond8 = icmp eq i64 %22, 20
br i1 %exitcond8, label %return.loopexit, label %bb.nph8
return.loopexit: ; preds = %bb6
br label %return
return: ; preds = %return.loopexit, %bb.nph20
ret void
}

View File

@ -1,80 +0,0 @@
; RUN: opt %loadPolly %defaultOpts -polly-detect -analyze %s | FileCheck %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"
%struct._IO_FILE = type { i32, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, i8*, %struct._IO_marker*, %struct._IO_FILE*, i32, i32, i64, i16, i8, [1 x i8], i8*, i64, i8*, i8*, i8*, i8*, i64, i32, [20 x i8] }
%struct._IO_marker = type { %struct._IO_marker*, %struct._IO_FILE*, i32 }
@A = common global [1024 x [1024 x double]] zeroinitializer, align 32
@stderr = external global %struct._IO_FILE*
@.str = private constant [8 x i8] c"%0.2lf \00", align 1
define void @scop_func() nounwind {
bb.nph20.bb.nph20.split_crit_edge:
br label %bb5.preheader
bb.nph: ; preds = %bb5.preheader, %bb4
%indvar21 = phi i64 [ %tmp40, %bb4 ], [ 0, %bb5.preheader ]
%tmp6 = add i64 %indvar21, 1
%tmp8 = add i64 %indvar21, 2
%scevgep26.phi.trans.insert = getelementptr [1024 x [1024 x double]]* @A, i64 0, i64 %indvar21, i64 1
%scevgep.phi.trans.insert = getelementptr [1024 x [1024 x double]]* @A, i64 0, i64 %tmp8, i64 1
%scevgep30.phi.trans.insert = getelementptr [1024 x [1024 x double]]* @A, i64 0, i64 %tmp6, i64 0
%scevgep25.phi.trans.insert = getelementptr [1024 x [1024 x double]]* @A, i64 0, i64 %tmp6, i64 1
%tmp40 = add i64 %indvar21, 1
%.pre = load double* %scevgep26.phi.trans.insert, align 8
%.pre49 = load double* %scevgep25.phi.trans.insert, align 8
%.pre50 = load double* %scevgep.phi.trans.insert, align 8
%.pre51 = load double* %scevgep30.phi.trans.insert, align 32
br label %bb2
bb2: ; preds = %bb2, %bb.nph
%0 = phi double [ %.pre51, %bb.nph ], [ %17, %bb2 ]
%1 = phi double [ %.pre50, %bb.nph ], [ %15, %bb2 ]
%2 = phi double [ %.pre49, %bb.nph ], [ %10, %bb2 ]
%3 = phi double [ %.pre, %bb.nph ], [ %6, %bb2 ]
%indvar = phi i64 [ 0, %bb.nph ], [ %tmp38, %bb2 ]
%tmp5 = add i64 %indvar, 2
%scevgep29 = getelementptr [1024 x [1024 x double]]* @A, i64 0, i64 %indvar21, i64 %tmp5
%scevgep27 = getelementptr [1024 x [1024 x double]]* @A, i64 0, i64 %indvar21, i64 %indvar
%scevgep31 = getelementptr [1024 x [1024 x double]]* @A, i64 0, i64 %tmp6, i64 %tmp5
%tmp7 = add i64 %indvar, 1
%scevgep25 = getelementptr [1024 x [1024 x double]]* @A, i64 0, i64 %tmp6, i64 %tmp7
%scevgep33 = getelementptr [1024 x [1024 x double]]* @A, i64 0, i64 %tmp8, i64 %tmp5
%scevgep32 = getelementptr [1024 x [1024 x double]]* @A, i64 0, i64 %tmp8, i64 %indvar
%tmp38 = add i64 %indvar, 1
%4 = load double* %scevgep27, align 8
%5 = fadd double %4, %3
%6 = load double* %scevgep29, align 8
%7 = fadd double %5, %6
%8 = fadd double %7, %0
%9 = fadd double %8, %2
%10 = load double* %scevgep31, align 8
%11 = fadd double %9, %10
%12 = load double* %scevgep32, align 8
%13 = fadd double %11, %12
%14 = fadd double %13, %1
%15 = load double* %scevgep33, align 8
%16 = fadd double %14, %15
%17 = fdiv double %16, 9.000000e+00
store double %17, double* %scevgep25, align 8
%exitcond1 = icmp eq i64 %tmp38, 1022
br i1 %exitcond1, label %bb4, label %bb2
bb4: ; preds = %bb2
%exitcond = icmp eq i64 %tmp40, 1022
br i1 %exitcond, label %bb6, label %bb.nph
bb6: ; preds = %bb4
%18 = add nsw i64 %storemerge9, 1
%exitcond9 = icmp eq i64 %18, 20
br i1 %exitcond9, label %return, label %bb5.preheader
bb5.preheader: ; preds = %bb6, %bb.nph20.bb.nph20.split_crit_edge
%storemerge9 = phi i64 [ 0, %bb.nph20.bb.nph20.split_crit_edge ], [ %18, %bb6 ]
br label %bb.nph
return: ; preds = %bb6
ret void
}
; CHECK: Valid Region for Scop: bb5.preheader => return

View File

@ -1,87 +0,0 @@
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <assert.h>
#include <time.h>
#include <sys/time.h>
#include <sys/resource.h>
#include <sched.h>
#include <math.h>
#ifndef POLYBENCH_CACHE_SIZE_KB
# define POLYBENCH_CACHE_SIZE_KB 8192
#endif
/* Timer code (gettimeofday). */
double polybench_t_start, polybench_t_end;
static
inline
double rtclock()
{
struct timezone Tzp;
struct timeval Tp;
int stat;
stat = gettimeofday (&Tp, &Tzp);
if (stat != 0)
printf("Error return from gettimeofday: %d", stat);
return (Tp.tv_sec + Tp.tv_usec * 1.0e-6);
}
inline
void polybench_flush_cache()
{
int cs = POLYBENCH_CACHE_SIZE_KB * 1024 / sizeof(double);
double* flush = (double*) calloc(cs, sizeof(double));
int i;
double tmp = 0.0;
for (i = 0; i < cs; i++)
tmp += flush[i];
/* This prevents DCE on the cache flush code. */
assert (tmp <= 10.0);
}
#ifdef POLYBENCH_LINUX_FIFO_SCHEDULER
inline
void polybench_linux_fifo_scheduler()
{
/* Use FIFO scheduler to limit OS interference. Program must be run
as root, and this works only for Linux kernels. */
struct sched_param schedParam;
schedParam.sched_priority = sched_get_priority_max(SCHED_FIFO);
sched_setscheduler(0, SCHED_FIFO, &schedParam);
}
inline
void polybench_linux_standard_scheduler()
{
/* Restore to standard scheduler policy. */
struct sched_param schedParam;
schedParam.sched_priority = sched_get_priority_max(SCHED_OTHER);
sched_setscheduler(0, SCHED_OTHER, &schedParam);
}
#endif
void polybench_timer_start()
{
#ifndef POLYBENCH_NO_FLUSH_CACHE
polybench_flush_cache();
#endif
#ifdef POLYBENCH_LINUX_FIFO_SCHEDULER
polybench_linux_fifo_scheduler();
#endif
polybench_t_start = rtclock();
}
void polybench_timer_stop()
{
#ifdef POLYBENCH_LINUX_FIFO_SCHEDULER
polybench_linux_standard_scheduler();
#endif
polybench_t_end = rtclock();
}
void polybench_timer_print()
{
printf("%0.6lfs\n", polybench_t_end - polybench_t_start);
}

View File

@ -1,99 +0,0 @@
#include <stdio.h>
#include <unistd.h>
#include <string.h>
#include <math.h>
#include "instrument.h"
/* Default problem size. */
#ifndef NX
# define NX 8000
#endif
#ifnef NY
# define NY 8000
#endif
/* Default data type is double. */
#ifndef DATA_TYPE
# define DATA_TYPE double
#endif
/* Array declaration. Enable malloc if POLYBENCH_TEST_MALLOC. */
#ifndef POLYBENCH_TEST_MALLOC
DATA_TYPE A[nx][ny];
DATA_TYPE x[ny];
DATA_TYPE y[ny];
DATA_TYPE tmp[nx];
#else
DATA_TYPE** A = (DATA_TYPE**)malloc(nx * sizeof(DATA_TYPE*));
DATA_TYPE* x = (DATA_TYPE*)malloc(ny * sizeof(DATA_TYPE));
DATA_TYPE* y = (DATA_TYPE*)malloc(ny * sizeof(DATA_TYPE));
DATA_TYPE* tmp = (DATA_TYPE*)malloc(nx * sizeof(DATA_TYPE));
{
int i;
for (i = 0; i < nx; ++i)
A[i] = (DATA_TYPE*)malloc(ny * sizeof(DATA_TYPE));
}
#endif
inline
void init_array()
{
int i, j;
for (i = 0; i < nx; i++)
{
x[i] = i * M_PI;
for (j = 0; j < ny; j++)
A[i][j] = ((DATA_TYPE) i*j) / nx;
}
}
/* Define the live-out variables. Code is not executed unless
POLYBENCH_DUMP_ARRAYS is defined. */
inline
void print_array(int argc, char** argv)
{
int i, j;
#ifndef POLYBENCH_DUMP_ARRAYS
if (argc > 42 && ! strcmp(argv[0], ""))
#endif
{
for (i = 0; i < nx; i++) {
fprintf(stderr, "%0.2lf ", y[i]);
if (i%80 == 20) fprintf(stderr, "\n");
}
fprintf(stderr, "\n");
}
}
int main(int argc, char** argv)
{
int i, j;
int nx = NX;
int ny = NY;
/* Initialize array. */
init_array();
/* Start timer. */
polybench_start_instruments;
#pragma scop
#pragma live-out
#pragma endscop
/* Stop and print timer. */
polybench_stop_instruments;
polybench_print_instruments;
print_array(argc, argv);
return 0;
}