[llvm-commits] [test-suite] r159553 - in /test-suite/trunk/SingleSource/Benchmarks/Polybench: ./ datamining/ datamining/correlation/ datamining/covariance/ linear-algebra/ linear-algebra/kernels/ linear-algebra/kernels/2mm/ linear-algebra/kernels/3mm/ linear-algebra/kernels/atax/ linear-algebra/kernels/bicg/ linear-algebra/kernels/cholesky/ linear-algebra/kernels/doitgen/ linear-algebra/kernels/gemm/ linear-algebra/kernels/gemver/ linear-algebra/kernels/gesummv/ linear-algebra/kernels/mvt/ linear-algebra/kernels/symm/ ...

Jim Grosbach grosbach at apple.com
Mon Jul 2 15:41:05 PDT 2012


Hi Tobias,

There are a lot of misplaced permission bits in this commit. Pretty much everything was added with the 'executable' property set, which is definitely not correct.

-Jim

On Jul 2, 2012, at 12:27 PM, Tobias Grosser <grosser at fim.uni-passau.de> wrote:

> Author: grosser
> Date: Mon Jul  2 14:27:28 2012
> New Revision: 159553
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=159553&view=rev
> Log:
> Add Polybench 3.2 to the test suite.
> 
> Polybench 3.2 contains computations kernels from datamining, linear-algebra,
> stencils computations. Polybench is available from sourceforge under the GPLv2
> license.
> 
> Contributed by:  Douglas do Couto Teixeira  <douglasdocouto at gmail.com>
> 
> Added:
>    test-suite/trunk/SingleSource/Benchmarks/Polybench/
>    test-suite/trunk/SingleSource/Benchmarks/Polybench/AUTHORS   (with props)
>    test-suite/trunk/SingleSource/Benchmarks/Polybench/LICENSE
>    test-suite/trunk/SingleSource/Benchmarks/Polybench/Makefile   (with props)
>    test-suite/trunk/SingleSource/Benchmarks/Polybench/README   (with props)
>    test-suite/trunk/SingleSource/Benchmarks/Polybench/datamining/
>    test-suite/trunk/SingleSource/Benchmarks/Polybench/datamining/Makefile   (with props)
>    test-suite/trunk/SingleSource/Benchmarks/Polybench/datamining/correlation/
>    test-suite/trunk/SingleSource/Benchmarks/Polybench/datamining/correlation/Makefile   (with props)
>    test-suite/trunk/SingleSource/Benchmarks/Polybench/datamining/correlation/correlation.c   (with props)
>    test-suite/trunk/SingleSource/Benchmarks/Polybench/datamining/correlation/correlation.h   (with props)
>    test-suite/trunk/SingleSource/Benchmarks/Polybench/datamining/correlation/correlation.reference_output   (with props)
>    test-suite/trunk/SingleSource/Benchmarks/Polybench/datamining/covariance/
>    test-suite/trunk/SingleSource/Benchmarks/Polybench/datamining/covariance/Makefile   (with props)
>    test-suite/trunk/SingleSource/Benchmarks/Polybench/datamining/covariance/covariance.c   (with props)
>    test-suite/trunk/SingleSource/Benchmarks/Polybench/datamining/covariance/covariance.h   (with props)
>    test-suite/trunk/SingleSource/Benchmarks/Polybench/datamining/covariance/covariance.reference_output   (with props)
>    test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/
>    test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/Makefile   (with props)
>    test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/
>    test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/2mm/
>    test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/2mm/2mm.c   (with props)
>    test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/2mm/2mm.h   (with props)
>    test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/2mm/2mm.reference_output   (with props)
>    test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/2mm/Makefile   (with props)
>    test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/2mm/compiler.opts   (with props)
>    test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/3mm/
>    test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/3mm/3mm.c   (with props)
>    test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/3mm/3mm.h   (with props)
>    test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/3mm/3mm.reference_output   (with props)
>    test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/3mm/Makefile   (with props)
>    test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/3mm/compiler.opts   (with props)
>    test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/Makefile   (with props)
>    test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/atax/
>    test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/atax/Makefile   (with props)
>    test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/atax/atax.c   (with props)
>    test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/atax/atax.h   (with props)
>    test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/atax/atax.reference_output   (with props)
>    test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/bicg/
>    test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/bicg/Makefile   (with props)
>    test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/bicg/bicg.c   (with props)
>    test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/bicg/bicg.h   (with props)
>    test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/bicg/bicg.reference_output   (with props)
>    test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/cholesky/
>    test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/cholesky/Makefile   (with props)
>    test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/cholesky/cholesky.c   (with props)
>    test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/cholesky/cholesky.h   (with props)
>    test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/cholesky/cholesky.reference_output   (with props)
>    test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/doitgen/
>    test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/doitgen/Makefile   (with props)
>    test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/doitgen/doitgen.c   (with props)
>    test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/doitgen/doitgen.h   (with props)
>    test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/doitgen/doitgen.reference_output   (with props)
>    test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/gemm/
>    test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/gemm/Makefile   (with props)
>    test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/gemm/gemm.c   (with props)
>    test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/gemm/gemm.h   (with props)
>    test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/gemm/gemm.reference_output   (with props)
>    test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/gemver/
>    test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/gemver/Makefile   (with props)
>    test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/gemver/gemver.c   (with props)
>    test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/gemver/gemver.h   (with props)
>    test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/gemver/gemver.reference_output   (with props)
>    test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/gesummv/
>    test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/gesummv/Makefile   (with props)
>    test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/gesummv/gesummv.c   (with props)
>    test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/gesummv/gesummv.h   (with props)
>    test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/gesummv/gesummv.reference_output   (with props)
>    test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/mvt/
>    test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/mvt/Makefile   (with props)
>    test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/mvt/mvt.c   (with props)
>    test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/mvt/mvt.h   (with props)
>    test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/mvt/mvt.reference_output   (with props)
>    test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/symm/
>    test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/symm/Makefile   (with props)
>    test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/symm/symm.c   (with props)
>    test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/symm/symm.h   (with props)
>    test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/symm/symm.reference_output   (with props)
>    test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/syr2k/
>    test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/syr2k/Makefile   (with props)
>    test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/syr2k/syr2k.c   (with props)
>    test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/syr2k/syr2k.h   (with props)
>    test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/syr2k/syr2k.reference_output   (with props)
>    test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/syrk/
>    test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/syrk/Makefile   (with props)
>    test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/syrk/syrk.c   (with props)
>    test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/syrk/syrk.h   (with props)
>    test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/syrk/syrk.reference_output   (with props)
>    test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/trisolv/
>    test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/trisolv/Makefile   (with props)
>    test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/trisolv/trisolv.c   (with props)
>    test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/trisolv/trisolv.h   (with props)
>    test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/trisolv/trisolv.reference_output   (with props)
>    test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/trmm/
>    test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/trmm/Makefile   (with props)
>    test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/trmm/trmm.c   (with props)
>    test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/trmm/trmm.h   (with props)
>    test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/trmm/trmm.reference_output   (with props)
>    test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/solvers/
>    test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/solvers/Makefile   (with props)
>    test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/solvers/durbin/
>    test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/solvers/durbin/Makefile   (with props)
>    test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/solvers/durbin/durbin.c   (with props)
>    test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/solvers/durbin/durbin.h   (with props)
>    test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/solvers/durbin/durbin.reference_output   (with props)
>    test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/solvers/dynprog/
>    test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/solvers/dynprog/Makefile   (with props)
>    test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/solvers/dynprog/dynprog.c   (with props)
>    test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/solvers/dynprog/dynprog.h   (with props)
>    test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/solvers/dynprog/dynprog.reference_output   (with props)
>    test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/solvers/gramschmidt/
>    test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/solvers/gramschmidt/Makefile   (with props)
>    test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/solvers/gramschmidt/gramschmidt.c   (with props)
>    test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/solvers/gramschmidt/gramschmidt.h   (with props)
>    test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/solvers/gramschmidt/gramschmidt.reference_output   (with props)
>    test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/solvers/lu/
>    test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/solvers/lu/Makefile   (with props)
>    test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/solvers/lu/lu.c   (with props)
>    test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/solvers/lu/lu.h   (with props)
>    test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/solvers/lu/lu.reference_output   (with props)
>    test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/solvers/ludcmp/
>    test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/solvers/ludcmp/Makefile   (with props)
>    test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/solvers/ludcmp/ludcmp.c   (with props)
>    test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/solvers/ludcmp/ludcmp.h   (with props)
>    test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/solvers/ludcmp/ludcmp.reference_output   (with props)
>    test-suite/trunk/SingleSource/Benchmarks/Polybench/medley/
>    test-suite/trunk/SingleSource/Benchmarks/Polybench/medley/Makefile   (with props)
>    test-suite/trunk/SingleSource/Benchmarks/Polybench/medley/floyd-warshall/
>    test-suite/trunk/SingleSource/Benchmarks/Polybench/medley/floyd-warshall/Makefile   (with props)
>    test-suite/trunk/SingleSource/Benchmarks/Polybench/medley/floyd-warshall/floyd-warshall.c   (with props)
>    test-suite/trunk/SingleSource/Benchmarks/Polybench/medley/floyd-warshall/floyd-warshall.h   (with props)
>    test-suite/trunk/SingleSource/Benchmarks/Polybench/medley/floyd-warshall/floyd-warshall.reference_output   (with props)
>    test-suite/trunk/SingleSource/Benchmarks/Polybench/medley/reg_detect/
>    test-suite/trunk/SingleSource/Benchmarks/Polybench/medley/reg_detect/Makefile   (with props)
>    test-suite/trunk/SingleSource/Benchmarks/Polybench/medley/reg_detect/reg_detect.c   (with props)
>    test-suite/trunk/SingleSource/Benchmarks/Polybench/medley/reg_detect/reg_detect.h   (with props)
>    test-suite/trunk/SingleSource/Benchmarks/Polybench/medley/reg_detect/reg_detect.reference_output   (with props)
>    test-suite/trunk/SingleSource/Benchmarks/Polybench/stencils/
>    test-suite/trunk/SingleSource/Benchmarks/Polybench/stencils/Makefile   (with props)
>    test-suite/trunk/SingleSource/Benchmarks/Polybench/stencils/adi/
>    test-suite/trunk/SingleSource/Benchmarks/Polybench/stencils/adi/Makefile   (with props)
>    test-suite/trunk/SingleSource/Benchmarks/Polybench/stencils/adi/adi.c   (with props)
>    test-suite/trunk/SingleSource/Benchmarks/Polybench/stencils/adi/adi.h   (with props)
>    test-suite/trunk/SingleSource/Benchmarks/Polybench/stencils/adi/adi.reference_output   (with props)
>    test-suite/trunk/SingleSource/Benchmarks/Polybench/stencils/fdtd-2d/
>    test-suite/trunk/SingleSource/Benchmarks/Polybench/stencils/fdtd-2d/Makefile   (with props)
>    test-suite/trunk/SingleSource/Benchmarks/Polybench/stencils/fdtd-2d/fdtd-2d.c   (with props)
>    test-suite/trunk/SingleSource/Benchmarks/Polybench/stencils/fdtd-2d/fdtd-2d.h   (with props)
>    test-suite/trunk/SingleSource/Benchmarks/Polybench/stencils/fdtd-2d/fdtd-2d.reference_output   (with props)
>    test-suite/trunk/SingleSource/Benchmarks/Polybench/stencils/fdtd-apml/
>    test-suite/trunk/SingleSource/Benchmarks/Polybench/stencils/fdtd-apml/Makefile   (with props)
>    test-suite/trunk/SingleSource/Benchmarks/Polybench/stencils/fdtd-apml/fdtd-apml.c   (with props)
>    test-suite/trunk/SingleSource/Benchmarks/Polybench/stencils/fdtd-apml/fdtd-apml.h   (with props)
>    test-suite/trunk/SingleSource/Benchmarks/Polybench/stencils/fdtd-apml/fdtd-apml.reference_output   (with props)
>    test-suite/trunk/SingleSource/Benchmarks/Polybench/stencils/jacobi-1d-imper/
>    test-suite/trunk/SingleSource/Benchmarks/Polybench/stencils/jacobi-1d-imper/Makefile   (with props)
>    test-suite/trunk/SingleSource/Benchmarks/Polybench/stencils/jacobi-1d-imper/jacobi-1d-imper.c   (with props)
>    test-suite/trunk/SingleSource/Benchmarks/Polybench/stencils/jacobi-1d-imper/jacobi-1d-imper.h   (with props)
>    test-suite/trunk/SingleSource/Benchmarks/Polybench/stencils/jacobi-1d-imper/jacobi-1d-imper.reference_output   (with props)
>    test-suite/trunk/SingleSource/Benchmarks/Polybench/stencils/jacobi-2d-imper/
>    test-suite/trunk/SingleSource/Benchmarks/Polybench/stencils/jacobi-2d-imper/Makefile   (with props)
>    test-suite/trunk/SingleSource/Benchmarks/Polybench/stencils/jacobi-2d-imper/jacobi-2d-imper.c   (with props)
>    test-suite/trunk/SingleSource/Benchmarks/Polybench/stencils/jacobi-2d-imper/jacobi-2d-imper.h   (with props)
>    test-suite/trunk/SingleSource/Benchmarks/Polybench/stencils/jacobi-2d-imper/jacobi-2d-imper.reference_output   (with props)
>    test-suite/trunk/SingleSource/Benchmarks/Polybench/stencils/seidel-2d/
>    test-suite/trunk/SingleSource/Benchmarks/Polybench/stencils/seidel-2d/Makefile   (with props)
>    test-suite/trunk/SingleSource/Benchmarks/Polybench/stencils/seidel-2d/seidel-2d.c   (with props)
>    test-suite/trunk/SingleSource/Benchmarks/Polybench/stencils/seidel-2d/seidel-2d.h   (with props)
>    test-suite/trunk/SingleSource/Benchmarks/Polybench/stencils/seidel-2d/seidel-2d.reference_output   (with props)
>    test-suite/trunk/SingleSource/Benchmarks/Polybench/utilities/
>    test-suite/trunk/SingleSource/Benchmarks/Polybench/utilities/benchmark_list   (with props)
>    test-suite/trunk/SingleSource/Benchmarks/Polybench/utilities/create_cpped_version.sh   (with props)
>    test-suite/trunk/SingleSource/Benchmarks/Polybench/utilities/papi_counters.list   (with props)
>    test-suite/trunk/SingleSource/Benchmarks/Polybench/utilities/polybench.c   (with props)
>    test-suite/trunk/SingleSource/Benchmarks/Polybench/utilities/polybench.h   (with props)
>    test-suite/trunk/SingleSource/Benchmarks/Polybench/utilities/template-for-new-benchmark.c   (with props)
>    test-suite/trunk/SingleSource/Benchmarks/Polybench/utilities/template-for-new-benchmark.h   (with props)
>    test-suite/trunk/SingleSource/Benchmarks/Polybench/utilities/time_benchmark.sh   (with props)
> 
> Added: test-suite/trunk/SingleSource/Benchmarks/Polybench/AUTHORS
> URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/Benchmarks/Polybench/AUTHORS?rev=159553&view=auto
> ==============================================================================
> --- test-suite/trunk/SingleSource/Benchmarks/Polybench/AUTHORS (added)
> +++ test-suite/trunk/SingleSource/Benchmarks/Polybench/AUTHORS Mon Jul  2 14:27:28 2012
> @@ -0,0 +1,14 @@
> +* * * * * * * * * * * * *
> +* Authors of PolyBench  *
> +* * * * * * * * * * * * *
> +
> +
> +* Louis-Noel Pouchet <pouchet at cse.ohio-state.edu>
> +  Who provided packaging and harmonization of all test files,
> +  the PolyBench infrastructure and machinery, and several
> +  reference C files.
> +
> +* Uday Bondugula <uday at csa.iisc.ernet.in>
> +  Who provided many of the original reference C files, including
> +  Fortran to C translation.
> +
> 
> Propchange: test-suite/trunk/SingleSource/Benchmarks/Polybench/AUTHORS
> ------------------------------------------------------------------------------
>    svn:executable = *
> 
> Added: test-suite/trunk/SingleSource/Benchmarks/Polybench/LICENSE
> URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/Benchmarks/Polybench/LICENSE?rev=159553&view=auto
> ==============================================================================
> --- test-suite/trunk/SingleSource/Benchmarks/Polybench/LICENSE (added)
> +++ test-suite/trunk/SingleSource/Benchmarks/Polybench/LICENSE Mon Jul  2 14:27:28 2012
> @@ -0,0 +1,2 @@
> +The Polybench 3.2 benchmark was obtained from sourceforge.org, where it is
> +available under the GPLv2.
> 
> Added: test-suite/trunk/SingleSource/Benchmarks/Polybench/Makefile
> URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/Benchmarks/Polybench/Makefile?rev=159553&view=auto
> ==============================================================================
> --- test-suite/trunk/SingleSource/Benchmarks/Polybench/Makefile (added)
> +++ test-suite/trunk/SingleSource/Benchmarks/Polybench/Makefile Mon Jul  2 14:27:28 2012
> @@ -0,0 +1,8 @@
> +LEVEL = ../../..
> +
> +PARALLEL_DIRS  := datamining linear-algebra medley stencils
> +
> +include $(LEVEL)/Makefile.config
> +include $(LEVEL)/Makefile.programs
> +
> +
> 
> Propchange: test-suite/trunk/SingleSource/Benchmarks/Polybench/Makefile
> ------------------------------------------------------------------------------
>    svn:executable = *
> 
> Added: test-suite/trunk/SingleSource/Benchmarks/Polybench/README
> URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/Benchmarks/Polybench/README?rev=159553&view=auto
> ==============================================================================
> --- test-suite/trunk/SingleSource/Benchmarks/Polybench/README (added)
> +++ test-suite/trunk/SingleSource/Benchmarks/Polybench/README Mon Jul  2 14:27:28 2012
> @@ -0,0 +1,233 @@
> +* * * * * * * * * *
> +* PolyBench/C 3.2 *
> +* * * * * * * * * *
> +
> +Copyright (c) 2011-2012 the Ohio State University.
> +Contact: Louis-Noel Pouchet <pouchet at cse.ohio-state.edu>
> +
> +
> +-------------
> +* New in 3.2:
> +-------------
> +
> +- Rename the package to PolyBench/C, to prepare for the upcoming
> +  PolyBench/Fortran and PolyBench/GPU.
> +- Fixed a typo in polybench.h, causing compilation problems for 5D arrays.
> +- Fixed minor typos in correlation, atax, cholesky, fdtd-2d.
> +- Added an option to build the test suite with constant loop bounds
> +  (default is parametric loop bounds)
> +
> +
> +-------------
> +* New in 3.1:
> +-------------
> +
> +- Fixed a typo in polybench.h, causing compilation problems for 3D arrays.
> +- Set by default heap arrays, stack arrays are now optional.
> +
> +
> +-------------
> +* New in 3.0:
> +-------------
> +
> +- Multiple dataset sizes are predefined. Each file comes now with a .h
> +  header file defining the dataset.
> +- Support of heap-allocated arrays. It uses a single malloc for the
> +  entire array region, the data allocated is cast into a C99
> +  multidimensional array.
> +- One benchmark is out: gauss_filter
> +- One benchmark is in: floyd-warshall
> +- PAPI support has been greatly improved; it also can report the
> +  counters on a specific core to be set by the user.
> +
> +
> +
> +----------------
> +* Mailing lists:
> +----------------
> +
> +** polybench-announces at lists.sourceforge.net:
> +---------------------------------------------
> +
> +Announces about releases of PolyBench.
> +
> +** polybench-discussion at lists.sourceforge.net:
> +----------------------------------------------
> +
> +General discussions reg. PolyBench.
> +
> +
> +
> +-----------------------
> +* Available benchmarks:
> +-----------------------
> +
> +::linear-algebra::
> +linear-algebra/kernels:
> +linear-algebra/kernels/2mm/2mm.c
> +linear-algebra/kernels/3mm/3mm.c
> +linear-algebra/kernels/atax/atax.c
> +linear-algebra/kernels/bicg/bicg.c
> +linear-algebra/kernels/cholesky/cholesky.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/kernels/mvt/mvt.c
> +linear-algebra/kernels/symm/symm.c
> +linear-algebra/kernels/syr2k/syr2k.c
> +linear-algebra/kernels/syrk/syrk.c
> +linear-algebra/kernels/trisolv/trisolv.c
> +linear-algebra/kernels/trmm/trmm.c
> +
> +linear-algebra/solvers:
> +linear-algebra/solvers/durbin/durbin.c
> +linear-algebra/solvers/dynprog/dynprog.c
> +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
> +
> +::medley::
> +medley/floyd-warshall/floyd-warshall.c
> +medley/reg_detect/reg_detect.c
> +
> +::stencils::
> +stencils/adi/adi.c
> +stencils/fdtd-2d/fdtd-2d.c
> +stencils/fdtd-apml/fdtd-apml.c
> +stencils/jacobi-1d-imper/jacobi-1d-imper.c
> +stencils/jacobi-2d-imper/jacobi-2d-imper.c
> +stencils/seidel-2d/seidel-2d.c
> +
> +
> +
> +------------------------------
> +* Sample compilation commands:
> +------------------------------
> +
> +
> +** To compile a benchmark without any monitoring:
> +-------------------------------------------------
> +
> +$> gcc -I utilities -I linear-algebra/kernels/atax utilities/polybench.c linear-algebra/kernels/atax/atax.c -o atax_base
> +
> +
> +** To compile a benchmark with execution time reporting:
> +--------------------------------------------------------
> +
> +$> gcc -O3 -I utilities -I linear-algebra/kernels/atax utilities/polybench.c linear-algebra/kernels/atax/atax.c -DPOLYBENCH_TIME -o atax_time
> +
> +
> +** To generate the reference output of a benchmark:
> +---------------------------------------------------
> +
> +$> gcc -O0 -I utilities -I linear-algebra/kernels/atax utilities/polybench.c linear-algebra/kernels/atax/atax.c -DPOLYBENCH_DUMP_ARRAYS -o atax_ref
> +$> ./atax_ref 2>atax_ref.out
> +
> +
> +
> +
> +-------------------------
> +* Some available options:
> +-------------------------
> +
> +They are all passed as macro definitions during compilation time (e.g,
> +-Dname_of_the_option).
> +
> +- 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: 33MB]
> +
> +- POLYBENCH_STACK_ARRAYS: use stack allocation instead of malloc [default: off]
> +
> +- POLYBENCH_DUMP_ARRAYS: dump all live-out arrays on stderr [default: off]
> +
> +- POLYBENCH_CYCLE_ACCURATE_TIMER: Use Time Stamp Counter to monitor
> +  the execution time of the kernel [default: off]
> +
> +- POLYBENCH_PAPI: turn on papi timing (see below).
> +
> +- MINI_DATASET, SMALL_DATASET, STANDARD_DATASET, LARGE_DATASET,
> +  EXTRALARGE_DATASET: set the dataset size to be used
> +  [default: STANDARD_DATASET]
> +
> +- POLYBENCH_USE_C99_PROTO: Use standard C99 prototype for the functions.
> +
> +- POLYBENCH_USE_SCALAR_LB: Use scalar loop bounds instead of parametric ones.
> +
> +
> +
> +---------------
> +* PAPI support:
> +---------------
> +
> +** To compile a benchmark with PAPI support:
> +--------------------------------------------
> +
> +$> gcc -O3 -I utilities -I linear-algebra/kernels/atax utilities/polybench.c linear-algebra/kernels/atax/atax.c -DPOLYBENCH_PAPI -lpapi -o atax_papi
> +
> +
> +** To specify which counter(s) to monitor:
> +------------------------------------------
> +
> +Edit utilities/papi_counters.list, and add 1 line per event to
> +monitor. Each line (including the last one) must finish with a ',' and
> +both native and standard events are supported.
> +
> +The whole kernel is run one time per counter (no multiplexing) and
> +there is no sampling being used for the counter value.
> +
> +
> +
> +------------------------------
> +* Accurate performance timing:
> +------------------------------
> +
> +With kernels that have an execution time in the orders of a few tens
> +of milliseconds, it is critical to validate any performance number by
> +repeating several times the experiment. A companion script is
> +available to perform reasonable performance measurement of a PolyBench.
> +
> +$> gcc -O3 -I utilities -I linear-algebra/kernels/atax utilities/polybench.c linear-algebra/kernels/atax/atax.c -DPOLYBENCH_TIME -o atax_time
> +$> ./utilities/time_benchmark.sh ./atax_time
> +
> +This script will run five times the benchmark (that must be a
> +PolyBench compiled with -DPOLYBENCH_TIME), eliminate the two extremal
> +times, and check that the deviation of the three remaining does not
> +exceed a given threshold, set to 5%.
> +
> +It is also possible to use POLYBENCH_CYCLE_ACCURATE_TIMER to use the
> +Time Stamp Counter instead of gettimeofday() to monitor the number of
> +elapsed cycles.
> +
> +
> +
> +
> +----------------------------------------
> +* Generating macro-free benchmark suite:
> +----------------------------------------
> +
> +(from the root of the archive:)
> +$> PARGS="-I utilities -DPOLYBENCH_TIME";
> +$> for i in `cat utilities/benchmark_list`; do create_cpped_version.sh $i "$PARGS"; done
> +
> +This create for each benchmark file 'xxx.c' a new file
> +'xxx.preproc.c'. The PARGS variable in the above example can be set to
> +the desired configuration, for instance to create a full C99 version
> +(parametric arrays):
> +
> +$> PARGS="-I utilities -DPOLYBENCH_USE_C99_PROTO";
> +$> for i in `cat utilities/benchmark_list`; do ./utilities/create_cpped_version.sh "$i" "$PARGS"; done
> +
> +
> 
> Propchange: test-suite/trunk/SingleSource/Benchmarks/Polybench/README
> ------------------------------------------------------------------------------
>    svn:executable = *
> 
> Added: test-suite/trunk/SingleSource/Benchmarks/Polybench/datamining/Makefile
> URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/Benchmarks/Polybench/datamining/Makefile?rev=159553&view=auto
> ==============================================================================
> --- test-suite/trunk/SingleSource/Benchmarks/Polybench/datamining/Makefile (added)
> +++ test-suite/trunk/SingleSource/Benchmarks/Polybench/datamining/Makefile Mon Jul  2 14:27:28 2012
> @@ -0,0 +1,9 @@
> +# SingleSource/Polybench/datamining
> +# Makefile:  Build all subdirectories automatically
> +
> +LEVEL = ../../../..
> +PARALLEL_DIRS = correlation covariance 
> +
> +include $(LEVEL)/Makefile.config
> +include $(LEVEL)/Makefile.programs
> +
> 
> Propchange: test-suite/trunk/SingleSource/Benchmarks/Polybench/datamining/Makefile
> ------------------------------------------------------------------------------
>    svn:executable = *
> 
> Added: test-suite/trunk/SingleSource/Benchmarks/Polybench/datamining/correlation/Makefile
> URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/Benchmarks/Polybench/datamining/correlation/Makefile?rev=159553&view=auto
> ==============================================================================
> --- test-suite/trunk/SingleSource/Benchmarks/Polybench/datamining/correlation/Makefile (added)
> +++ test-suite/trunk/SingleSource/Benchmarks/Polybench/datamining/correlation/Makefile Mon Jul  2 14:27:28 2012
> @@ -0,0 +1,10 @@
> +LEVEL = ../../../../..
> +
> +POLYBENCH_UTILS = SingleSource/Benchmarks/Polybench/utilities 
> +PROG          = correlation
> +CFLAGS        += -I $(PROJ_SRC_ROOT)/$(POLYBENCH_UTILS) -DPOLYBENCH_DUMP_ARRAYS
> +
> +HASH_PROGRAM_OUTPUT = 1
> +
> +include $(LEVEL)/SingleSource/Makefile.singlesrc
> +
> 
> Propchange: test-suite/trunk/SingleSource/Benchmarks/Polybench/datamining/correlation/Makefile
> ------------------------------------------------------------------------------
>    svn:executable = *
> 
> Added: test-suite/trunk/SingleSource/Benchmarks/Polybench/datamining/correlation/correlation.c
> URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/Benchmarks/Polybench/datamining/correlation/correlation.c?rev=159553&view=auto
> ==============================================================================
> --- test-suite/trunk/SingleSource/Benchmarks/Polybench/datamining/correlation/correlation.c (added)
> +++ test-suite/trunk/SingleSource/Benchmarks/Polybench/datamining/correlation/correlation.c Mon Jul  2 14:27:28 2012
> @@ -0,0 +1,163 @@
> +/**
> + * correlation.c: This file is part of the PolyBench/C 3.2 test suite.
> + *
> + *
> + * Contact: Louis-Noel Pouchet <pouchet at cse.ohio-state.edu>
> + * Web address: http://polybench.sourceforge.net
> + */
> +#include <stdio.h>
> +#include <unistd.h>
> +#include <string.h>
> +#include <math.h>
> +
> +/* Include polybench common header. */
> +#include "../../utilities/polybench.h"
> +
> +/* Include benchmark-specific header. */
> +/* Default data type is double, default size is 4000. */
> +#include "correlation.h"
> +
> +
> +/* Array initialization. */
> +static
> +void init_array (int m,
> +		 int n,
> +		 DATA_TYPE *float_n,
> +		 DATA_TYPE POLYBENCH_2D(data,M,N,m,n))
> +{
> +  int i, j;
> +
> +  *float_n = 1.2;
> +
> +  for (i = 0; i < m; i++)
> +    for (j = 0; j < n; j++)
> +      data[i][j] = ((DATA_TYPE) i*j) / M;
> +}
> +
> +
> +/* DCE code. Must scan the entire live-out data.
> +   Can be used also to check the correctness of the output. */
> +static
> +void print_array(int m,
> +		 DATA_TYPE POLYBENCH_2D(symmat,M,M,m,m))
> +
> +{
> +  int i, j;
> +
> +  for (i = 0; i < m; i++)
> +    for (j = 0; j < m; j++) {
> +      fprintf (stderr, DATA_PRINTF_MODIFIER, symmat[i][j]);
> +      if ((i * m + j) % 20 == 0) fprintf (stderr, "\n");
> +    }
> +  fprintf (stderr, "\n");
> +}
> +
> +
> +/* Main computational kernel. The whole function will be timed,
> +   including the call and return. */
> +static
> +void kernel_correlation(int m, int n,
> +			DATA_TYPE float_n,
> +			DATA_TYPE POLYBENCH_2D(data,M,N,m,n),
> +			DATA_TYPE POLYBENCH_2D(symmat,M,M,m,m),
> +			DATA_TYPE POLYBENCH_1D(mean,M,m),
> +			DATA_TYPE POLYBENCH_1D(stddev,M,m))
> +{
> +  int i, j, j1, j2;
> +
> +  DATA_TYPE eps = 0.1f;
> +
> +#define sqrt_of_array_cell(x,j) sqrt(x[j])
> +
> +#pragma scop
> +  /* Determine mean of column vectors of input data matrix */
> +  for (j = 0; j < _PB_M; j++)
> +    {
> +      mean[j] = 0.0;
> +      for (i = 0; i < _PB_N; i++)
> +	mean[j] += data[i][j];
> +      mean[j] /= float_n;
> +    }
> +
> +  /* Determine standard deviations of column vectors of data matrix. */
> +  for (j = 0; j < _PB_M; j++)
> +    {
> +      stddev[j] = 0.0;
> +      for (i = 0; i < _PB_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];
> +    }
> +
> +  /* Center and reduce the column vectors. */
> +  for (i = 0; i < _PB_N; i++)
> +    for (j = 0; j < _PB_M; j++)
> +      {
> +	data[i][j] -= mean[j];
> +	data[i][j] /= sqrt(float_n) * stddev[j];
> +      }
> +
> +  /* Calculate the m * m correlation matrix. */
> +  for (j1 = 0; j1 < _PB_M-1; j1++)
> +    {
> +      symmat[j1][j1] = 1.0;
> +      for (j2 = j1+1; j2 < _PB_M; j2++)
> +	{
> +	  symmat[j1][j2] = 0.0;
> +	  for (i = 0; i < _PB_N; i++)
> +	    symmat[j1][j2] += (data[i][j1] * data[i][j2]);
> +	  symmat[j2][j1] = symmat[j1][j2];
> +	}
> +    }
> +  symmat[_PB_M-1][_PB_M-1] = 1.0;
> +#pragma endscop
> +
> +}
> +
> +
> +int main(int argc, char** argv)
> +{
> +  /* Retrieve problem size. */
> +  int n = N;
> +  int m = M;
> +
> +  /* Variable declaration/allocation. */
> +  DATA_TYPE float_n;
> +  POLYBENCH_2D_ARRAY_DECL(data,DATA_TYPE,M,N,m,n);
> +  POLYBENCH_2D_ARRAY_DECL(symmat,DATA_TYPE,M,M,m,m);
> +  POLYBENCH_1D_ARRAY_DECL(mean,DATA_TYPE,M,m);
> +  POLYBENCH_1D_ARRAY_DECL(stddev,DATA_TYPE,M,m);
> +
> +  /* Initialize array(s). */
> +  init_array (m, n, &float_n, POLYBENCH_ARRAY(data));
> +
> +  /* Start timer. */
> +  polybench_start_instruments;
> +
> +  /* Run kernel. */
> +  kernel_correlation (m, n, float_n,
> +		      POLYBENCH_ARRAY(data),
> +		      POLYBENCH_ARRAY(symmat),
> +		      POLYBENCH_ARRAY(mean),
> +		      POLYBENCH_ARRAY(stddev));
> +
> +  /* Stop and print timer. */
> +  polybench_stop_instruments;
> +  polybench_print_instruments;
> +
> +  /* Prevent dead-code elimination. All live-out data must be printed
> +     by the function call in argument. */
> +  polybench_prevent_dce(print_array(m, POLYBENCH_ARRAY(symmat)));
> +
> +  /* Be clean. */
> +  POLYBENCH_FREE_ARRAY(data);
> +  POLYBENCH_FREE_ARRAY(symmat);
> +  POLYBENCH_FREE_ARRAY(mean);
> +  POLYBENCH_FREE_ARRAY(stddev);
> +
> +  return 0;
> +}
> 
> Propchange: test-suite/trunk/SingleSource/Benchmarks/Polybench/datamining/correlation/correlation.c
> ------------------------------------------------------------------------------
>    svn:executable = *
> 
> Added: test-suite/trunk/SingleSource/Benchmarks/Polybench/datamining/correlation/correlation.h
> URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/Benchmarks/Polybench/datamining/correlation/correlation.h?rev=159553&view=auto
> ==============================================================================
> --- test-suite/trunk/SingleSource/Benchmarks/Polybench/datamining/correlation/correlation.h (added)
> +++ test-suite/trunk/SingleSource/Benchmarks/Polybench/datamining/correlation/correlation.h Mon Jul  2 14:27:28 2012
> @@ -0,0 +1,54 @@
> +/**
> + * correlation.h: This file is part of the PolyBench/C 3.2 test suite.
> + *
> + *
> + * Contact: Louis-Noel Pouchet <pouchet at cse.ohio-state.edu>
> + * Web address: http://polybench.sourceforge.net
> + */
> +#ifndef CORRELATION_H
> +# define CORRELATION_H
> +
> +/* Default to STANDARD_DATASET. */
> +# if !defined(MINI_DATASET) && !defined(SMALL_DATASET) && !defined(LARGE_DATASET) && !defined(EXTRALARGE_DATASET)
> +#  define STANDARD_DATASET
> +# endif
> +
> +/* Do not define anything if the user manually defines the size. */
> +# if !defined(N) && !defined(M)
> +/* Define the possible dataset sizes. */
> +#  ifdef MINI_DATASET
> +#   define N 32
> +#   define M 32
> +#  endif
> +
> +#  ifdef SMALL_DATASET
> +#   define N 500
> +#   define M 500
> +#  endif
> +
> +#  ifdef STANDARD_DATASET /* Default if unspecified. */
> +#   define N 1000
> +#   define M 1000
> +#  endif
> +
> +#  ifdef LARGE_DATASET
> +#   define N 2000
> +#   define M 2000
> +#  endif
> +
> +#  ifdef EXTRALARGE_DATASET
> +#   define N 4000
> +#   define M 4000
> +#  endif
> +# endif /* !N */
> +
> +# define _PB_N POLYBENCH_LOOP_BOUND(N,n)
> +# define _PB_M POLYBENCH_LOOP_BOUND(M,m)
> +
> +# ifndef DATA_TYPE
> +#  define DATA_TYPE double
> +#  define DATA_PRINTF_MODIFIER "%0.2lf "
> +# endif
> +
> +
> +#endif /* !CORRELATION_H */
> 
> Propchange: test-suite/trunk/SingleSource/Benchmarks/Polybench/datamining/correlation/correlation.h
> ------------------------------------------------------------------------------
>    svn:executable = *
> 
> Added: test-suite/trunk/SingleSource/Benchmarks/Polybench/datamining/correlation/correlation.reference_output
> URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/Benchmarks/Polybench/datamining/correlation/correlation.reference_output?rev=159553&view=auto
> ==============================================================================
> --- test-suite/trunk/SingleSource/Benchmarks/Polybench/datamining/correlation/correlation.reference_output (added)
> +++ test-suite/trunk/SingleSource/Benchmarks/Polybench/datamining/correlation/correlation.reference_output Mon Jul  2 14:27:28 2012
> @@ -0,0 +1 @@
> +7a921eb499d9fab524cee1ae065eee8c
> 
> Propchange: test-suite/trunk/SingleSource/Benchmarks/Polybench/datamining/correlation/correlation.reference_output
> ------------------------------------------------------------------------------
>    svn:executable = *
> 
> Added: test-suite/trunk/SingleSource/Benchmarks/Polybench/datamining/covariance/Makefile
> URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/Benchmarks/Polybench/datamining/covariance/Makefile?rev=159553&view=auto
> ==============================================================================
> --- test-suite/trunk/SingleSource/Benchmarks/Polybench/datamining/covariance/Makefile (added)
> +++ test-suite/trunk/SingleSource/Benchmarks/Polybench/datamining/covariance/Makefile Mon Jul  2 14:27:28 2012
> @@ -0,0 +1,12 @@
> +LEVEL = ../../../../..
> +
> +
> +POLYBENCH_UTILS = SingleSource/Benchmarks/Polybench/utilities 
> +PROG          = covariance
> +CFLAGS        += -I $(PROJ_SRC_ROOT)/$(POLYBENCH_UTILS) -DPOLYBENCH_DUMP_ARRAYS
> +
> +
> +HASH_PROGRAM_OUTPUT = 1
> +
> +include $(LEVEL)/SingleSource/Makefile.singlesrc
> +
> 
> Propchange: test-suite/trunk/SingleSource/Benchmarks/Polybench/datamining/covariance/Makefile
> ------------------------------------------------------------------------------
>    svn:executable = *
> 
> Added: test-suite/trunk/SingleSource/Benchmarks/Polybench/datamining/covariance/covariance.c
> URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/Benchmarks/Polybench/datamining/covariance/covariance.c?rev=159553&view=auto
> ==============================================================================
> --- test-suite/trunk/SingleSource/Benchmarks/Polybench/datamining/covariance/covariance.c (added)
> +++ test-suite/trunk/SingleSource/Benchmarks/Polybench/datamining/covariance/covariance.c Mon Jul  2 14:27:28 2012
> @@ -0,0 +1,134 @@
> +/**
> + * covariance.c: This file is part of the PolyBench/C 3.2 test suite.
> + *
> + *
> + * Contact: Louis-Noel Pouchet <pouchet at cse.ohio-state.edu>
> + * Web address: http://polybench.sourceforge.net
> + */
> +#include <stdio.h>
> +#include <unistd.h>
> +#include <string.h>
> +#include <math.h>
> +
> +/* Include polybench common header. */
> +#include "../../utilities/polybench.h"
> +
> +/* Include benchmark-specific header. */
> +/* Default data type is double, default size is 4000. */
> +#include "covariance.h"
> +
> +
> +/* Array initialization. */
> +static
> +void init_array (int m, int n,
> +		 DATA_TYPE *float_n,
> +		 DATA_TYPE POLYBENCH_2D(data,M,N,m,n))
> +{
> +  int i, j;
> +
> +  *float_n = 1.2;
> +
> +  for (i = 0; i < M; i++)
> +    for (j = 0; j < N; j++)
> +      data[i][j] = ((DATA_TYPE) i*j) / M;
> +}
> +
> +
> +/* DCE code. Must scan the entire live-out data.
> +   Can be used also to check the correctness of the output. */
> +static
> +void print_array(int m,
> +		 DATA_TYPE POLYBENCH_2D(symmat,M,M,m,m))
> +
> +{
> +  int i, j;
> +
> +  for (i = 0; i < m; i++)
> +    for (j = 0; j < m; j++) {
> +      fprintf (stderr, DATA_PRINTF_MODIFIER, symmat[i][j]);
> +      if ((i * m + j) % 20 == 0) fprintf (stderr, "\n");
> +    }
> +  fprintf (stderr, "\n");
> +}
> +
> +
> +/* Main computational kernel. The whole function will be timed,
> +   including the call and return. */
> +static
> +void kernel_covariance(int m, int n,
> +		       DATA_TYPE float_n,
> +		       DATA_TYPE POLYBENCH_2D(data,M,N,m,n),
> +		       DATA_TYPE POLYBENCH_2D(symmat,M,M,m,m),
> +		       DATA_TYPE POLYBENCH_1D(mean,M,m))
> +{
> +  int i, j, j1, j2;
> +
> +#pragma scop
> +  /* Determine mean of column vectors of input data matrix */
> +  for (j = 0; j < _PB_M; j++)
> +    {
> +      mean[j] = 0.0;
> +      for (i = 0; i < _PB_N; i++)
> +        mean[j] += data[i][j];
> +      mean[j] /= float_n;
> +    }
> +
> +  /* Center the column vectors. */
> +  for (i = 0; i < _PB_N; i++)
> +    for (j = 0; j < _PB_M; j++)
> +      data[i][j] -= mean[j];
> +
> +  /* Calculate the m * m covariance matrix. */
> +  for (j1 = 0; j1 < _PB_M; j1++)
> +    for (j2 = j1; j2 < _PB_M; j2++)
> +      {
> +        symmat[j1][j2] = 0.0;
> +        for (i = 0; i < _PB_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)
> +{
> +  /* Retrieve problem size. */
> +  int n = N;
> +  int m = M;
> +
> +  /* Variable declaration/allocation. */
> +  DATA_TYPE float_n;
> +  POLYBENCH_2D_ARRAY_DECL(data,DATA_TYPE,M,N,m,n);
> +  POLYBENCH_2D_ARRAY_DECL(symmat,DATA_TYPE,M,M,m,m);
> +  POLYBENCH_1D_ARRAY_DECL(mean,DATA_TYPE,M,m);
> +
> +
> +  /* Initialize array(s). */
> +  init_array (m, n, &float_n, POLYBENCH_ARRAY(data));
> +
> +  /* Start timer. */
> +  polybench_start_instruments;
> +
> +  /* Run kernel. */
> +  kernel_covariance (m, n, float_n,
> +		     POLYBENCH_ARRAY(data),
> +		     POLYBENCH_ARRAY(symmat),
> +		     POLYBENCH_ARRAY(mean));
> +
> +  /* Stop and print timer. */
> +  polybench_stop_instruments;
> +  polybench_print_instruments;
> +
> +  /* Prevent dead-code elimination. All live-out data must be printed
> +     by the function call in argument. */
> +  polybench_prevent_dce(print_array(m, POLYBENCH_ARRAY(symmat)));
> +
> +  /* Be clean. */
> +  POLYBENCH_FREE_ARRAY(data);
> +  POLYBENCH_FREE_ARRAY(symmat);
> +  POLYBENCH_FREE_ARRAY(mean);
> +
> +  return 0;
> +}
> 
> Propchange: test-suite/trunk/SingleSource/Benchmarks/Polybench/datamining/covariance/covariance.c
> ------------------------------------------------------------------------------
>    svn:executable = *
> 
> Added: test-suite/trunk/SingleSource/Benchmarks/Polybench/datamining/covariance/covariance.h
> URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/Benchmarks/Polybench/datamining/covariance/covariance.h?rev=159553&view=auto
> ==============================================================================
> --- test-suite/trunk/SingleSource/Benchmarks/Polybench/datamining/covariance/covariance.h (added)
> +++ test-suite/trunk/SingleSource/Benchmarks/Polybench/datamining/covariance/covariance.h Mon Jul  2 14:27:28 2012
> @@ -0,0 +1,54 @@
> +/**
> + * covariance.h: This file is part of the PolyBench/C 3.2 test suite.
> + *
> + *
> + * Contact: Louis-Noel Pouchet <pouchet at cse.ohio-state.edu>
> + * Web address: http://polybench.sourceforge.net
> + */
> +#ifndef COVARIANCE_H
> +# define COVARIANCE_H
> +
> +/* Default to STANDARD_DATASET. */
> +# if !defined(MINI_DATASET) && !defined(SMALL_DATASET) && !defined(LARGE_DATASET) && !defined(EXTRALARGE_DATASET)
> +#  define STANDARD_DATASET
> +# endif
> +
> +/* Do not define anything if the user manually defines the size. */
> +# if !defined(N) && !defined(M)
> +/* Define the possible dataset sizes. */
> +#  ifdef MINI_DATASET
> +#   define N 32
> +#   define M 32
> +#  endif
> +
> +#  ifdef SMALL_DATASET
> +#   define N 500
> +#   define M 500
> +#  endif
> +
> +#  ifdef STANDARD_DATASET /* Default if unspecified. */
> +#   define N 1000
> +#   define M 1000
> +#  endif
> +
> +#  ifdef LARGE_DATASET
> +#   define N 2000
> +#   define M 2000
> +#  endif
> +
> +#  ifdef EXTRALARGE_DATASET
> +#   define N 4000
> +#   define M 4000
> +#  endif
> +# endif /* !N */
> +
> +# define _PB_N POLYBENCH_LOOP_BOUND(N,n)
> +# define _PB_M POLYBENCH_LOOP_BOUND(M,m)
> +
> +# ifndef DATA_TYPE
> +#  define DATA_TYPE double
> +#  define DATA_PRINTF_MODIFIER "%0.2lf "
> +# endif
> +
> +
> +#endif /* !COVARIANCE_H */
> 
> Propchange: test-suite/trunk/SingleSource/Benchmarks/Polybench/datamining/covariance/covariance.h
> ------------------------------------------------------------------------------
>    svn:executable = *
> 
> Added: test-suite/trunk/SingleSource/Benchmarks/Polybench/datamining/covariance/covariance.reference_output
> URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/Benchmarks/Polybench/datamining/covariance/covariance.reference_output?rev=159553&view=auto
> ==============================================================================
> --- test-suite/trunk/SingleSource/Benchmarks/Polybench/datamining/covariance/covariance.reference_output (added)
> +++ test-suite/trunk/SingleSource/Benchmarks/Polybench/datamining/covariance/covariance.reference_output Mon Jul  2 14:27:28 2012
> @@ -0,0 +1 @@
> +1af493f3c2d7d6b5acbd61a3852415c8
> 
> Propchange: test-suite/trunk/SingleSource/Benchmarks/Polybench/datamining/covariance/covariance.reference_output
> ------------------------------------------------------------------------------
>    svn:executable = *
> 
> Added: test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/Makefile
> URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/Makefile?rev=159553&view=auto
> ==============================================================================
> --- test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/Makefile (added)
> +++ test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/Makefile Mon Jul  2 14:27:28 2012
> @@ -0,0 +1,9 @@
> +# MultiSource/Polybench/linear-algebra
> +# Makefile:  Build all subdirectories automatically
> +
> +LEVEL = ../../../..
> +PARALLEL_DIRS = kernels solvers
> +
> +include $(LEVEL)/Makefile.config
> +include $(LEVEL)/Makefile.programs
> +
> 
> Propchange: test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/Makefile
> ------------------------------------------------------------------------------
>    svn:executable = *
> 
> Added: test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/2mm/2mm.c
> URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/2mm/2mm.c?rev=159553&view=auto
> ==============================================================================
> --- test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/2mm/2mm.c (added)
> +++ test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/2mm/2mm.c Mon Jul  2 14:27:28 2012
> @@ -0,0 +1,154 @@
> +/**
> + * 2mm.c: This file is part of the PolyBench/C 3.2 test suite.
> + *
> + *
> + * Contact: Louis-Noel Pouchet <pouchet at cse.ohio-state.edu>
> + * Web address: http://polybench.sourceforge.net
> + */
> +#include <stdio.h>
> +#include <unistd.h>
> +#include <string.h>
> +#include <math.h>
> +
> +/* Include polybench common header. */
> +#include <polybench.h>
> +
> +/* Include benchmark-specific header. */
> +/* Default data type is double, default size is 4000. */
> +#include "2mm.h"
> +
> +
> +/* Array initialization. */
> +static
> +void init_array(int ni, int nj, int nk, int nl,
> +		DATA_TYPE *alpha,
> +		DATA_TYPE *beta,
> +		DATA_TYPE POLYBENCH_2D(A,NI,NK,ni,nl),
> +		DATA_TYPE POLYBENCH_2D(B,NK,NJ,nk,nj),
> +		DATA_TYPE POLYBENCH_2D(C,NL,NJ,nl,nj),
> +		DATA_TYPE POLYBENCH_2D(D,NI,NL,ni,nl))
> +{
> +  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 < nl; i++)
> +    for (j = 0; j < nj; j++)
> +      C[i][j] = ((DATA_TYPE) i*(j+3)) / nl;
> +  for (i = 0; i < ni; i++)
> +    for (j = 0; j < nl; j++)
> +      D[i][j] = ((DATA_TYPE) i*(j+2)) / nk;
> +}
> +
> +
> +/* DCE code. Must scan the entire live-out data.
> +   Can be used also to check the correctness of the output. */
> +static
> +void print_array(int ni, int nl,
> +		 DATA_TYPE POLYBENCH_2D(D,NI,NL,ni,nl))
> +{
> +  int i, j;
> +
> +  for (i = 0; i < ni; i++)
> +    for (j = 0; j < nl; j++) {
> +	fprintf (stderr, DATA_PRINTF_MODIFIER, D[i][j]);
> +	if ((i * ni + j) % 20 == 0) fprintf (stderr, "\n");
> +    }
> +  fprintf (stderr, "\n");
> +}
> +
> +
> +/* Main computational kernel. The whole function will be timed,
> +   including the call and return. */
> +static
> +void kernel_2mm(int ni, int nj, int nk, int nl,
> +		DATA_TYPE alpha,
> +		DATA_TYPE beta,
> +		DATA_TYPE POLYBENCH_2D(tmp,NI,NJ,ni,nj),
> +		DATA_TYPE POLYBENCH_2D(A,NI,NK,ni,nk),
> +		DATA_TYPE POLYBENCH_2D(B,NK,NJ,nk,nj),
> +		DATA_TYPE POLYBENCH_2D(C,NL,NJ,nl,nj),
> +		DATA_TYPE POLYBENCH_2D(D,NI,NL,ni,nl))
> +{
> +  int i, j, k;
> +
> +#pragma scop
> +  /* D := alpha*A*B*C + beta*D */
> +  for (i = 0; i < _PB_NI; i++)
> +    for (j = 0; j < _PB_NJ; j++)
> +      {
> +	tmp[i][j] = 0;
> +	for (k = 0; k < _PB_NK; ++k)
> +	  tmp[i][j] += alpha * A[i][k] * B[k][j];
> +      }
> +  for (i = 0; i < _PB_NI; i++)
> +    for (j = 0; j < _PB_NL; j++)
> +      {
> +	D[i][j] *= beta;
> +	for (k = 0; k < _PB_NJ; ++k)
> +	  D[i][j] += tmp[i][k] * C[k][j];
> +      }
> +#pragma endscop
> +
> +}
> +
> +
> +int main(int argc, char** argv)
> +{
> +  /* Retrieve problem size. */
> +  int ni = NI;
> +  int nj = NJ;
> +  int nk = NK;
> +  int nl = NL;
> +
> +  /* Variable declaration/allocation. */
> +  DATA_TYPE alpha;
> +  DATA_TYPE beta;
> +  POLYBENCH_2D_ARRAY_DECL(tmp,DATA_TYPE,NI,NJ,ni,nj);
> +  POLYBENCH_2D_ARRAY_DECL(A,DATA_TYPE,NI,NK,ni,nk);
> +  POLYBENCH_2D_ARRAY_DECL(B,DATA_TYPE,NK,NJ,nk,nj);
> +  POLYBENCH_2D_ARRAY_DECL(C,DATA_TYPE,NL,NJ,nl,nj);
> +  POLYBENCH_2D_ARRAY_DECL(D,DATA_TYPE,NI,NL,ni,nl);
> +
> +  /* Initialize array(s). */
> +  init_array (ni, nj, nk, nl, &alpha, &beta,
> +	      POLYBENCH_ARRAY(A),
> +	      POLYBENCH_ARRAY(B),
> +	      POLYBENCH_ARRAY(C),
> +	      POLYBENCH_ARRAY(D));
> +
> +  /* Start timer. */
> +  polybench_start_instruments;
> +
> +  /* Run kernel. */
> +  kernel_2mm (ni, nj, nk, nl,
> +	      alpha, beta,
> +	      POLYBENCH_ARRAY(tmp),
> +	      POLYBENCH_ARRAY(A),
> +	      POLYBENCH_ARRAY(B),
> +	      POLYBENCH_ARRAY(C),
> +	      POLYBENCH_ARRAY(D));
> +
> +  /* Stop and print timer. */
> +  polybench_stop_instruments;
> +  polybench_print_instruments;
> +
> +  /* Prevent dead-code elimination. All live-out data must be printed
> +     by the function call in argument. */
> +  polybench_prevent_dce(print_array(ni, nl,  POLYBENCH_ARRAY(D)));
> +
> +  /* Be clean. */
> +  POLYBENCH_FREE_ARRAY(tmp);
> +  POLYBENCH_FREE_ARRAY(A);
> +  POLYBENCH_FREE_ARRAY(B);
> +  POLYBENCH_FREE_ARRAY(C);
> +  POLYBENCH_FREE_ARRAY(D);
> +
> +  return 0;
> +}
> 
> Propchange: test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/2mm/2mm.c
> ------------------------------------------------------------------------------
>    svn:executable = *
> 
> Added: test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/2mm/2mm.h
> URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/2mm/2mm.h?rev=159553&view=auto
> ==============================================================================
> --- test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/2mm/2mm.h (added)
> +++ test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/2mm/2mm.h Mon Jul  2 14:27:28 2012
> @@ -0,0 +1,66 @@
> +/**
> + * 2mm.h: This file is part of the PolyBench/C 3.2 test suite.
> + *
> + *
> + * Contact: Louis-Noel Pouchet <pouchet at cse.ohio-state.edu>
> + * Web address: http://polybench.sourceforge.net
> + */
> +#ifndef _2MM_H
> +# define _2MM_H
> +
> +/* Default to STANDARD_DATASET. */
> +# if !defined(MINI_DATASET) && !defined(SMALL_DATASET) && !defined(LARGE_DATASET) && !defined(EXTRALARGE_DATASET)
> +#  define STANDARD_DATASET
> +# endif
> +
> +/* Do not define anything if the user manually defines the size. */
> +# if !defined(NI) && !defined(NJ) && !defined(NK)
> +/* Define the possible dataset sizes. */
> +#  ifdef MINI_DATASET
> +#   define NI 32
> +#   define NJ 32
> +#   define NK 32
> +#   define NL 32
> +#  endif
> +
> +#  ifdef SMALL_DATASET
> +#   define NI 128
> +#   define NJ 128
> +#   define NK 128
> +#   define NL 128
> +#  endif
> +
> +#  ifdef STANDARD_DATASET /* Default if unspecified. */
> +#   define NI 1024
> +#   define NJ 1024
> +#   define NK 1024
> +#   define NL 1024
> +#  endif
> +
> +#  ifdef LARGE_DATASET
> +#   define NI 2000
> +#   define NJ 2000
> +#   define NK 2000
> +#   define NL 2000
> +#  endif
> +
> +#  ifdef EXTRALARGE_DATASET
> +#   define NI 4000
> +#   define NJ 4000
> +#   define NK 4000
> +#   define NL 4000
> +#  endif
> +# endif /* !N */
> +
> +# define _PB_NI POLYBENCH_LOOP_BOUND(NI,ni)
> +# define _PB_NJ POLYBENCH_LOOP_BOUND(NJ,nj)
> +# define _PB_NK POLYBENCH_LOOP_BOUND(NK,nk)
> +# define _PB_NL POLYBENCH_LOOP_BOUND(NL,nl)
> +
> +# ifndef DATA_TYPE
> +#  define DATA_TYPE double
> +#  define DATA_PRINTF_MODIFIER "%0.2lf "
> +# endif
> +
> +
> +#endif /* !_2MM */
> 
> Propchange: test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/2mm/2mm.h
> ------------------------------------------------------------------------------
>    svn:executable = *
> 
> Added: test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/2mm/2mm.reference_output
> URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/2mm/2mm.reference_output?rev=159553&view=auto
> ==============================================================================
> --- test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/2mm/2mm.reference_output (added)
> +++ test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/2mm/2mm.reference_output Mon Jul  2 14:27:28 2012
> @@ -0,0 +1 @@
> +1545695c0f729449227b181c7785d63c
> 
> Propchange: test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/2mm/2mm.reference_output
> ------------------------------------------------------------------------------
>    svn:executable = *
> 
> Added: test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/2mm/Makefile
> URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/2mm/Makefile?rev=159553&view=auto
> ==============================================================================
> --- test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/2mm/Makefile (added)
> +++ test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/2mm/Makefile Mon Jul  2 14:27:28 2012
> @@ -0,0 +1,10 @@
> +LEVEL = ../../../../../..
> +
> +POLYBENCH_UTILS = SingleSource/Benchmarks/Polybench/utilities 
> +PROG          = 2mm
> +CFLAGS        += -I $(PROJ_SRC_ROOT)/$(POLYBENCH_UTILS) -DPOLYBENCH_DUMP_ARRAYS
> +
> +HASH_PROGRAM_OUTPUT = 1
> +
> +include $(LEVEL)/SingleSource/Makefile.singlesrc
> +
> 
> Propchange: test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/2mm/Makefile
> ------------------------------------------------------------------------------
>    svn:executable = *
> 
> Added: test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/2mm/compiler.opts
> URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/2mm/compiler.opts?rev=159553&view=auto
> ==============================================================================
> --- test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/2mm/compiler.opts (added)
> +++ test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/2mm/compiler.opts Mon Jul  2 14:27:28 2012
> @@ -0,0 +1 @@
> +-DNI=1024 -DNJ=1024 -DNK=1024 -DNL=1024
> 
> Propchange: test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/2mm/compiler.opts
> ------------------------------------------------------------------------------
>    svn:executable = *
> 
> Added: test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/3mm/3mm.c
> URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/3mm/3mm.c?rev=159553&view=auto
> ==============================================================================
> --- test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/3mm/3mm.c (added)
> +++ test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/3mm/3mm.c Mon Jul  2 14:27:28 2012
> @@ -0,0 +1,163 @@
> +/**
> + * 3mm.c: This file is part of the PolyBench/C 3.2 test suite.
> + *
> + *
> + * Contact: Louis-Noel Pouchet <pouchet at cse.ohio-state.edu>
> + * Web address: http://polybench.sourceforge.net
> + */
> +#include <stdio.h>
> +#include <unistd.h>
> +#include <string.h>
> +#include <math.h>
> +
> +/* Include polybench common header. */
> +#include <polybench.h>
> +
> +/* Include benchmark-specific header. */
> +/* Default data type is double, default size is 4000. */
> +#include "3mm.h"
> +
> +
> +/* Array initialization. */
> +static
> +void init_array(int ni, int nj, int nk, int nl, int nm,
> +		DATA_TYPE POLYBENCH_2D(A,NI,NK,ni,nk),
> +		DATA_TYPE POLYBENCH_2D(B,NK,NJ,nk,nj),
> +		DATA_TYPE POLYBENCH_2D(C,NJ,NM,nj,nm),
> +		DATA_TYPE POLYBENCH_2D(D,NM,NL,nm,nl))
> +{
> +  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+3)) / nl;
> +  for (i = 0; i < nm; i++)
> +    for (j = 0; j < nl; j++)
> +      D[i][j] = ((DATA_TYPE) i*(j+2)) / nk;
> +}
> +
> +
> +/* DCE code. Must scan the entire live-out data.
> +   Can be used also to check the correctness of the output. */
> +static
> +void print_array(int ni, int nl,
> +		 DATA_TYPE POLYBENCH_2D(G,NI,NL,ni,nl))
> +{
> +  int i, j;
> +
> +  for (i = 0; i < ni; i++)
> +    for (j = 0; j < nl; j++) {
> +	fprintf (stderr, DATA_PRINTF_MODIFIER, G[i][j]);
> +	if ((i * ni + j) % 20 == 0) fprintf (stderr, "\n");
> +    }
> +  fprintf (stderr, "\n");
> +}
> +
> +
> +/* Main computational kernel. The whole function will be timed,
> +   including the call and return. */
> +static
> +void kernel_3mm(int ni, int nj, int nk, int nl, int nm,
> +		DATA_TYPE POLYBENCH_2D(E,NI,NJ,ni,nj),
> +		DATA_TYPE POLYBENCH_2D(A,NI,NK,ni,nk),
> +		DATA_TYPE POLYBENCH_2D(B,NK,NJ,nk,nj),
> +		DATA_TYPE POLYBENCH_2D(F,NJ,NL,nj,nl),
> +		DATA_TYPE POLYBENCH_2D(C,NJ,NM,nj,nm),
> +		DATA_TYPE POLYBENCH_2D(D,NM,NL,nm,nl),
> +		DATA_TYPE POLYBENCH_2D(G,NI,NL,ni,nl))
> +{
> +  int i, j, k;
> +
> +#pragma scop
> +  /* E := A*B */
> +  for (i = 0; i < _PB_NI; i++)
> +    for (j = 0; j < _PB_NJ; j++)
> +      {
> +	E[i][j] = 0;
> +	for (k = 0; k < _PB_NK; ++k)
> +	  E[i][j] += A[i][k] * B[k][j];
> +      }
> +  /* F := C*D */
> +  for (i = 0; i < _PB_NJ; i++)
> +    for (j = 0; j < _PB_NL; j++)
> +      {
> +	F[i][j] = 0;
> +	for (k = 0; k < _PB_NM; ++k)
> +	  F[i][j] += C[i][k] * D[k][j];
> +      }
> +  /* G := E*F */
> +  for (i = 0; i < _PB_NI; i++)
> +    for (j = 0; j < _PB_NL; j++)
> +      {
> +	G[i][j] = 0;
> +	for (k = 0; k < _PB_NJ; ++k)
> +	  G[i][j] += E[i][k] * F[k][j];
> +      }
> +#pragma endscop
> +
> +}
> +
> +
> +int main(int argc, char** argv)
> +{
> +  /* Retrieve problem size. */
> +  int ni = NI;
> +  int nj = NJ;
> +  int nk = NK;
> +  int nl = NL;
> +  int nm = NM;
> +
> +  /* Variable declaration/allocation. */
> +  POLYBENCH_2D_ARRAY_DECL(E, DATA_TYPE, NI, NJ, ni, nj);
> +  POLYBENCH_2D_ARRAY_DECL(A, DATA_TYPE, NI, NK, ni, nk);
> +  POLYBENCH_2D_ARRAY_DECL(B, DATA_TYPE, NK, NJ, nk, nj);
> +  POLYBENCH_2D_ARRAY_DECL(F, DATA_TYPE, NJ, NL, nj, nl);
> +  POLYBENCH_2D_ARRAY_DECL(C, DATA_TYPE, NJ, NM, nj, nm);
> +  POLYBENCH_2D_ARRAY_DECL(D, DATA_TYPE, NM, NL, nm, nl);
> +  POLYBENCH_2D_ARRAY_DECL(G, DATA_TYPE, NI, NL, ni, nl);
> +
> +  /* Initialize array(s). */
> +  init_array (ni, nj, nk, nl, nm,
> +	      POLYBENCH_ARRAY(A),
> +	      POLYBENCH_ARRAY(B),
> +	      POLYBENCH_ARRAY(C),
> +	      POLYBENCH_ARRAY(D));
> +
> +  /* Start timer. */
> +  polybench_start_instruments;
> +
> +  /* Run kernel. */
> +  kernel_3mm (ni, nj, nk, nl, nm,
> +	      POLYBENCH_ARRAY(E),
> +	      POLYBENCH_ARRAY(A),
> +	      POLYBENCH_ARRAY(B),
> +	      POLYBENCH_ARRAY(F),
> +	      POLYBENCH_ARRAY(C),
> +	      POLYBENCH_ARRAY(D),
> +	      POLYBENCH_ARRAY(G));
> +
> +  /* Stop and print timer. */
> +  polybench_stop_instruments;
> +  polybench_print_instruments;
> +
> +  /* Prevent dead-code elimination. All live-out data must be printed
> +     by the function call in argument. */
> +  polybench_prevent_dce(print_array(ni, nl,  POLYBENCH_ARRAY(G)));
> +
> +  /* Be clean. */
> +  POLYBENCH_FREE_ARRAY(E);
> +  POLYBENCH_FREE_ARRAY(A);
> +  POLYBENCH_FREE_ARRAY(B);
> +  POLYBENCH_FREE_ARRAY(F);
> +  POLYBENCH_FREE_ARRAY(C);
> +  POLYBENCH_FREE_ARRAY(D);
> +  POLYBENCH_FREE_ARRAY(G);
> +
> +  return 0;
> +}
> 
> Propchange: test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/3mm/3mm.c
> ------------------------------------------------------------------------------
>    svn:executable = *
> 
> Added: test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/3mm/3mm.h
> URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/3mm/3mm.h?rev=159553&view=auto
> ==============================================================================
> --- test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/3mm/3mm.h (added)
> +++ test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/3mm/3mm.h Mon Jul  2 14:27:28 2012
> @@ -0,0 +1,72 @@
> +/**
> + * 3mm.h: This file is part of the PolyBench/C 3.2 test suite.
> + *
> + *
> + * Contact: Louis-Noel Pouchet <pouchet at cse.ohio-state.edu>
> + * Web address: http://polybench.sourceforge.net
> + */
> +#ifndef _3MM_H
> +# define _3MM_H
> +
> +/* Default to STANDARD_DATASET. */
> +# if !defined(MINI_DATASET) && !defined(SMALL_DATASET) && !defined(LARGE_DATASET) && !defined(EXTRALARGE_DATASET)
> +#  define STANDARD_DATASET
> +# endif
> +
> +/* Do not define anything if the user manually defines the size. */
> +# if !defined(NI) && !defined(NJ) && !defined(NK)
> +/* Define the possible dataset sizes. */
> +#  ifdef MINI_DATASET
> +#   define NI 32
> +#   define NJ 32
> +#   define NK 32
> +#   define NL 32
> +#   define NM 32
> +#  endif
> +
> +#  ifdef SMALL_DATASET
> +#   define NI 128
> +#   define NJ 128
> +#   define NK 128
> +#   define NL 128
> +#   define NM 128
> +#  endif
> +
> +#  ifdef STANDARD_DATASET /* Default if unspecified. */
> +#   define NI 1024
> +#   define NJ 1024
> +#   define NK 1024
> +#   define NL 1024
> +#   define NM 1024
> +#  endif
> +
> +#  ifdef LARGE_DATASET
> +#   define NI 2000
> +#   define NJ 2000
> +#   define NK 2000
> +#   define NL 2000
> +#   define NM 2000
> +#  endif
> +
> +#  ifdef EXTRALARGE_DATASET
> +#   define NI 4000
> +#   define NJ 4000
> +#   define NK 4000
> +#   define NL 4000
> +#   define NM 4000
> +#  endif
> +# endif /* !N */
> +
> +# define _PB_NI POLYBENCH_LOOP_BOUND(NI,ni)
> +# define _PB_NJ POLYBENCH_LOOP_BOUND(NJ,nj)
> +# define _PB_NK POLYBENCH_LOOP_BOUND(NK,nk)
> +# define _PB_NL POLYBENCH_LOOP_BOUND(NL,nl)
> +# define _PB_NM POLYBENCH_LOOP_BOUND(NM,nm)
> +
> +# ifndef DATA_TYPE
> +#  define DATA_TYPE double
> +#  define DATA_PRINTF_MODIFIER "%0.2lf "
> +# endif
> +
> +
> +#endif /* !_3MM */
> 
> Propchange: test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/3mm/3mm.h
> ------------------------------------------------------------------------------
>    svn:executable = *
> 
> Added: test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/3mm/3mm.reference_output
> URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/3mm/3mm.reference_output?rev=159553&view=auto
> ==============================================================================
> --- test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/3mm/3mm.reference_output (added)
> +++ test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/3mm/3mm.reference_output Mon Jul  2 14:27:28 2012
> @@ -0,0 +1 @@
> +66eb54f857bc65f405ee520b4f181935
> 
> Propchange: test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/3mm/3mm.reference_output
> ------------------------------------------------------------------------------
>    svn:executable = *
> 
> Added: test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/3mm/Makefile
> URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/3mm/Makefile?rev=159553&view=auto
> ==============================================================================
> --- test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/3mm/Makefile (added)
> +++ test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/3mm/Makefile Mon Jul  2 14:27:28 2012
> @@ -0,0 +1,10 @@
> +LEVEL = ../../../../../..
> +
> +POLYBENCH_UTILS = SingleSource/Benchmarks/Polybench/utilities 
> +PROG         = 3mm
> +CFLAGS       += -I $(PROJ_SRC_ROOT)/$(POLYBENCH_UTILS) -DPOLYBENCH_DUMP_ARRAYS
> +
> +HASH_PROGRAM_OUTPUT = 1
> +
> +include $(LEVEL)/SingleSource/Makefile.singlesrc
> +
> 
> Propchange: test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/3mm/Makefile
> ------------------------------------------------------------------------------
>    svn:executable = *
> 
> Added: test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/3mm/compiler.opts
> URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/3mm/compiler.opts?rev=159553&view=auto
> ==============================================================================
> --- test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/3mm/compiler.opts (added)
> +++ test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/3mm/compiler.opts Mon Jul  2 14:27:28 2012
> @@ -0,0 +1 @@
> +-DNI=1024 -DNJ=1024 -DNK=1024 -DNL=1024 -DNM=1024
> 
> Propchange: test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/3mm/compiler.opts
> ------------------------------------------------------------------------------
>    svn:executable = *
> 
> Added: test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/Makefile
> URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/Makefile?rev=159553&view=auto
> ==============================================================================
> --- test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/Makefile (added)
> +++ test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/Makefile Mon Jul  2 14:27:28 2012
> @@ -0,0 +1,11 @@
> +# SingleSource/Polybench/linear-algebra
> +# Makefile:  Build all subdirectories automatically
> +
> +LEVEL = ../../../../..
> +PARALLEL_DIRS = 2mm 3mm atax bicg cholesky doitgen gemm gemver gesummv mvt \
> + 		symm syr2k syrk trisolv trmm
> +		
> +
> +include $(LEVEL)/Makefile.config
> +include $(LEVEL)/Makefile.programs
> +
> 
> Propchange: test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/Makefile
> ------------------------------------------------------------------------------
>    svn:executable = *
> 
> Added: test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/atax/Makefile
> URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/atax/Makefile?rev=159553&view=auto
> ==============================================================================
> --- test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/atax/Makefile (added)
> +++ test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/atax/Makefile Mon Jul  2 14:27:28 2012
> @@ -0,0 +1,10 @@
> +LEVEL = ../../../../../..
> +
> +POLYBENCH_UTILS = SingleSource/Benchmarks/Polybench/utilities 
> +PROG          = atax
> +CFLAGS        += -I $(PROJ_SRC_ROOT)/$(POLYBENCH_UTILS) -DPOLYBENCH_DUMP_ARRAYS
> +
> +HASH_PROGRAM_OUTPUT = 1
> +
> +include $(LEVEL)/SingleSource/Makefile.singlesrc
> +
> 
> Propchange: test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/atax/Makefile
> ------------------------------------------------------------------------------
>    svn:executable = *
> 
> Added: test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/atax/atax.c
> URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/atax/atax.c?rev=159553&view=auto
> ==============================================================================
> --- test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/atax/atax.c (added)
> +++ test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/atax/atax.c Mon Jul  2 14:27:28 2012
> @@ -0,0 +1,121 @@
> +/**
> + * atax.c: This file is part of the PolyBench/C 3.2 test suite.
> + *
> + *
> + * Contact: Louis-Noel Pouchet <pouchet at cse.ohio-state.edu>
> + * Web address: http://polybench.sourceforge.net
> + */
> +#include <stdio.h>
> +#include <unistd.h>
> +#include <string.h>
> +#include <math.h>
> +
> +/* Include polybench common header. */
> +#include <polybench.h>
> +
> +/* Include benchmark-specific header. */
> +/* Default data type is double, default size is 4000. */
> +#include "atax.h"
> +
> +
> +/* Array initialization. */
> +static
> +void init_array (int nx, int ny,
> +		 DATA_TYPE POLYBENCH_2D(A,NX,NY,nx,ny),
> +		 DATA_TYPE POLYBENCH_1D(x,NY,ny))
> +{
> +  int i, j;
> +
> +  for (i = 0; i < ny; i++)
> +      x[i] = i * M_PI;
> +  for (i = 0; i < nx; i++)
> +    for (j = 0; j < ny; j++)
> +      A[i][j] = ((DATA_TYPE) i*(j+1)) / nx;
> +}
> +
> +
> +/* DCE code. Must scan the entire live-out data.
> +   Can be used also to check the correctness of the output. */
> +static
> +void print_array(int nx,
> +		 DATA_TYPE POLYBENCH_1D(y,NX,nx))
> +
> +{
> +  int i;
> +
> +  for (i = 0; i < nx; i++) {
> +    fprintf (stderr, DATA_PRINTF_MODIFIER, y[i]);
> +    if (i % 20 == 0) fprintf (stderr, "\n");
> +  }
> +  fprintf (stderr, "\n");
> +}
> +
> +
> +/* Main computational kernel. The whole function will be timed,
> +   including the call and return. */
> +static
> +void kernel_atax(int nx, int ny,
> +		 DATA_TYPE POLYBENCH_2D(A,NX,NY,nx,ny),
> +		 DATA_TYPE POLYBENCH_1D(x,NY,ny),
> +		 DATA_TYPE POLYBENCH_1D(y,NY,ny),
> +		 DATA_TYPE POLYBENCH_1D(tmp,NX,nx))
> +{
> +  int i, j;
> +
> +#pragma scop
> +  for (i = 0; i < _PB_NY; i++)
> +    y[i] = 0;
> +  for (i = 0; i < _PB_NX; i++)
> +    {
> +      tmp[i] = 0;
> +      for (j = 0; j < _PB_NY; j++)
> +	tmp[i] = tmp[i] + A[i][j] * x[j];
> +      for (j = 0; j < _PB_NY; j++)
> +	y[j] = y[j] + A[i][j] * tmp[i];
> +    }
> +#pragma endscop
> +
> +}
> +
> +
> +int main(int argc, char** argv)
> +{
> +  /* Retrieve problem size. */
> +  int nx = NX;
> +  int ny = NY;
> +
> +  /* Variable declaration/allocation. */
> +  POLYBENCH_2D_ARRAY_DECL(A, DATA_TYPE, NX, NY, nx, ny);
> +  POLYBENCH_1D_ARRAY_DECL(x, DATA_TYPE, NY, ny);
> +  POLYBENCH_1D_ARRAY_DECL(y, DATA_TYPE, NY, ny);
> +  POLYBENCH_1D_ARRAY_DECL(tmp, DATA_TYPE, NX, nx);
> +
> +  /* Initialize array(s). */
> +  init_array (nx, ny, POLYBENCH_ARRAY(A), POLYBENCH_ARRAY(x));
> +
> +  /* Start timer. */
> +  polybench_start_instruments;
> +
> +  /* Run kernel. */
> +  kernel_atax (nx, ny,
> +	       POLYBENCH_ARRAY(A),
> +	       POLYBENCH_ARRAY(x),
> +	       POLYBENCH_ARRAY(y),
> +	       POLYBENCH_ARRAY(tmp));
> +
> +  /* Stop and print timer. */
> +  polybench_stop_instruments;
> +  polybench_print_instruments;
> +
> +  /* Prevent dead-code elimination. All live-out data must be printed
> +     by the function call in argument. */
> +  polybench_prevent_dce(print_array(nx, POLYBENCH_ARRAY(y)));
> +
> +  /* Be clean. */
> +  POLYBENCH_FREE_ARRAY(A);
> +  POLYBENCH_FREE_ARRAY(x);
> +  POLYBENCH_FREE_ARRAY(y);
> +  POLYBENCH_FREE_ARRAY(tmp);
> +
> +  return 0;
> +}
> 
> Propchange: test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/atax/atax.c
> ------------------------------------------------------------------------------
>    svn:executable = *
> 
> Added: test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/atax/atax.h
> URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/atax/atax.h?rev=159553&view=auto
> ==============================================================================
> --- test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/atax/atax.h (added)
> +++ test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/atax/atax.h Mon Jul  2 14:27:28 2012
> @@ -0,0 +1,54 @@
> +/**
> + * atax.h: This file is part of the PolyBench/C 3.2 test suite.
> + *
> + *
> + * Contact: Louis-Noel Pouchet <pouchet at cse.ohio-state.edu>
> + * Web address: http://polybench.sourceforge.net
> + */
> +#ifndef ATAX_H
> +# define ATAX_H
> +
> +/* Default to STANDARD_DATASET. */
> +# if !defined(MINI_DATASET) && !defined(SMALL_DATASET) && !defined(LARGE_DATASET) && !defined(EXTRALARGE_DATASET)
> +#  define STANDARD_DATASET
> +# endif
> +
> +/* Do not define anything if the user manually defines the size. */
> +# if !defined(NX) && !defined(NY)
> +/* Define the possible dataset sizes. */
> +#  ifdef MINI_DATASET
> +#   define NX 32
> +#   define NY 32
> +#  endif
> +
> +#  ifdef SMALL_DATASET
> +#   define NX 500
> +#   define NY 500
> +#  endif
> +
> +#  ifdef STANDARD_DATASET /* Default if unspecified. */
> +#   define NX 4000
> +#   define NY 4000
> +#  endif
> +
> +#  ifdef LARGE_DATASET
> +#   define NX 8000
> +#   define NY 8000
> +#  endif
> +
> +#  ifdef EXTRALARGE_DATASET
> +#   define NX 100000
> +#   define NY 100000
> +#  endif
> +# endif /* !N */
> +
> +# define _PB_NX POLYBENCH_LOOP_BOUND(NX,nx)
> +# define _PB_NY POLYBENCH_LOOP_BOUND(NY,ny)
> +
> +# ifndef DATA_TYPE
> +#  define DATA_TYPE double
> +#  define DATA_PRINTF_MODIFIER "%0.2lf "
> +# endif
> +
> +
> +#endif /* !ATAX */
> 
> Propchange: test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/atax/atax.h
> ------------------------------------------------------------------------------
>    svn:executable = *
> 
> Added: test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/atax/atax.reference_output
> URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/atax/atax.reference_output?rev=159553&view=auto
> ==============================================================================
> --- test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/atax/atax.reference_output (added)
> +++ test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/atax/atax.reference_output Mon Jul  2 14:27:28 2012
> @@ -0,0 +1 @@
> +d56aab8d63bea01bd7e864dd3406f266
> 
> Propchange: test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/atax/atax.reference_output
> ------------------------------------------------------------------------------
>    svn:executable = *
> 
> Added: test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/bicg/Makefile
> URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/bicg/Makefile?rev=159553&view=auto
> ==============================================================================
> --- test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/bicg/Makefile (added)
> +++ test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/bicg/Makefile Mon Jul  2 14:27:28 2012
> @@ -0,0 +1,10 @@
> +LEVEL = ../../../../../..
> +
> +POLYBENCH_UTILS = SingleSource/Benchmarks/Polybench/utilities 
> +PROG          = bicg
> +CFLAGS        += -I $(PROJ_SRC_ROOT)/$(POLYBENCH_UTILS) -DPOLYBENCH_DUMP_ARRAYS
> +
> +HASH_PROGRAM_OUTPUT = 1
> +
> +include $(LEVEL)/SingleSource/Makefile.singlesrc
> +
> 
> Propchange: test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/bicg/Makefile
> ------------------------------------------------------------------------------
>    svn:executable = *
> 
> Added: test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/bicg/bicg.c
> URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/bicg/bicg.c?rev=159553&view=auto
> ==============================================================================
> --- test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/bicg/bicg.c (added)
> +++ test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/bicg/bicg.c Mon Jul  2 14:27:28 2012
> @@ -0,0 +1,137 @@
> +/**
> + * bicg.c: This file is part of the PolyBench/C 3.2 test suite.
> + *
> + *
> + * Contact: Louis-Noel Pouchet <pouchet at cse.ohio-state.edu>
> + * Web address: http://polybench.sourceforge.net
> + */
> +#include <stdio.h>
> +#include <unistd.h>
> +#include <string.h>
> +#include <math.h>
> +
> +/* Include polybench common header. */
> +#include <polybench.h>
> +
> +/* Include benchmark-specific header. */
> +/* Default data type is double, default size is 4000. */
> +#include "bicg.h"
> +
> +
> +/* Array initialization. */
> +static
> +void init_array (int nx, int ny,
> +		 DATA_TYPE POLYBENCH_2D(A,NX,NY,nx,ny),
> +		 DATA_TYPE POLYBENCH_1D(r,NX,nx),
> +		 DATA_TYPE POLYBENCH_1D(p,NY,ny))
> +{
> +  int i, j;
> +
> +  for (i = 0; i < ny; i++)
> +    p[i] = i * M_PI;
> +  for (i = 0; i < nx; i++) {
> +    r[i] = i * M_PI;
> +    for (j = 0; j < ny; j++)
> +      A[i][j] = ((DATA_TYPE) i*(j+1))/nx;
> +  }
> +}
> +
> +
> +/* DCE code. Must scan the entire live-out data.
> +   Can be used also to check the correctness of the output. */
> +static
> +void print_array(int nx, int ny,
> +		 DATA_TYPE POLYBENCH_1D(s,NY,ny),
> +		 DATA_TYPE POLYBENCH_1D(q,NX,nx))
> +
> +{
> +  int i;
> +
> +  for (i = 0; i < ny; i++) {
> +    fprintf (stderr, DATA_PRINTF_MODIFIER, s[i]);
> +    if (i % 20 == 0) fprintf (stderr, "\n");
> +  }
> +  for (i = 0; i < nx; i++) {
> +    fprintf (stderr, DATA_PRINTF_MODIFIER, q[i]);
> +    if (i % 20 == 0) fprintf (stderr, "\n");
> +  }
> +  fprintf (stderr, "\n");
> +}
> +
> +
> +/* Main computational kernel. The whole function will be timed,
> +   including the call and return. */
> +static
> +void kernel_bicg(int nx, int ny,
> +		 DATA_TYPE POLYBENCH_2D(A,NX,NY,nx,ny),
> +		 DATA_TYPE POLYBENCH_1D(s,NY,ny),
> +		 DATA_TYPE POLYBENCH_1D(q,NX,nx),
> +		 DATA_TYPE POLYBENCH_1D(p,NY,ny),
> +		 DATA_TYPE POLYBENCH_1D(r,NX,nx))
> +{
> +  int i, j;
> +
> +#pragma scop
> +  for (i = 0; i < _PB_NY; i++)
> +    s[i] = 0;
> +  for (i = 0; i < _PB_NX; i++)
> +    {
> +      q[i] = 0;
> +      for (j = 0; j < _PB_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)
> +{
> +  /* Retrieve problem size. */
> +  int nx = NX;
> +  int ny = NY;
> +
> +  /* Variable declaration/allocation. */
> +  POLYBENCH_2D_ARRAY_DECL(A, DATA_TYPE, NX, NY, nx, ny);
> +  POLYBENCH_1D_ARRAY_DECL(s, DATA_TYPE, NY, ny);
> +  POLYBENCH_1D_ARRAY_DECL(q, DATA_TYPE, NX, nx);
> +  POLYBENCH_1D_ARRAY_DECL(p, DATA_TYPE, NY, ny);
> +  POLYBENCH_1D_ARRAY_DECL(r, DATA_TYPE, NX, nx);
> +
> +  /* Initialize array(s). */
> +  init_array (nx, ny,
> +	      POLYBENCH_ARRAY(A),
> +	      POLYBENCH_ARRAY(r),
> +	      POLYBENCH_ARRAY(p));
> +
> +  /* Start timer. */
> +  polybench_start_instruments;
> +
> +  /* Run kernel. */
> +  kernel_bicg (nx, ny,
> +	       POLYBENCH_ARRAY(A),
> +	       POLYBENCH_ARRAY(s),
> +	       POLYBENCH_ARRAY(q),
> +	       POLYBENCH_ARRAY(p),
> +	       POLYBENCH_ARRAY(r));
> +
> +  /* Stop and print timer. */
> +  polybench_stop_instruments;
> +  polybench_print_instruments;
> +
> +  /* Prevent dead-code elimination. All live-out data must be printed
> +     by the function call in argument. */
> +  polybench_prevent_dce(print_array(nx, ny, POLYBENCH_ARRAY(s), POLYBENCH_ARRAY(q)));
> +
> +  /* Be clean. */
> +  POLYBENCH_FREE_ARRAY(A);
> +  POLYBENCH_FREE_ARRAY(s);
> +  POLYBENCH_FREE_ARRAY(q);
> +  POLYBENCH_FREE_ARRAY(p);
> +  POLYBENCH_FREE_ARRAY(r);
> +
> +  return 0;
> +}
> 
> Propchange: test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/bicg/bicg.c
> ------------------------------------------------------------------------------
>    svn:executable = *
> 
> Added: test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/bicg/bicg.h
> URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/bicg/bicg.h?rev=159553&view=auto
> ==============================================================================
> --- test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/bicg/bicg.h (added)
> +++ test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/bicg/bicg.h Mon Jul  2 14:27:28 2012
> @@ -0,0 +1,54 @@
> +/**
> + * bicg.h: This file is part of the PolyBench/C 3.2 test suite.
> + *
> + *
> + * Contact: Louis-Noel Pouchet <pouchet at cse.ohio-state.edu>
> + * Web address: http://polybench.sourceforge.net
> + */
> +#ifndef BICG_H
> +# define BICG_H
> +
> +/* Default to STANDARD_DATASET. */
> +# if !defined(MINI_DATASET) && !defined(SMALL_DATASET) && !defined(LARGE_DATASET) && !defined(EXTRALARGE_DATASET)
> +#  define STANDARD_DATASET
> +# endif
> +
> +/* Do not define anything if the user manually defines the size. */
> +# if !defined(NX) && !defined(NY)
> +/* Define the possible dataset sizes. */
> +#  ifdef MINI_DATASET
> +#   define NX 32
> +#   define NY 32
> +#  endif
> +
> +#  ifdef SMALL_DATASET
> +#   define NX 500
> +#   define NY 500
> +#  endif
> +
> +#  ifdef STANDARD_DATASET /* Default if unspecified. */
> +#   define NX 4000
> +#   define NY 4000
> +#  endif
> +
> +#  ifdef LARGE_DATASET
> +#   define NX 8000
> +#   define NY 8000
> +#  endif
> +
> +#  ifdef EXTRALARGE_DATASET
> +#   define NX 100000
> +#   define NY 100000
> +#  endif
> +# endif /* !N */
> +
> +# define _PB_NX POLYBENCH_LOOP_BOUND(NX,nx)
> +# define _PB_NY POLYBENCH_LOOP_BOUND(NY,ny)
> +
> +# ifndef DATA_TYPE
> +#  define DATA_TYPE double
> +#  define DATA_PRINTF_MODIFIER "%0.2lf "
> +# endif
> +
> +
> +#endif /* !BICG */
> 
> Propchange: test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/bicg/bicg.h
> ------------------------------------------------------------------------------
>    svn:executable = *
> 
> Added: test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/bicg/bicg.reference_output
> URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/bicg/bicg.reference_output?rev=159553&view=auto
> ==============================================================================
> --- test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/bicg/bicg.reference_output (added)
> +++ test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/bicg/bicg.reference_output Mon Jul  2 14:27:28 2012
> @@ -0,0 +1 @@
> +cb5bae69c1a3653edab30d8bcf027bbf
> 
> Propchange: test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/bicg/bicg.reference_output
> ------------------------------------------------------------------------------
>    svn:executable = *
> 
> Added: test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/cholesky/Makefile
> URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/cholesky/Makefile?rev=159553&view=auto
> ==============================================================================
> --- test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/cholesky/Makefile (added)
> +++ test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/cholesky/Makefile Mon Jul  2 14:27:28 2012
> @@ -0,0 +1,10 @@
> +LEVEL = ../../../../../..
> +
> +POLYBENCH_UTILS = SingleSource/Benchmarks/Polybench/utilities 
> +PROG          = cholesky
> +CFLAGS        += -I $(PROJ_SRC_ROOT)/$(POLYBENCH_UTILS) -DPOLYBENCH_DUMP_ARRAYS
> +
> +HASH_PROGRAM_OUTPUT = 1
> +
> +include $(LEVEL)/SingleSource/Makefile.singlesrc
> +
> 
> Propchange: test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/cholesky/Makefile
> ------------------------------------------------------------------------------
>    svn:executable = *
> 
> Added: test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/cholesky/cholesky.c
> URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/cholesky/cholesky.c?rev=159553&view=auto
> ==============================================================================
> --- test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/cholesky/cholesky.c (added)
> +++ test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/cholesky/cholesky.c Mon Jul  2 14:27:28 2012
> @@ -0,0 +1,136 @@
> +/**
> + * cholesky.c: This file is part of the PolyBench/C 3.2 test suite.
> + *
> + *
> + * Contact: Louis-Noel Pouchet <pouchet at cse.ohio-state.edu>
> + * Web address: http://polybench.sourceforge.net
> + */
> +#include <stdio.h>
> +#include <unistd.h>
> +#include <string.h>
> +#include <math.h>
> +
> +/* Include polybench common header. */
> +#include <polybench.h>
> +
> +/* Include benchmark-specific header. */
> +/* Default data type is double, default size is 4000. */
> +#include "cholesky.h"
> +
> +
> +/* Array initialization. */
> +static
> +void init_array(int n,
> +		DATA_TYPE POLYBENCH_1D(p,N,n),
> +		DATA_TYPE POLYBENCH_2D(A,N,N,n,n))
> +{
> +  int i, j;
> +  /*
> +  LLVM: This change ensures we do not calculate nan values, which are
> +        formatted differently on different platforms and which may also
> +        be optimized unexpectedly.
> +  Original code:
> +  for (i = 0; i < n; i++)
> +    {
> +      p[i] = 1.0 / n;
> +      for (j = 0; j < n; j++)
> +        A[i][j] = 1.0 / n;
> +     }
> +  */
> +  for (i = 0; i < n; i++)
> +    {
> +      p[i] = i + n;
> +      for (j = 0; j < n; j++)
> +      	A[i][j] = j + n;
> +    }
> +}
> +
> +
> +/* DCE code. Must scan the entire live-out data.
> +   Can be used also to check the correctness of the output. */
> +static
> +void print_array(int n,
> +		 DATA_TYPE POLYBENCH_2D(A,N,N,n,n))
> +
> +{
> +  int i, j;
> +
> +  for (i = 0; i < n; i++)
> +    for (j = 0; j < n; j++) {
> +    fprintf (stderr, DATA_PRINTF_MODIFIER, A[i][j]);
> +    if ((i * N + j) % 20 == 0) fprintf (stderr, "\n");
> +  }
> +}
> +
> +
> +/* Main computational kernel. The whole function will be timed,
> +   including the call and return. */
> +static
> +void kernel_cholesky(int n,
> +		     DATA_TYPE POLYBENCH_1D(p,N,n),
> +		     DATA_TYPE POLYBENCH_2D(A,N,N,n,n))
> +{
> +  int i, j, k;
> +
> +  DATA_TYPE x;
> +
> +#pragma scop
> +for (i = 0; i < _PB_N; ++i)
> +  {
> +   /*
> +      LLVM: This change ensures we do not calculate nan values, which are
> +            formatted differently on different platforms and which may also
> +            be optimized unexpectedly.    
> +      Original line:      
> +            x = A[i][i];      
> +    */      
> +    x = A[i][i] * n;
> +    for (j = 0; j <= i - 1; ++j)
> +      x = x - A[i][j] * A[i][j];
> +    p[i] = 1.0 / sqrt(x);
> +    for (j = i + 1; j < _PB_N; ++j)
> +      {
> +	x = A[i][j];
> +	for (k = 0; k <= i - 1; ++k)
> +	  x = x - A[j][k] * A[i][k];
> +	A[j][i] = x * p[i];
> +      }
> +  }
> +#pragma endscop
> +
> +}
> +
> +
> +int main(int argc, char** argv)
> +{
> +  /* Retrieve problem size. */
> +  int n = N;
> +
> +  /* Variable declaration/allocation. */
> +  POLYBENCH_2D_ARRAY_DECL(A, DATA_TYPE, N, N, n, n);
> +  POLYBENCH_1D_ARRAY_DECL(p, DATA_TYPE, N, n);
> +
> +
> +  /* Initialize array(s). */
> +  init_array (n, POLYBENCH_ARRAY(p), POLYBENCH_ARRAY(A));
> +
> +  /* Start timer. */
> +  polybench_start_instruments;
> +
> +  /* Run kernel. */
> +  kernel_cholesky (n, POLYBENCH_ARRAY(p), POLYBENCH_ARRAY(A));
> +
> +  /* Stop and print timer. */
> +  polybench_stop_instruments;
> +  polybench_print_instruments;
> +
> +  /* Prevent dead-code elimination. All live-out data must be printed
> +     by the function call in argument. */
> +  polybench_prevent_dce(print_array(n, POLYBENCH_ARRAY(A)));
> +
> +  /* Be clean. */
> +  POLYBENCH_FREE_ARRAY(A);
> +  POLYBENCH_FREE_ARRAY(p);
> +
> +  return 0;
> +}
> 
> Propchange: test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/cholesky/cholesky.c
> ------------------------------------------------------------------------------
>    svn:executable = *
> 
> Added: test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/cholesky/cholesky.h
> URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/cholesky/cholesky.h?rev=159553&view=auto
> ==============================================================================
> --- test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/cholesky/cholesky.h (added)
> +++ test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/cholesky/cholesky.h Mon Jul  2 14:27:28 2012
> @@ -0,0 +1,48 @@
> +/**
> + * cholesky.h: This file is part of the PolyBench/C 3.2 test suite.
> + *
> + *
> + * Contact: Louis-Noel Pouchet <pouchet at cse.ohio-state.edu>
> + * Web address: http://polybench.sourceforge.net
> + */
> +#ifndef CHOLESKY_H
> +# define CHOLESKY_H
> +
> +/* Default to STANDARD_DATASET. */
> +# if !defined(MINI_DATASET) && !defined(SMALL_DATASET) && !defined(LARGE_DATASET) && !defined(EXTRALARGE_DATASET)
> +#  define STANDARD_DATASET
> +# endif
> +
> +/* Do not define anything if the user manually defines the size. */
> +# if !defined(N)
> +/* Define the possible dataset sizes. */
> +#  ifdef MINI_DATASET
> +#   define N 32
> +#  endif
> +
> +#  ifdef SMALL_DATASET
> +#   define N 128
> +#  endif
> +
> +#  ifdef STANDARD_DATASET /* Default if unspecified. */
> +#   define N 1024
> +#  endif
> +
> +#  ifdef LARGE_DATASET
> +#   define N 2000
> +#  endif
> +
> +#  ifdef EXTRALARGE_DATASET
> +#   define N 4000
> +#  endif
> +# endif /* !N */
> +
> +# define _PB_N POLYBENCH_LOOP_BOUND(N,n)
> +
> +# ifndef DATA_TYPE
> +#  define DATA_TYPE double
> +#  define DATA_PRINTF_MODIFIER "%0.2lf "
> +# endif
> +
> +
> +#endif /* !CHOLESKY */
> 
> Propchange: test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/cholesky/cholesky.h
> ------------------------------------------------------------------------------
>    svn:executable = *
> 
> Added: test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/cholesky/cholesky.reference_output
> URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/cholesky/cholesky.reference_output?rev=159553&view=auto
> ==============================================================================
> --- test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/cholesky/cholesky.reference_output (added)
> +++ test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/cholesky/cholesky.reference_output Mon Jul  2 14:27:28 2012
> @@ -0,0 +1 @@
> +1fb54fb516d4be7c0bb185f73c7d3292
> 
> Propchange: test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/cholesky/cholesky.reference_output
> ------------------------------------------------------------------------------
>    svn:executable = *
> 
> Added: test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/doitgen/Makefile
> URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/doitgen/Makefile?rev=159553&view=auto
> ==============================================================================
> --- test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/doitgen/Makefile (added)
> +++ test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/doitgen/Makefile Mon Jul  2 14:27:28 2012
> @@ -0,0 +1,10 @@
> +LEVEL = ../../../../../..
> +
> +POLYBENCH_UTILS = SingleSource/Benchmarks/Polybench/utilities 
> +PROG          = doitgen
> +CFLAGS        += -I $(PROJ_SRC_ROOT)/$(POLYBENCH_UTILS) -DPOLYBENCH_DUMP_ARRAYS
> +
> +HASH_PROGRAM_OUTPUT = 1
> +
> +include $(LEVEL)/SingleSource/Makefile.singlesrc
> +
> 
> Propchange: test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/doitgen/Makefile
> ------------------------------------------------------------------------------
>    svn:executable = *
> 
> Added: test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/doitgen/doitgen.c
> URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/doitgen/doitgen.c?rev=159553&view=auto
> ==============================================================================
> --- test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/doitgen/doitgen.c (added)
> +++ test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/doitgen/doitgen.c Mon Jul  2 14:27:28 2012
> @@ -0,0 +1,123 @@
> +/**
> + * doitgen.c: This file is part of the PolyBench/C 3.2 test suite.
> + *
> + *
> + * Contact: Louis-Noel Pouchet <pouchet at cse.ohio-state.edu>
> + * Web address: http://polybench.sourceforge.net
> + */
> +#include <stdio.h>
> +#include <unistd.h>
> +#include <string.h>
> +#include <math.h>
> +
> +/* Include polybench common header. */
> +#include <polybench.h>
> +
> +/* Include benchmark-specific header. */
> +/* Default data type is double, default size is 4000. */
> +#include "doitgen.h"
> +
> +
> +/* Array initialization. */
> +static
> +void init_array(int nr, int nq, int np,
> +		DATA_TYPE POLYBENCH_3D(A,NR,NQ,NP,nr,nq,np),
> +		DATA_TYPE POLYBENCH_2D(C4,NP,NP,np,np))
> +{
> +  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;
> +}
> +
> +
> +/* DCE code. Must scan the entire live-out data.
> +   Can be used also to check the correctness of the output. */
> +static
> +void print_array(int nr, int nq, int np,
> +		 DATA_TYPE POLYBENCH_3D(A,NR,NQ,NP,nr,nq,np))
> +{
> +  int i, j, k;
> +
> +  for (i = 0; i < nr; i++)
> +    for (j = 0; j < nq; j++)
> +      for (k = 0; k < np; k++) {
> +	fprintf (stderr, DATA_PRINTF_MODIFIER, A[i][j][k]);
> +	if (i % 20 == 0) fprintf (stderr, "\n");
> +      }
> +  fprintf (stderr, "\n");
> +}
> +
> +
> +/* Main computational kernel. The whole function will be timed,
> +   including the call and return. */
> +static
> +void kernel_doitgen(int nr, int nq, int np,
> +		    DATA_TYPE POLYBENCH_3D(A,NR,NQ,NP,nr,nq,np),
> +		    DATA_TYPE POLYBENCH_2D(C4,NP,NP,np,np),
> +		    DATA_TYPE POLYBENCH_3D(sum,NR,NQ,NP,nr,nq,np))
> +{
> +  int r, q, p, s;
> +
> +#pragma scop
> +  for (r = 0; r < _PB_NR; r++)
> +    for (q = 0; q < _PB_NQ; q++)  {
> +      for (p = 0; p < _PB_NP; p++)  {
> +	sum[r][q][p] = 0;
> +	for (s = 0; s < _PB_NP; s++)
> +	  sum[r][q][p] = sum[r][q][p] + A[r][q][s] * C4[s][p];
> +      }
> +      for (p = 0; p < _PB_NR; p++)
> +	A[r][q][p] = sum[r][q][p];
> +    }
> +#pragma endscop
> +
> +}
> +
> +
> +int main(int argc, char** argv)
> +{
> +  /* Retrieve problem size. */
> +  int nr = NR;
> +  int nq = NQ;
> +  int np = NP;
> +
> +  /* Variable declaration/allocation. */
> +  POLYBENCH_3D_ARRAY_DECL(A,DATA_TYPE,NR,NQ,NP,nr,nq,np);
> +  POLYBENCH_3D_ARRAY_DECL(sum,DATA_TYPE,NR,NQ,NP,nr,nq,np);
> +  POLYBENCH_2D_ARRAY_DECL(C4,DATA_TYPE,NP,NP,np,np);
> +
> +  /* Initialize array(s). */
> +  init_array (nr, nq, np,
> +	      POLYBENCH_ARRAY(A),
> +	      POLYBENCH_ARRAY(C4));
> +
> +  /* Start timer. */
> +  polybench_start_instruments;
> +
> +  /* Run kernel. */
> +  kernel_doitgen (nr, nq, np,
> +		  POLYBENCH_ARRAY(A),
> +		  POLYBENCH_ARRAY(C4),
> +		  POLYBENCH_ARRAY(sum));
> +
> +  /* Stop and print timer. */
> +  polybench_stop_instruments;
> +  polybench_print_instruments;
> +
> +  /* Prevent dead-code elimination. All live-out data must be printed
> +     by the function call in argument. */
> +  polybench_prevent_dce(print_array(nr, nq, np,  POLYBENCH_ARRAY(A)));
> +
> +  /* Be clean. */
> +  POLYBENCH_FREE_ARRAY(A);
> +  POLYBENCH_FREE_ARRAY(sum);
> +  POLYBENCH_FREE_ARRAY(C4);
> +
> +  return 0;
> +}
> 
> Propchange: test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/doitgen/doitgen.c
> ------------------------------------------------------------------------------
>    svn:executable = *
> 
> Added: test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/doitgen/doitgen.h
> URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/doitgen/doitgen.h?rev=159553&view=auto
> ==============================================================================
> --- test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/doitgen/doitgen.h (added)
> +++ test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/doitgen/doitgen.h Mon Jul  2 14:27:28 2012
> @@ -0,0 +1,60 @@
> +/**
> + * doitgen.h: This file is part of the PolyBench/C 3.2 test suite.
> + *
> + *
> + * Contact: Louis-Noel Pouchet <pouchet at cse.ohio-state.edu>
> + * Web address: http://polybench.sourceforge.net
> + */
> +#ifndef DOITGEN_H
> +# define DOITGEN_H
> +
> +/* Default to STANDARD_DATASET. */
> +# if !defined(MINI_DATASET) && !defined(SMALL_DATASET) && !defined(LARGE_DATASET) && !defined(EXTRALARGE_DATASET)
> +#  define STANDARD_DATASET
> +# endif
> +
> +/* Do not define anything if the user manually defines the size. */
> +# if !defined(NQ) && !defined(NR) && !defined(NP)
> +/* Define the possible dataset sizes. */
> +#  ifdef MINI_DATASET
> +#   define NQ 10
> +#   define NR 10
> +#   define NP 10
> +#  endif
> +
> +#  ifdef SMALL_DATASET
> +#   define NQ 32
> +#   define NR 32
> +#   define NP 32
> +#  endif
> +
> +#  ifdef STANDARD_DATASET /* Default if unspecified. */
> +#   define NQ 128
> +#   define NR 128
> +#   define NP 128
> +#  endif
> +
> +#  ifdef LARGE_DATASET
> +#   define NQ 256
> +#   define NR 256
> +#   define NP 256
> +#  endif
> +
> +#  ifdef EXTRALARGE_DATASET
> +#   define NQ 1000
> +#   define NR 1000
> +#   define NP 1000
> +#  endif
> +# endif /* !N */
> +
> +# define _PB_NQ POLYBENCH_LOOP_BOUND(NQ,nq)
> +# define _PB_NR POLYBENCH_LOOP_BOUND(NR,nr)
> +# define _PB_NP POLYBENCH_LOOP_BOUND(NP,np)
> +
> +# ifndef DATA_TYPE
> +#  define DATA_TYPE double
> +#  define DATA_PRINTF_MODIFIER "%0.2lf "
> +# endif
> +
> +
> +#endif /* !DOITGEN */
> 
> Propchange: test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/doitgen/doitgen.h
> ------------------------------------------------------------------------------
>    svn:executable = *
> 
> Added: test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/doitgen/doitgen.reference_output
> URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/doitgen/doitgen.reference_output?rev=159553&view=auto
> ==============================================================================
> --- test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/doitgen/doitgen.reference_output (added)
> +++ test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/doitgen/doitgen.reference_output Mon Jul  2 14:27:28 2012
> @@ -0,0 +1 @@
> +65adf58a59d20588e34936ce58fd7e0f
> 
> Propchange: test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/doitgen/doitgen.reference_output
> ------------------------------------------------------------------------------
>    svn:executable = *
> 
> Added: test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/gemm/Makefile
> URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/gemm/Makefile?rev=159553&view=auto
> ==============================================================================
> --- test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/gemm/Makefile (added)
> +++ test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/gemm/Makefile Mon Jul  2 14:27:28 2012
> @@ -0,0 +1,10 @@
> +LEVEL = ../../../../../..
> +
> +POLYBENCH_UTILS = SingleSource/Benchmarks/Polybench/utilities 
> +PROG          = gemm
> +CFLAGS        += -I $(PROJ_SRC_ROOT)/$(POLYBENCH_UTILS) -DPOLYBENCH_DUMP_ARRAYS
> +
> +HASH_PROGRAM_OUTPUT = 1
> +
> +include $(LEVEL)/SingleSource/Makefile.singlesrc
> +
> 
> Propchange: test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/gemm/Makefile
> ------------------------------------------------------------------------------
>    svn:executable = *
> 
> Added: test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/gemm/gemm.c
> URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/gemm/gemm.c?rev=159553&view=auto
> ==============================================================================
> --- test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/gemm/gemm.c (added)
> +++ test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/gemm/gemm.c Mon Jul  2 14:27:28 2012
> @@ -0,0 +1,133 @@
> +/**
> + * gemm.c: This file is part of the PolyBench/C 3.2 test suite.
> + *
> + *
> + * Contact: Louis-Noel Pouchet <pouchet at cse.ohio-state.edu>
> + * Web address: http://polybench.sourceforge.net
> + */
> +#include <stdio.h>
> +#include <unistd.h>
> +#include <string.h>
> +#include <math.h>
> +
> +/* Include polybench common header. */
> +#include <polybench.h>
> +
> +/* Include benchmark-specific header. */
> +/* Default data type is double, default size is 4000. */
> +#include "gemm.h"
> +
> +
> +/* Array initialization. */
> +static
> +void init_array(int ni, int nj, int nk,
> +		DATA_TYPE *alpha,
> +		DATA_TYPE *beta,
> +		DATA_TYPE POLYBENCH_2D(C,NI,NJ,ni,nj),
> +		DATA_TYPE POLYBENCH_2D(A,NI,NK,ni,nk),
> +		DATA_TYPE POLYBENCH_2D(B,NK,NJ,nk,nj))
> +{
> +  int i, j;
> +
> +  *alpha = 32412;
> +  *beta = 2123;
> +  for (i = 0; i < ni; i++)
> +    for (j = 0; j < nj; j++)
> +      C[i][j] = ((DATA_TYPE) i*j) / ni;
> +  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) / ni;
> +}
> +
> +
> +/* DCE code. Must scan the entire live-out data.
> +   Can be used also to check the correctness of the output. */
> +static
> +void print_array(int ni, int nj,
> +		 DATA_TYPE POLYBENCH_2D(C,NI,NJ,ni,nj))
> +{
> +  int i, j;
> +
> +  for (i = 0; i < ni; i++)
> +    for (j = 0; j < nj; j++) {
> +	fprintf (stderr, DATA_PRINTF_MODIFIER, C[i][j]);
> +	if ((i * ni + j) % 20 == 0) fprintf (stderr, "\n");
> +    }
> +  fprintf (stderr, "\n");
> +}
> +
> +
> +/* Main computational kernel. The whole function will be timed,
> +   including the call and return. */
> +static
> +void kernel_gemm(int ni, int nj, int nk,
> +		 DATA_TYPE alpha,
> +		 DATA_TYPE beta,
> +		 DATA_TYPE POLYBENCH_2D(C,NI,NJ,ni,nj),
> +		 DATA_TYPE POLYBENCH_2D(A,NI,NK,ni,nk),
> +		 DATA_TYPE POLYBENCH_2D(B,NK,NJ,nk,nj))
> +{
> +  int i, j, k;
> +
> +#pragma scop
> +  /* C := alpha*A*B + beta*C */
> +  for (i = 0; i < _PB_NI; i++)
> +    for (j = 0; j < _PB_NJ; j++)
> +      {
> +	C[i][j] *= beta;
> +	for (k = 0; k < _PB_NK; ++k)
> +	  C[i][j] += alpha * A[i][k] * B[k][j];
> +      }
> +#pragma endscop
> +
> +}
> +
> +
> +int main(int argc, char** argv)
> +{
> +  /* Retrieve problem size. */
> +  int ni = NI;
> +  int nj = NJ;
> +  int nk = NK;
> +
> +  /* Variable declaration/allocation. */
> +  DATA_TYPE alpha;
> +  DATA_TYPE beta;
> +  POLYBENCH_2D_ARRAY_DECL(C,DATA_TYPE,NI,NJ,ni,nj);
> +  POLYBENCH_2D_ARRAY_DECL(A,DATA_TYPE,NI,NK,ni,nk);
> +  POLYBENCH_2D_ARRAY_DECL(B,DATA_TYPE,NK,NJ,nk,nj);
> +
> +  /* Initialize array(s). */
> +  init_array (ni, nj, nk, &alpha, &beta,
> +	      POLYBENCH_ARRAY(C),
> +	      POLYBENCH_ARRAY(A),
> +	      POLYBENCH_ARRAY(B));
> +
> +  /* Start timer. */
> +  polybench_start_instruments;
> +
> +  /* Run kernel. */
> +  kernel_gemm (ni, nj, nk,
> +	       alpha, beta,
> +	       POLYBENCH_ARRAY(C),
> +	       POLYBENCH_ARRAY(A),
> +	       POLYBENCH_ARRAY(B));
> +
> +  /* Stop and print timer. */
> +  polybench_stop_instruments;
> +  polybench_print_instruments;
> +
> +  /* Prevent dead-code elimination. All live-out data must be printed
> +     by the function call in argument. */
> +  polybench_prevent_dce(print_array(ni, nj,  POLYBENCH_ARRAY(C)));
> +
> +  /* Be clean. */
> +  POLYBENCH_FREE_ARRAY(C);
> +  POLYBENCH_FREE_ARRAY(A);
> +  POLYBENCH_FREE_ARRAY(B);
> +
> +  return 0;
> +}
> 
> Propchange: test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/gemm/gemm.c
> ------------------------------------------------------------------------------
>    svn:executable = *
> 
> Added: test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/gemm/gemm.h
> URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/gemm/gemm.h?rev=159553&view=auto
> ==============================================================================
> --- test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/gemm/gemm.h (added)
> +++ test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/gemm/gemm.h Mon Jul  2 14:27:28 2012
> @@ -0,0 +1,60 @@
> +/**
> + * gemm.h: This file is part of the PolyBench/C 3.2 test suite.
> + *
> + *
> + * Contact: Louis-Noel Pouchet <pouchet at cse.ohio-state.edu>
> + * Web address: http://polybench.sourceforge.net
> + */
> +#ifndef GEMM_H
> +# define GEMM_H
> +
> +/* Default to STANDARD_DATASET. */
> +# if !defined(MINI_DATASET) && !defined(SMALL_DATASET) && !defined(LARGE_DATASET) && !defined(EXTRALARGE_DATASET)
> +#  define STANDARD_DATASET
> +# endif
> +
> +/* Do not define anything if the user manually defines the size. */
> +# if !defined(NI) && !defined(NJ) && !defined(NK)
> +/* Define the possible dataset sizes. */
> +#  ifdef MINI_DATASET
> +#   define NI 32
> +#   define NJ 32
> +#   define NK 32
> +#  endif
> +
> +#  ifdef SMALL_DATASET
> +#   define NI 128
> +#   define NJ 128
> +#   define NK 128
> +#  endif
> +
> +#  ifdef STANDARD_DATASET /* Default if unspecified. */
> +#   define NI 1024
> +#   define NJ 1024
> +#   define NK 1024
> +#  endif
> +
> +#  ifdef LARGE_DATASET
> +#   define NI 2000
> +#   define NJ 2000
> +#   define NK 2000
> +#  endif
> +
> +#  ifdef EXTRALARGE_DATASET
> +#   define NI 4000
> +#   define NJ 4000
> +#   define NK 4000
> +#  endif
> +# endif /* !N */
> +
> +# define _PB_NI POLYBENCH_LOOP_BOUND(NI,ni)
> +# define _PB_NJ POLYBENCH_LOOP_BOUND(NJ,nj)
> +# define _PB_NK POLYBENCH_LOOP_BOUND(NK,nk)
> +
> +# ifndef DATA_TYPE
> +#  define DATA_TYPE double
> +#  define DATA_PRINTF_MODIFIER "%0.2lf "
> +# endif
> +
> +
> +#endif /* !GEMM */
> 
> Propchange: test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/gemm/gemm.h
> ------------------------------------------------------------------------------
>    svn:executable = *
> 
> Added: test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/gemm/gemm.reference_output
> URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/gemm/gemm.reference_output?rev=159553&view=auto
> ==============================================================================
> --- test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/gemm/gemm.reference_output (added)
> +++ test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/gemm/gemm.reference_output Mon Jul  2 14:27:28 2012
> @@ -0,0 +1 @@
> +8e49771874c426a32c3cf2f1f3aa0385
> 
> Propchange: test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/gemm/gemm.reference_output
> ------------------------------------------------------------------------------
>    svn:executable = *
> 
> Added: test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/gemver/Makefile
> URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/gemver/Makefile?rev=159553&view=auto
> ==============================================================================
> --- test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/gemver/Makefile (added)
> +++ test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/gemver/Makefile Mon Jul  2 14:27:28 2012
> @@ -0,0 +1,10 @@
> +LEVEL = ../../../../../..
> +
> +POLYBENCH_UTILS = SingleSource/Benchmarks/Polybench/utilities 
> +PROG          = gemver
> +CFLAGS        += -I $(PROJ_SRC_ROOT)/$(POLYBENCH_UTILS) -DPOLYBENCH_DUMP_ARRAYS
> +
> +HASH_PROGRAM_OUTPUT = 1
> +
> +include $(LEVEL)/SingleSource/Makefile.singlesrc
> +
> 
> Propchange: test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/gemver/Makefile
> ------------------------------------------------------------------------------
>    svn:executable = *
> 
> Added: test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/gemver/gemver.c
> URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/gemver/gemver.c?rev=159553&view=auto
> ==============================================================================
> --- test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/gemver/gemver.c (added)
> +++ test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/gemver/gemver.c Mon Jul  2 14:27:28 2012
> @@ -0,0 +1,177 @@
> +/**
> + * gemver.c: This file is part of the PolyBench/C 3.2 test suite.
> + *
> + *
> + * Contact: Louis-Noel Pouchet <pouchet at cse.ohio-state.edu>
> + * Web address: http://polybench.sourceforge.net
> + */
> +#include <stdio.h>
> +#include <unistd.h>
> +#include <string.h>
> +#include <math.h>
> +
> +/* Include polybench common header. */
> +#include <polybench.h>
> +
> +/* Include benchmark-specific header. */
> +/* Default data type is double, default size is 4000. */
> +#include "gemver.h"
> +
> +
> +/* Array initialization. */
> +static
> +void init_array (int n,
> +		 DATA_TYPE *alpha,
> +		 DATA_TYPE *beta,
> +		 DATA_TYPE POLYBENCH_2D(A,N,N,n,n),
> +		 DATA_TYPE POLYBENCH_1D(u1,N,n),
> +		 DATA_TYPE POLYBENCH_1D(v1,N,n),
> +		 DATA_TYPE POLYBENCH_1D(u2,N,n),
> +		 DATA_TYPE POLYBENCH_1D(v2,N,n),
> +		 DATA_TYPE POLYBENCH_1D(w,N,n),
> +		 DATA_TYPE POLYBENCH_1D(x,N,n),
> +		 DATA_TYPE POLYBENCH_1D(y,N,n),
> +		 DATA_TYPE POLYBENCH_1D(z,N,n))
> +{
> +  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;
> +    }
> +}
> +
> +
> +/* DCE code. Must scan the entire live-out data.
> +   Can be used also to check the correctness of the output. */
> +static
> +void print_array(int n,
> +		 DATA_TYPE POLYBENCH_1D(w,N,n))
> +{
> +  int i;
> +
> +  for (i = 0; i < n; i++) {
> +    fprintf (stderr, DATA_PRINTF_MODIFIER, w[i]);
> +    if (i % 20 == 0) fprintf (stderr, "\n");
> +  }
> +}
> +
> +
> +/* Main computational kernel. The whole function will be timed,
> +   including the call and return. */
> +static
> +void kernel_gemver(int n,
> +		   DATA_TYPE alpha,
> +		   DATA_TYPE beta,
> +		   DATA_TYPE POLYBENCH_2D(A,N,N,n,n),
> +		   DATA_TYPE POLYBENCH_1D(u1,N,n),
> +		   DATA_TYPE POLYBENCH_1D(v1,N,n),
> +		   DATA_TYPE POLYBENCH_1D(u2,N,n),
> +		   DATA_TYPE POLYBENCH_1D(v2,N,n),
> +		   DATA_TYPE POLYBENCH_1D(w,N,n),
> +		   DATA_TYPE POLYBENCH_1D(x,N,n),
> +		   DATA_TYPE POLYBENCH_1D(y,N,n),
> +		   DATA_TYPE POLYBENCH_1D(z,N,n))
> +{
> +  int i, j;
> +
> +#pragma scop
> +
> +  for (i = 0; i < _PB_N; i++)
> +    for (j = 0; j < _PB_N; j++)
> +      A[i][j] = A[i][j] + u1[i] * v1[j] + u2[i] * v2[j];
> +
> +  for (i = 0; i < _PB_N; i++)
> +    for (j = 0; j < _PB_N; j++)
> +      x[i] = x[i] + beta * A[j][i] * y[j];
> +
> +  for (i = 0; i < _PB_N; i++)
> +    x[i] = x[i] + z[i];
> +
> +  for (i = 0; i < _PB_N; i++)
> +    for (j = 0; j < _PB_N; j++)
> +      w[i] = w[i] +  alpha * A[i][j] * x[j];
> +
> +#pragma endscop
> +}
> +
> +
> +int main(int argc, char** argv)
> +{
> +  /* Retrieve problem size. */
> +  int n = N;
> +
> +  /* Variable declaration/allocation. */
> +  DATA_TYPE alpha;
> +  DATA_TYPE beta;
> +  POLYBENCH_2D_ARRAY_DECL(A, DATA_TYPE, N, N, n, n);
> +  POLYBENCH_1D_ARRAY_DECL(u1, DATA_TYPE, N, n);
> +  POLYBENCH_1D_ARRAY_DECL(v1, DATA_TYPE, N, n);
> +  POLYBENCH_1D_ARRAY_DECL(u2, DATA_TYPE, N, n);
> +  POLYBENCH_1D_ARRAY_DECL(v2, DATA_TYPE, N, n);
> +  POLYBENCH_1D_ARRAY_DECL(w, DATA_TYPE, N, n);
> +  POLYBENCH_1D_ARRAY_DECL(x, DATA_TYPE, N, n);
> +  POLYBENCH_1D_ARRAY_DECL(y, DATA_TYPE, N, n);
> +  POLYBENCH_1D_ARRAY_DECL(z, DATA_TYPE, N, n);
> +
> +
> +  /* Initialize array(s). */
> +  init_array (n, &alpha, &beta,
> +	      POLYBENCH_ARRAY(A),
> +	      POLYBENCH_ARRAY(u1),
> +	      POLYBENCH_ARRAY(v1),
> +	      POLYBENCH_ARRAY(u2),
> +	      POLYBENCH_ARRAY(v2),
> +	      POLYBENCH_ARRAY(w),
> +	      POLYBENCH_ARRAY(x),
> +	      POLYBENCH_ARRAY(y),
> +	      POLYBENCH_ARRAY(z));
> +
> +  /* Start timer. */
> +  polybench_start_instruments;
> +
> +  /* Run kernel. */
> +  kernel_gemver (n, alpha, beta,
> +		 POLYBENCH_ARRAY(A),
> +		 POLYBENCH_ARRAY(u1),
> +		 POLYBENCH_ARRAY(v1),
> +		 POLYBENCH_ARRAY(u2),
> +		 POLYBENCH_ARRAY(v2),
> +		 POLYBENCH_ARRAY(w),
> +		 POLYBENCH_ARRAY(x),
> +		 POLYBENCH_ARRAY(y),
> +		 POLYBENCH_ARRAY(z));
> +
> +  /* Stop and print timer. */
> +  polybench_stop_instruments;
> +  polybench_print_instruments;
> +
> +  /* Prevent dead-code elimination. All live-out data must be printed
> +     by the function call in argument. */
> +  polybench_prevent_dce(print_array(n, POLYBENCH_ARRAY(w)));
> +
> +  /* Be clean. */
> +  POLYBENCH_FREE_ARRAY(A);
> +  POLYBENCH_FREE_ARRAY(u1);
> +  POLYBENCH_FREE_ARRAY(v1);
> +  POLYBENCH_FREE_ARRAY(u2);
> +  POLYBENCH_FREE_ARRAY(v2);
> +  POLYBENCH_FREE_ARRAY(w);
> +  POLYBENCH_FREE_ARRAY(x);
> +  POLYBENCH_FREE_ARRAY(y);
> +  POLYBENCH_FREE_ARRAY(z);
> +
> +  return 0;
> +}
> 
> Propchange: test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/gemver/gemver.c
> ------------------------------------------------------------------------------
>    svn:executable = *
> 
> Added: test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/gemver/gemver.h
> URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/gemver/gemver.h?rev=159553&view=auto
> ==============================================================================
> --- test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/gemver/gemver.h (added)
> +++ test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/gemver/gemver.h Mon Jul  2 14:27:28 2012
> @@ -0,0 +1,48 @@
> +/**
> + * gemver.h: This file is part of the PolyBench/C 3.2 test suite.
> + *
> + *
> + * Contact: Louis-Noel Pouchet <pouchet at cse.ohio-state.edu>
> + * Web address: http://polybench.sourceforge.net
> + */
> +#ifndef GEMVER_H
> +# define GEMVER_H
> +
> +/* Default to STANDARD_DATASET. */
> +# if !defined(MINI_DATASET) && !defined(SMALL_DATASET) && !defined(LARGE_DATASET) && !defined(EXTRALARGE_DATASET)
> +#  define STANDARD_DATASET
> +# endif
> +
> +/* Do not define anything if the user manually defines the size. */
> +# ifndef N
> +/* Define the possible dataset sizes. */
> +#  ifdef MINI_DATASET
> +#   define N 32
> +#  endif
> +
> +#  ifdef SMALL_DATASET
> +#   define N 500
> +#  endif
> +
> +#  ifdef STANDARD_DATASET /* Default if unspecified. */
> +#   define N 4000
> +#  endif
> +
> +#  ifdef LARGE_DATASET
> +#   define N 8000
> +#  endif
> +
> +#  ifdef EXTRALARGE_DATASET
> +#   define N 100000
> +#  endif
> +# endif /* !N */
> +
> +# define _PB_N POLYBENCH_LOOP_BOUND(N,n)
> +
> +# ifndef DATA_TYPE
> +#  define DATA_TYPE double
> +#  define DATA_PRINTF_MODIFIER "%0.2lf "
> +# endif
> +
> +
> +#endif /* !GEMVER */
> 
> Propchange: test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/gemver/gemver.h
> ------------------------------------------------------------------------------
>    svn:executable = *
> 
> Added: test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/gemver/gemver.reference_output
> URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/gemver/gemver.reference_output?rev=159553&view=auto
> ==============================================================================
> --- test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/gemver/gemver.reference_output (added)
> +++ test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/gemver/gemver.reference_output Mon Jul  2 14:27:28 2012
> @@ -0,0 +1 @@
> +ac3ff05caf9d54194c1534186f5807f7
> 
> Propchange: test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/gemver/gemver.reference_output
> ------------------------------------------------------------------------------
>    svn:executable = *
> 
> Added: test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/gesummv/Makefile
> URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/gesummv/Makefile?rev=159553&view=auto
> ==============================================================================
> --- test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/gesummv/Makefile (added)
> +++ test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/gesummv/Makefile Mon Jul  2 14:27:28 2012
> @@ -0,0 +1,10 @@
> +LEVEL = ../../../../../..
> +
> +POLYBENCH_UTILS = SingleSource/Benchmarks/Polybench/utilities 
> +PROG          = gesummv
> +CFLAGS        += -I $(PROJ_SRC_ROOT)/$(POLYBENCH_UTILS) -DPOLYBENCH_DUMP_ARRAYS
> +
> +HASH_PROGRAM_OUTPUT = 1
> +
> +include $(LEVEL)/SingleSource/Makefile.singlesrc
> +
> 
> Propchange: test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/gesummv/Makefile
> ------------------------------------------------------------------------------
>    svn:executable = *
> 
> Added: test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/gesummv/gesummv.c
> URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/gesummv/gesummv.c?rev=159553&view=auto
> ==============================================================================
> --- test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/gesummv/gesummv.c (added)
> +++ test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/gesummv/gesummv.c Mon Jul  2 14:27:28 2012
> @@ -0,0 +1,140 @@
> +/**
> + * gesummv.c: This file is part of the PolyBench/C 3.2 test suite.
> + *
> + *
> + * Contact: Louis-Noel Pouchet <pouchet at cse.ohio-state.edu>
> + * Web address: http://polybench.sourceforge.net
> + */
> +#include <stdio.h>
> +#include <unistd.h>
> +#include <string.h>
> +#include <math.h>
> +
> +/* Include polybench common header. */
> +#include <polybench.h>
> +
> +/* Include benchmark-specific header. */
> +/* Default data type is double, default size is 4000. */
> +#include "gesummv.h"
> +
> +
> +/* Array initialization. */
> +static
> +void init_array(int n,
> +		DATA_TYPE *alpha,
> +		DATA_TYPE *beta,
> +		DATA_TYPE POLYBENCH_2D(A,N,N,n,n),
> +		DATA_TYPE POLYBENCH_2D(B,N,N,n,n),
> +		DATA_TYPE POLYBENCH_1D(x,N,n))
> +{
> +  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;
> +	B[i][j] = ((DATA_TYPE) i*j) / n;
> +      }
> +    }
> +}
> +
> +
> +/* DCE code. Must scan the entire live-out data.
> +   Can be used also to check the correctness of the output. */
> +static
> +void print_array(int n,
> +		 DATA_TYPE POLYBENCH_1D(y,N,n))
> +
> +{
> +  int i;
> +
> +  for (i = 0; i < n; i++) {
> +    fprintf (stderr, DATA_PRINTF_MODIFIER, y[i]);
> +    if (i % 20 == 0) fprintf (stderr, "\n");
> +  }
> +}
> +
> +
> +/* Main computational kernel. The whole function will be timed,
> +   including the call and return. */
> +static
> +void kernel_gesummv(int n,
> +		    DATA_TYPE alpha,
> +		    DATA_TYPE beta,
> +		    DATA_TYPE POLYBENCH_2D(A,N,N,n,n),
> +		    DATA_TYPE POLYBENCH_2D(B,N,N,n,n),
> +		    DATA_TYPE POLYBENCH_1D(tmp,N,n),
> +		    DATA_TYPE POLYBENCH_1D(x,N,n),
> +		    DATA_TYPE POLYBENCH_1D(y,N,n))
> +{
> +  int i, j;
> +
> +#pragma scop
> +  for (i = 0; i < _PB_N; i++)
> +    {
> +      tmp[i] = 0;
> +      y[i] = 0;
> +      for (j = 0; j < _PB_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)
> +{
> +  /* Retrieve problem size. */
> +  int n = N;
> +
> +  /* Variable declaration/allocation. */
> +  DATA_TYPE alpha;
> +  DATA_TYPE beta;
> +  POLYBENCH_2D_ARRAY_DECL(A, DATA_TYPE, N, N, n, n);
> +  POLYBENCH_2D_ARRAY_DECL(B, DATA_TYPE, N, N, n, n);
> +  POLYBENCH_1D_ARRAY_DECL(tmp, DATA_TYPE, N, n);
> +  POLYBENCH_1D_ARRAY_DECL(x, DATA_TYPE, N, n);
> +  POLYBENCH_1D_ARRAY_DECL(y, DATA_TYPE, N, n);
> +
> +
> +  /* Initialize array(s). */
> +  init_array (n, &alpha, &beta,
> +	      POLYBENCH_ARRAY(A),
> +	      POLYBENCH_ARRAY(B),
> +	      POLYBENCH_ARRAY(x));
> +
> +  /* Start timer. */
> +  polybench_start_instruments;
> +
> +  /* Run kernel. */
> +  kernel_gesummv (n, alpha, beta,
> +		  POLYBENCH_ARRAY(A),
> +		  POLYBENCH_ARRAY(B),
> +		  POLYBENCH_ARRAY(tmp),
> +		  POLYBENCH_ARRAY(x),
> +		  POLYBENCH_ARRAY(y));
> +
> +  /* Stop and print timer. */
> +  polybench_stop_instruments;
> +  polybench_print_instruments;
> +
> +  /* Prevent dead-code elimination. All live-out data must be printed
> +     by the function call in argument. */
> +  polybench_prevent_dce(print_array(n, POLYBENCH_ARRAY(y)));
> +
> +  /* Be clean. */
> +  POLYBENCH_FREE_ARRAY(A);
> +  POLYBENCH_FREE_ARRAY(B);
> +  POLYBENCH_FREE_ARRAY(tmp);
> +  POLYBENCH_FREE_ARRAY(x);
> +  POLYBENCH_FREE_ARRAY(y);
> +
> +  return 0;
> +}
> 
> Propchange: test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/gesummv/gesummv.c
> ------------------------------------------------------------------------------
>    svn:executable = *
> 
> Added: test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/gesummv/gesummv.h
> URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/gesummv/gesummv.h?rev=159553&view=auto
> ==============================================================================
> --- test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/gesummv/gesummv.h (added)
> +++ test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/gesummv/gesummv.h Mon Jul  2 14:27:28 2012
> @@ -0,0 +1,48 @@
> +/**
> + * gesummv.h: This file is part of the PolyBench/C 3.2 test suite.
> + *
> + *
> + * Contact: Louis-Noel Pouchet <pouchet at cse.ohio-state.edu>
> + * Web address: http://polybench.sourceforge.net
> + */
> +#ifndef GESUMMV_H
> +# define GESUMMV_H
> +
> +/* Default to STANDARD_DATASET. */
> +# if !defined(MINI_DATASET) && !defined(SMALL_DATASET) && !defined(LARGE_DATASET) && !defined(EXTRALARGE_DATASET)
> +#  define STANDARD_DATASET
> +# endif
> +
> +/* Do not define anything if the user manually defines the size. */
> +# ifndef N
> +/* Define the possible dataset sizes. */
> +#  ifdef MINI_DATASET
> +#   define N 32
> +#  endif
> +
> +#  ifdef SMALL_DATASET
> +#   define N 500
> +#  endif
> +
> +#  ifdef STANDARD_DATASET /* Default if unspecified. */
> +#   define N 4000
> +#  endif
> +
> +#  ifdef LARGE_DATASET
> +#   define N 8000
> +#  endif
> +
> +#  ifdef EXTRALARGE_DATASET
> +#   define N 100000
> +#  endif
> +# endif /* !N */
> +
> +# define _PB_N POLYBENCH_LOOP_BOUND(N,n)
> +
> +# ifndef DATA_TYPE
> +#  define DATA_TYPE double
> +#  define DATA_PRINTF_MODIFIER "%0.2lf "
> +# endif
> +
> +
> +#endif /* !GESUMMV */
> 
> Propchange: test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/gesummv/gesummv.h
> ------------------------------------------------------------------------------
>    svn:executable = *
> 
> Added: test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/gesummv/gesummv.reference_output
> URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/gesummv/gesummv.reference_output?rev=159553&view=auto
> ==============================================================================
> --- test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/gesummv/gesummv.reference_output (added)
> +++ test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/gesummv/gesummv.reference_output Mon Jul  2 14:27:28 2012
> @@ -0,0 +1 @@
> +8cafbcc8e2ea63cccdf5de115af25744
> 
> Propchange: test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/gesummv/gesummv.reference_output
> ------------------------------------------------------------------------------
>    svn:executable = *
> 
> Added: test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/mvt/Makefile
> URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/mvt/Makefile?rev=159553&view=auto
> ==============================================================================
> --- test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/mvt/Makefile (added)
> +++ test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/mvt/Makefile Mon Jul  2 14:27:28 2012
> @@ -0,0 +1,10 @@
> +LEVEL = ../../../../../..
> +
> +POLYBENCH_UTILS = SingleSource/Benchmarks/Polybench/utilities 
> +PROG          = mvt
> +CFLAGS        += -I $(PROJ_SRC_ROOT)/$(POLYBENCH_UTILS) -DPOLYBENCH_DUMP_ARRAYS
> +
> +HASH_PROGRAM_OUTPUT = 1
> +
> +include $(LEVEL)/SingleSource/Makefile.singlesrc
> +
> 
> Propchange: test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/mvt/Makefile
> ------------------------------------------------------------------------------
>    svn:executable = *
> 
> Added: test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/mvt/mvt.c
> URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/mvt/mvt.c?rev=159553&view=auto
> ==============================================================================
> --- test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/mvt/mvt.c (added)
> +++ test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/mvt/mvt.c Mon Jul  2 14:27:28 2012
> @@ -0,0 +1,134 @@
> +/**
> + * mvt.c: This file is part of the PolyBench/C 3.2 test suite.
> + *
> + *
> + * Contact: Louis-Noel Pouchet <pouchet at cse.ohio-state.edu>
> + * Web address: http://polybench.sourceforge.net
> + */
> +#include <stdio.h>
> +#include <unistd.h>
> +#include <string.h>
> +#include <math.h>
> +
> +/* Include polybench common header. */
> +#include <polybench.h>
> +
> +/* Include benchmark-specific header. */
> +/* Default data type is double, default size is 4000. */
> +#include "mvt.h"
> +
> +
> +/* Array initialization. */
> +static
> +void init_array(int n,
> +		DATA_TYPE POLYBENCH_1D(x1,N,n),
> +		DATA_TYPE POLYBENCH_1D(x2,N,n),
> +		DATA_TYPE POLYBENCH_1D(y_1,N,n),
> +		DATA_TYPE POLYBENCH_1D(y_2,N,n),
> +		DATA_TYPE POLYBENCH_2D(A,N,N,n,n))
> +{
> +  int i, j;
> +
> +  for (i = 0; i < n; i++)
> +    {
> +      x1[i] = ((DATA_TYPE) i) / n;
> +      x2[i] = ((DATA_TYPE) i + 1) / n;
> +      y_1[i] = ((DATA_TYPE) i + 3) / n;
> +      y_2[i] = ((DATA_TYPE) i + 4) / n;
> +      for (j = 0; j < n; j++)
> +	A[i][j] = ((DATA_TYPE) i*j) / N;
> +    }
> +}
> +
> +
> +/* DCE code. Must scan the entire live-out data.
> +   Can be used also to check the correctness of the output. */
> +static
> +void print_array(int n,
> +		 DATA_TYPE POLYBENCH_1D(x1,N,n),
> +		 DATA_TYPE POLYBENCH_1D(x2,N,n))
> +
> +{
> +  int i;
> +
> +  for (i = 0; i < n; i++) {
> +    fprintf (stderr, DATA_PRINTF_MODIFIER, x1[i]);
> +    fprintf (stderr, DATA_PRINTF_MODIFIER, x2[i]);
> +    if (i % 20 == 0) fprintf (stderr, "\n");
> +  }
> +}
> +
> +
> +/* Main computational kernel. The whole function will be timed,
> +   including the call and return. */
> +static
> +void kernel_mvt(int n,
> +		DATA_TYPE POLYBENCH_1D(x1,N,n),
> +		DATA_TYPE POLYBENCH_1D(x2,N,n),
> +		DATA_TYPE POLYBENCH_1D(y_1,N,n),
> +		DATA_TYPE POLYBENCH_1D(y_2,N,n),
> +		DATA_TYPE POLYBENCH_2D(A,N,N,n,n))
> +{
> +  int i, j;
> +
> +#pragma scop
> +  for (i = 0; i < _PB_N; i++)
> +    for (j = 0; j < _PB_N; j++)
> +      x1[i] = x1[i] + A[i][j] * y_1[j];
> +  for (i = 0; i < _PB_N; i++)
> +    for (j = 0; j < _PB_N; j++)
> +      x2[i] = x2[i] + A[j][i] * y_2[j];
> +#pragma endscop
> +
> +}
> +
> +
> +int main(int argc, char** argv)
> +{
> +  /* Retrieve problem size. */
> +  int n = N;
> +
> +  /* Variable declaration/allocation. */
> +  POLYBENCH_2D_ARRAY_DECL(A, DATA_TYPE, N, N, n, n);
> +  POLYBENCH_1D_ARRAY_DECL(x1, DATA_TYPE, N, n);
> +  POLYBENCH_1D_ARRAY_DECL(x2, DATA_TYPE, N, n);
> +  POLYBENCH_1D_ARRAY_DECL(y_1, DATA_TYPE, N, n);
> +  POLYBENCH_1D_ARRAY_DECL(y_2, DATA_TYPE, N, n);
> +
> +
> +  /* Initialize array(s). */
> +  init_array (n,
> +	      POLYBENCH_ARRAY(x1),
> +	      POLYBENCH_ARRAY(x2),
> +	      POLYBENCH_ARRAY(y_1),
> +	      POLYBENCH_ARRAY(y_2),
> +	      POLYBENCH_ARRAY(A));
> +
> +  /* Start timer. */
> +  polybench_start_instruments;
> +
> +  /* Run kernel. */
> +  kernel_mvt (n,
> +	      POLYBENCH_ARRAY(x1),
> +	      POLYBENCH_ARRAY(x2),
> +	      POLYBENCH_ARRAY(y_1),
> +	      POLYBENCH_ARRAY(y_2),
> +	      POLYBENCH_ARRAY(A));
> +
> +  /* Stop and print timer. */
> +  polybench_stop_instruments;
> +  polybench_print_instruments;
> +
> +  /* Prevent dead-code elimination. All live-out data must be printed
> +     by the function call in argument. */
> +  polybench_prevent_dce(print_array(n, POLYBENCH_ARRAY(x1), POLYBENCH_ARRAY(x2)));
> +
> +  /* Be clean. */
> +  POLYBENCH_FREE_ARRAY(A);
> +  POLYBENCH_FREE_ARRAY(x1);
> +  POLYBENCH_FREE_ARRAY(x2);
> +  POLYBENCH_FREE_ARRAY(y_1);
> +  POLYBENCH_FREE_ARRAY(y_2);
> +
> +  return 0;
> +}
> 
> Propchange: test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/mvt/mvt.c
> ------------------------------------------------------------------------------
>    svn:executable = *
> 
> Added: test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/mvt/mvt.h
> URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/mvt/mvt.h?rev=159553&view=auto
> ==============================================================================
> --- test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/mvt/mvt.h (added)
> +++ test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/mvt/mvt.h Mon Jul  2 14:27:28 2012
> @@ -0,0 +1,48 @@
> +/**
> + * mvt.h: This file is part of the PolyBench/C 3.2 test suite.
> + *
> + *
> + * Contact: Louis-Noel Pouchet <pouchet at cse.ohio-state.edu>
> + * Web address: http://polybench.sourceforge.net
> + */
> +#ifndef MVT_H
> +# define MVT_H
> +
> +/* Default to STANDARD_DATASET. */
> +# if !defined(MINI_DATASET) && !defined(SMALL_DATASET) && !defined(LARGE_DATASET) && !defined(EXTRALARGE_DATASET)
> +#  define STANDARD_DATASET
> +# endif
> +
> +/* Do not define anything if the user manually defines the size. */
> +# ifndef N
> +/* Define the possible dataset sizes. */
> +#  ifdef MINI_DATASET
> +#   define N 32
> +#  endif
> +
> +#  ifdef SMALL_DATASET
> +#   define N 500
> +#  endif
> +
> +#  ifdef STANDARD_DATASET /* Default if unspecified. */
> +#   define N 4000
> +#  endif
> +
> +#  ifdef LARGE_DATASET
> +#   define N 8000
> +#  endif
> +
> +#  ifdef EXTRALARGE_DATASET
> +#   define N 100000
> +#  endif
> +# endif /* !N */
> +
> +# define _PB_N POLYBENCH_LOOP_BOUND(N,n)
> +
> +# ifndef DATA_TYPE
> +#  define DATA_TYPE double
> +#  define DATA_PRINTF_MODIFIER "%0.2lf "
> +# endif
> +
> +
> +#endif /* !MVT */
> 
> Propchange: test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/mvt/mvt.h
> ------------------------------------------------------------------------------
>    svn:executable = *
> 
> Added: test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/mvt/mvt.reference_output
> URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/mvt/mvt.reference_output?rev=159553&view=auto
> ==============================================================================
> --- test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/mvt/mvt.reference_output (added)
> +++ test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/mvt/mvt.reference_output Mon Jul  2 14:27:28 2012
> @@ -0,0 +1 @@
> +6b091f2008985d45dbdcf6c382fbd7b8
> 
> Propchange: test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/mvt/mvt.reference_output
> ------------------------------------------------------------------------------
>    svn:executable = *
> 
> Added: test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/symm/Makefile
> URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/symm/Makefile?rev=159553&view=auto
> ==============================================================================
> --- test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/symm/Makefile (added)
> +++ test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/symm/Makefile Mon Jul  2 14:27:28 2012
> @@ -0,0 +1,10 @@
> +LEVEL = ../../../../../..
> +
> +POLYBENCH_UTILS = SingleSource/Benchmarks/Polybench/utilities 
> +PROG          = symm
> +CFLAGS        += -I $(PROJ_SRC_ROOT)/$(POLYBENCH_UTILS) -DPOLYBENCH_DUMP_ARRAYS
> +
> +HASH_PROGRAM_OUTPUT = 1
> +
> +include $(LEVEL)/SingleSource/Makefile.singlesrc
> +
> 
> Propchange: test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/symm/Makefile
> ------------------------------------------------------------------------------
>    svn:executable = *
> 
> Added: test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/symm/symm.c
> URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/symm/symm.c?rev=159553&view=auto
> ==============================================================================
> --- test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/symm/symm.c (added)
> +++ test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/symm/symm.c Mon Jul  2 14:27:28 2012
> @@ -0,0 +1,136 @@
> +/**
> + * symm.c: This file is part of the PolyBench/C 3.2 test suite.
> + *
> + *
> + * Contact: Louis-Noel Pouchet <pouchet at cse.ohio-state.edu>
> + * Web address: http://polybench.sourceforge.net
> + */
> +#include <stdio.h>
> +#include <unistd.h>
> +#include <string.h>
> +#include <math.h>
> +
> +/* Include polybench common header. */
> +#include <polybench.h>
> +
> +/* Include benchmark-specific header. */
> +/* Default data type is double, default size is 4000. */
> +#include "symm.h"
> +
> +
> +/* Array initialization. */
> +static
> +void init_array(int ni, int nj,
> +		DATA_TYPE *alpha,
> +		DATA_TYPE *beta,
> +		DATA_TYPE POLYBENCH_2D(C,NI,NJ,ni,nj),
> +		DATA_TYPE POLYBENCH_2D(A,NJ,NJ,nj,nj),
> +		DATA_TYPE POLYBENCH_2D(B,NI,NJ,ni,nj))
> +{
> +  int i, j;
> +
> +  *alpha = 32412;
> +  *beta = 2123;
> +  for (i = 0; i < ni; i++)
> +    for (j = 0; j < nj; j++) {
> +      C[i][j] = ((DATA_TYPE) i*j) / ni;
> +      B[i][j] = ((DATA_TYPE) i*j) / ni;
> +    }
> +  for (i = 0; i < nj; i++)
> +    for (j = 0; j < nj; j++)
> +      A[i][j] = ((DATA_TYPE) i*j) / ni;
> +}
> +
> +
> +/* DCE code. Must scan the entire live-out data.
> +   Can be used also to check the correctness of the output. */
> +static
> +void print_array(int ni, int nj,
> +		 DATA_TYPE POLYBENCH_2D(C,NI,NJ,ni,nj))
> +{
> +  int i, j;
> +
> +  for (i = 0; i < ni; i++)
> +    for (j = 0; j < nj; j++) {
> +	fprintf (stderr, DATA_PRINTF_MODIFIER, C[i][j]);
> +	if ((i * ni + j) % 20 == 0) fprintf (stderr, "\n");
> +    }
> +  fprintf (stderr, "\n");
> +}
> +
> +
> +/* Main computational kernel. The whole function will be timed,
> +   including the call and return. */
> +static
> +void kernel_symm(int ni, int nj,
> +		 DATA_TYPE alpha,
> +		 DATA_TYPE beta,
> +		 DATA_TYPE POLYBENCH_2D(C,NI,NJ,ni,nj),
> +		 DATA_TYPE POLYBENCH_2D(A,NJ,NJ,nj,nj),
> +		 DATA_TYPE POLYBENCH_2D(B,NI,NJ,ni,nj))
> +{
> +  int i, j, k;
> +  DATA_TYPE acc;
> +
> +#pragma scop
> +  /*  C := alpha*A*B + beta*C, A is symetric */
> +  for (i = 0; i < _PB_NI; i++)
> +    for (j = 0; j < _PB_NJ; j++)
> +      {
> +	acc = 0;
> +	for (k = 0; k < j - 1; k++)
> +	  {
> +	    C[k][j] += alpha * A[k][i] * B[i][j];
> +	    acc += B[k][j] * A[k][i];
> +	  }
> +	C[i][j] = beta * C[i][j] + alpha * A[i][i] * B[i][j] + alpha * acc;
> +      }
> +#pragma endscop
> +
> +}
> +
> +
> +int main(int argc, char** argv)
> +{
> +  /* Retrieve problem size. */
> +  int ni = NI;
> +  int nj = NJ;
> +
> +  /* Variable declaration/allocation. */
> +  DATA_TYPE alpha;
> +  DATA_TYPE beta;
> +  POLYBENCH_2D_ARRAY_DECL(C,DATA_TYPE,NI,NJ,ni,nj);
> +  POLYBENCH_2D_ARRAY_DECL(A,DATA_TYPE,NJ,NJ,nj,nj);
> +  POLYBENCH_2D_ARRAY_DECL(B,DATA_TYPE,NI,NJ,ni,nj);
> +
> +  /* Initialize array(s). */
> +  init_array (ni, nj, &alpha, &beta,
> +	      POLYBENCH_ARRAY(C),
> +	      POLYBENCH_ARRAY(A),
> +	      POLYBENCH_ARRAY(B));
> +
> +  /* Start timer. */
> +  polybench_start_instruments;
> +
> +  /* Run kernel. */
> +  kernel_symm (ni, nj,
> +	       alpha, beta,
> +	       POLYBENCH_ARRAY(C),
> +	       POLYBENCH_ARRAY(A),
> +	       POLYBENCH_ARRAY(B));
> +
> +  /* Stop and print timer. */
> +  polybench_stop_instruments;
> +  polybench_print_instruments;
> +
> +  /* Prevent dead-code elimination. All live-out data must be printed
> +     by the function call in argument. */
> +  polybench_prevent_dce(print_array(ni, nj,  POLYBENCH_ARRAY(C)));
> +
> +  /* Be clean. */
> +  POLYBENCH_FREE_ARRAY(C);
> +  POLYBENCH_FREE_ARRAY(A);
> +  POLYBENCH_FREE_ARRAY(B);
> +
> +  return 0;
> +}
> 
> Propchange: test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/symm/symm.c
> ------------------------------------------------------------------------------
>    svn:executable = *
> 
> Added: test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/symm/symm.h
> URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/symm/symm.h?rev=159553&view=auto
> ==============================================================================
> --- test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/symm/symm.h (added)
> +++ test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/symm/symm.h Mon Jul  2 14:27:28 2012
> @@ -0,0 +1,54 @@
> +/**
> + * symm.h: This file is part of the PolyBench/C 3.2 test suite.
> + *
> + *
> + * Contact: Louis-Noel Pouchet <pouchet at cse.ohio-state.edu>
> + * Web address: http://polybench.sourceforge.net
> + */
> +#ifndef SYMM_H
> +# define SYMM_H
> +
> +/* Default to STANDARD_DATASET. */
> +# if !defined(MINI_DATASET) && !defined(SMALL_DATASET) && !defined(LARGE_DATASET) && !defined(EXTRALARGE_DATASET)
> +#  define STANDARD_DATASET
> +# endif
> +
> +/* Do not define anything if the user manually defines the size. */
> +# if !defined(NI) && !defined(NJ)
> +/* Define the possible dataset sizes. */
> +#  ifdef MINI_DATASET
> +#   define NI 32
> +#   define NJ 32
> +#  endif
> +
> +#  ifdef SMALL_DATASET
> +#   define NI 128
> +#   define NJ 128
> +#  endif
> +
> +#  ifdef STANDARD_DATASET /* Default if unspecified. */
> +#   define NI 1024
> +#   define NJ 1024
> +#  endif
> +
> +#  ifdef LARGE_DATASET
> +#   define NI 2000
> +#   define NJ 2000
> +#  endif
> +
> +#  ifdef EXTRALARGE_DATASET
> +#   define NI 4000
> +#   define NJ 4000
> +#  endif
> +# endif /* !N */
> +
> +# define _PB_NI POLYBENCH_LOOP_BOUND(NI,ni)
> +# define _PB_NJ POLYBENCH_LOOP_BOUND(NJ,nj)
> +
> +# ifndef DATA_TYPE
> +#  define DATA_TYPE double
> +#  define DATA_PRINTF_MODIFIER "%0.2lf "
> +# endif
> +
> +
> +#endif /* !SYMM */
> 
> Propchange: test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/symm/symm.h
> ------------------------------------------------------------------------------
>    svn:executable = *
> 
> Added: test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/symm/symm.reference_output
> URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/symm/symm.reference_output?rev=159553&view=auto
> ==============================================================================
> --- test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/symm/symm.reference_output (added)
> +++ test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/symm/symm.reference_output Mon Jul  2 14:27:28 2012
> @@ -0,0 +1 @@
> +a3ec0a2360baf0348b8ee4ba64fbf096
> 
> Propchange: test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/symm/symm.reference_output
> ------------------------------------------------------------------------------
>    svn:executable = *
> 
> Added: test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/syr2k/Makefile
> URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/syr2k/Makefile?rev=159553&view=auto
> ==============================================================================
> --- test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/syr2k/Makefile (added)
> +++ test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/syr2k/Makefile Mon Jul  2 14:27:28 2012
> @@ -0,0 +1,10 @@
> +LEVEL = ../../../../../..
> +
> +POLYBENCH_UTILS = SingleSource/Benchmarks/Polybench/utilities 
> +PROG          = syr2k
> +CFLAGS        += -I $(PROJ_SRC_ROOT)/$(POLYBENCH_UTILS) -DPOLYBENCH_DUMP_ARRAYS
> +
> +HASH_PROGRAM_OUTPUT = 1
> +
> +include $(LEVEL)/SingleSource/Makefile.singlesrc
> +
> 
> Propchange: test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/syr2k/Makefile
> ------------------------------------------------------------------------------
>    svn:executable = *
> 
> Added: test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/syr2k/syr2k.c
> URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/syr2k/syr2k.c?rev=159553&view=auto
> ==============================================================================
> --- test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/syr2k/syr2k.c (added)
> +++ test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/syr2k/syr2k.c Mon Jul  2 14:27:28 2012
> @@ -0,0 +1,134 @@
> +/**
> + * syr2k.c: This file is part of the PolyBench/C 3.2 test suite.
> + *
> + *
> + * Contact: Louis-Noel Pouchet <pouchet at cse.ohio-state.edu>
> + * Web address: http://polybench.sourceforge.net
> + */
> +#include <stdio.h>
> +#include <unistd.h>
> +#include <string.h>
> +#include <math.h>
> +
> +/* Include polybench common header. */
> +#include <polybench.h>
> +
> +/* Include benchmark-specific header. */
> +/* Default data type is double, default size is 4000. */
> +#include "syr2k.h"
> +
> +
> +/* Array initialization. */
> +static
> +void init_array(int ni, int nj,
> +		DATA_TYPE *alpha,
> +		DATA_TYPE *beta,
> +		DATA_TYPE POLYBENCH_2D(C,NI,NI,ni,ni),
> +		DATA_TYPE POLYBENCH_2D(A,NI,NJ,ni,nj),
> +		DATA_TYPE POLYBENCH_2D(B,NI,NJ,ni,nj))
> +{
> +  int i, j;
> +
> +  *alpha = 32412;
> +  *beta = 2123;
> +  for (i = 0; i < ni; i++)
> +    for (j = 0; j < nj; j++) {
> +      A[i][j] = ((DATA_TYPE) i*j) / ni;
> +      B[i][j] = ((DATA_TYPE) i*j) / ni;
> +    }
> +  for (i = 0; i < ni; i++)
> +    for (j = 0; j < ni; j++)
> +      C[i][j] = ((DATA_TYPE) i*j) / ni;
> +}
> +
> +
> +/* DCE code. Must scan the entire live-out data.
> +   Can be used also to check the correctness of the output. */
> +static
> +void print_array(int ni,
> +		 DATA_TYPE POLYBENCH_2D(C,NI,NI,ni,ni))
> +{
> +  int i, j;
> +
> +  for (i = 0; i < ni; i++)
> +    for (j = 0; j < ni; j++) {
> +	fprintf (stderr, DATA_PRINTF_MODIFIER, C[i][j]);
> +	if ((i * ni + j) % 20 == 0) fprintf (stderr, "\n");
> +    }
> +  fprintf (stderr, "\n");
> +}
> +
> +
> +/* Main computational kernel. The whole function will be timed,
> +   including the call and return. */
> +static
> +void kernel_syr2k(int ni, int nj,
> +		  DATA_TYPE alpha,
> +		  DATA_TYPE beta,
> +		  DATA_TYPE POLYBENCH_2D(C,NI,NI,ni,ni),
> +		  DATA_TYPE POLYBENCH_2D(A,NI,NJ,ni,nj),
> +		  DATA_TYPE POLYBENCH_2D(B,NI,NJ,ni,nj))
> +{
> +  int i, j, k;
> +
> +#pragma scop
> +  /*    C := alpha*A*B' + alpha*B*A' + beta*C */
> +  for (i = 0; i < _PB_NI; i++)
> +    for (j = 0; j < _PB_NI; j++)
> +      C[i][j] *= beta;
> +  for (i = 0; i < _PB_NI; i++)
> +    for (j = 0; j < _PB_NI; j++)
> +      for (k = 0; k < _PB_NJ; k++)
> +	{
> +	  C[i][j] += alpha * A[i][k] * B[j][k];
> +	  C[i][j] += alpha * B[i][k] * A[j][k];
> +	}
> +#pragma endscop
> +
> +}
> +
> +
> +int main(int argc, char** argv)
> +{
> +  /* Retrieve problem size. */
> +  int ni = NI;
> +  int nj = NJ;
> +
> +  /* Variable declaration/allocation. */
> +  DATA_TYPE alpha;
> +  DATA_TYPE beta;
> +  POLYBENCH_2D_ARRAY_DECL(C,DATA_TYPE,NI,NI,ni,ni);
> +  POLYBENCH_2D_ARRAY_DECL(A,DATA_TYPE,NI,NJ,ni,nj);
> +  POLYBENCH_2D_ARRAY_DECL(B,DATA_TYPE,NI,NJ,ni,nj);
> +
> +  /* Initialize array(s). */
> +  init_array (ni, nj, &alpha, &beta,
> +	      POLYBENCH_ARRAY(C),
> +	      POLYBENCH_ARRAY(A),
> +	      POLYBENCH_ARRAY(B));
> +
> +  /* Start timer. */
> +  polybench_start_instruments;
> +
> +  /* Run kernel. */
> +  kernel_syr2k (ni, nj,
> +		alpha, beta,
> +		POLYBENCH_ARRAY(C),
> +		POLYBENCH_ARRAY(A),
> +		POLYBENCH_ARRAY(B));
> +
> +  /* Stop and print timer. */
> +  polybench_stop_instruments;
> +  polybench_print_instruments;
> +
> +  /* Prevent dead-code elimination. All live-out data must be printed
> +     by the function call in argument. */
> +  polybench_prevent_dce(print_array(ni, POLYBENCH_ARRAY(C)));
> +
> +  /* Be clean. */
> +  POLYBENCH_FREE_ARRAY(C);
> +  POLYBENCH_FREE_ARRAY(A);
> +  POLYBENCH_FREE_ARRAY(B);
> +
> +  return 0;
> +}
> 
> Propchange: test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/syr2k/syr2k.c
> ------------------------------------------------------------------------------
>    svn:executable = *
> 
> Added: test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/syr2k/syr2k.h
> URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/syr2k/syr2k.h?rev=159553&view=auto
> ==============================================================================
> --- test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/syr2k/syr2k.h (added)
> +++ test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/syr2k/syr2k.h Mon Jul  2 14:27:28 2012
> @@ -0,0 +1,54 @@
> +/**
> + * syr2k.h: This file is part of the PolyBench/C 3.2 test suite.
> + *
> + *
> + * Contact: Louis-Noel Pouchet <pouchet at cse.ohio-state.edu>
> + * Web address: http://polybench.sourceforge.net
> + */
> +#ifndef SYR2K_H
> +# define SYR2K_H
> +
> +/* Default to STANDARD_DATASET. */
> +# if !defined(MINI_DATASET) && !defined(SMALL_DATASET) && !defined(LARGE_DATASET) && !defined(EXTRALARGE_DATASET)
> +#  define STANDARD_DATASET
> +# endif
> +
> +/* Do not define anything if the user manually defines the size. */
> +# if !defined(NI) && !defined(NJ)
> +/* Define the possible dataset sizes. */
> +#  ifdef MINI_DATASET
> +#   define NI 32
> +#   define NJ 32
> +#  endif
> +
> +#  ifdef SMALL_DATASET
> +#   define NI 128
> +#   define NJ 128
> +#  endif
> +
> +#  ifdef STANDARD_DATASET /* Default if unspecified. */
> +#   define NI 1024
> +#   define NJ 1024
> +#  endif
> +
> +#  ifdef LARGE_DATASET
> +#   define NI 2000
> +#   define NJ 2000
> +#  endif
> +
> +#  ifdef EXTRALARGE_DATASET
> +#   define NI 4000
> +#   define NJ 4000
> +#  endif
> +# endif /* !N */
> +
> +# define _PB_NI POLYBENCH_LOOP_BOUND(NI,ni)
> +# define _PB_NJ POLYBENCH_LOOP_BOUND(NJ,nj)
> +
> +# ifndef DATA_TYPE
> +#  define DATA_TYPE double
> +#  define DATA_PRINTF_MODIFIER "%0.2lf "
> +# endif
> +
> +
> +#endif /* !SYR2K */
> 
> Propchange: test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/syr2k/syr2k.h
> ------------------------------------------------------------------------------
>    svn:executable = *
> 
> Added: test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/syr2k/syr2k.reference_output
> URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/syr2k/syr2k.reference_output?rev=159553&view=auto
> ==============================================================================
> --- test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/syr2k/syr2k.reference_output (added)
> +++ test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/syr2k/syr2k.reference_output Mon Jul  2 14:27:28 2012
> @@ -0,0 +1 @@
> +00e3df1371e3f5b9576862a0f36ef565
> 
> Propchange: test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/syr2k/syr2k.reference_output
> ------------------------------------------------------------------------------
>    svn:executable = *
> 
> Added: test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/syrk/Makefile
> URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/syrk/Makefile?rev=159553&view=auto
> ==============================================================================
> --- test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/syrk/Makefile (added)
> +++ test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/syrk/Makefile Mon Jul  2 14:27:28 2012
> @@ -0,0 +1,10 @@
> +LEVEL = ../../../../../..
> +
> +POLYBENCH_UTILS = SingleSource/Benchmarks/Polybench/utilities 
> +PROG          = syrk
> +CFLAGS        += -I $(PROJ_SRC_ROOT)/$(POLYBENCH_UTILS) -DPOLYBENCH_DUMP_ARRAYS
> +
> +HASH_PROGRAM_OUTPUT = 1
> +
> +include $(LEVEL)/SingleSource/Makefile.singlesrc
> +
> 
> Propchange: test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/syrk/Makefile
> ------------------------------------------------------------------------------
>    svn:executable = *
> 
> Added: test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/syrk/syrk.c
> URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/syrk/syrk.c?rev=159553&view=auto
> ==============================================================================
> --- test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/syrk/syrk.c (added)
> +++ test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/syrk/syrk.c Mon Jul  2 14:27:28 2012
> @@ -0,0 +1,118 @@
> +/**
> + * syrk.c: This file is part of the PolyBench/C 3.2 test suite.
> + *
> + *
> + * Contact: Louis-Noel Pouchet <pouchet at cse.ohio-state.edu>
> + * Web address: http://polybench.sourceforge.net
> + */
> +#include <stdio.h>
> +#include <unistd.h>
> +#include <string.h>
> +#include <math.h>
> +
> +/* Include polybench common header. */
> +#include <polybench.h>
> +
> +/* Include benchmark-specific header. */
> +/* Default data type is double, default size is 4000. */
> +#include "syrk.h"
> +
> +
> +/* Array initialization. */
> +static
> +void init_array(int ni, int nj,
> +		DATA_TYPE *alpha,
> +		DATA_TYPE *beta,
> +		DATA_TYPE POLYBENCH_2D(C,NI,NI,ni,ni),
> +		DATA_TYPE POLYBENCH_2D(A,NI,NJ,ni,nj))
> +{
> +  int i, j;
> +
> +  *alpha = 32412;
> +  *beta = 2123;
> +  for (i = 0; i < ni; i++)
> +    for (j = 0; j < nj; j++)
> +      A[i][j] = ((DATA_TYPE) i*j) / ni;
> +  for (i = 0; i < ni; i++)
> +    for (j = 0; j < ni; j++)
> +      C[i][j] = ((DATA_TYPE) i*j) / ni;
> +}
> +
> +
> +/* DCE code. Must scan the entire live-out data.
> +   Can be used also to check the correctness of the output. */
> +static
> +void print_array(int ni,
> +		 DATA_TYPE POLYBENCH_2D(C,NI,NI,ni,ni))
> +{
> +  int i, j;
> +
> +  for (i = 0; i < ni; i++)
> +    for (j = 0; j < ni; j++) {
> +	fprintf (stderr, DATA_PRINTF_MODIFIER, C[i][j]);
> +	if ((i * ni + j) % 20 == 0) fprintf (stderr, "\n");
> +    }
> +  fprintf (stderr, "\n");
> +}
> +
> +
> +/* Main computational kernel. The whole function will be timed,
> +   including the call and return. */
> +static
> +void kernel_syrk(int ni, int nj,
> +		 DATA_TYPE alpha,
> +		 DATA_TYPE beta,
> +		 DATA_TYPE POLYBENCH_2D(C,NI,NI,ni,ni),
> +		 DATA_TYPE POLYBENCH_2D(A,NI,NJ,ni,nj))
> +{
> +  int i, j, k;
> +
> +#pragma scop
> +  /*  C := alpha*A*A' + beta*C */
> +  for (i = 0; i < _PB_NI; i++)
> +    for (j = 0; j < _PB_NI; j++)
> +      C[i][j] *= beta;
> +  for (i = 0; i < _PB_NI; i++)
> +    for (j = 0; j < _PB_NI; j++)
> +      for (k = 0; k < _PB_NJ; k++)
> +	  C[i][j] += alpha * A[i][k] * A[j][k];
> +#pragma endscop
> +
> +}
> +
> +
> +int main(int argc, char** argv)
> +{
> +  /* Retrieve problem size. */
> +  int ni = NI;
> +  int nj = NJ;
> +
> +  /* Variable declaration/allocation. */
> +  DATA_TYPE alpha;
> +  DATA_TYPE beta;
> +  POLYBENCH_2D_ARRAY_DECL(C,DATA_TYPE,NI,NI,ni,ni);
> +  POLYBENCH_2D_ARRAY_DECL(A,DATA_TYPE,NI,NJ,ni,nj);
> +
> +  /* Initialize array(s). */
> +  init_array (ni, nj, &alpha, &beta, POLYBENCH_ARRAY(C), POLYBENCH_ARRAY(A));
> +
> +  /* Start timer. */
> +  polybench_start_instruments;
> +
> +  /* Run kernel. */
> +  kernel_syrk (ni, nj, alpha, beta, POLYBENCH_ARRAY(C), POLYBENCH_ARRAY(A));
> +
> +  /* Stop and print timer. */
> +  polybench_stop_instruments;
> +  polybench_print_instruments;
> +
> +  /* Prevent dead-code elimination. All live-out data must be printed
> +     by the function call in argument. */
> +  polybench_prevent_dce(print_array(ni, POLYBENCH_ARRAY(C)));
> +
> +  /* Be clean. */
> +  POLYBENCH_FREE_ARRAY(C);
> +  POLYBENCH_FREE_ARRAY(A);
> +
> +  return 0;
> +}
> 
> Propchange: test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/syrk/syrk.c
> ------------------------------------------------------------------------------
>    svn:executable = *
> 
> Added: test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/syrk/syrk.h
> URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/syrk/syrk.h?rev=159553&view=auto
> ==============================================================================
> --- test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/syrk/syrk.h (added)
> +++ test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/syrk/syrk.h Mon Jul  2 14:27:28 2012
> @@ -0,0 +1,54 @@
> +/**
> + * syrk.h: This file is part of the PolyBench/C 3.2 test suite.
> + *
> + *
> + * Contact: Louis-Noel Pouchet <pouchet at cse.ohio-state.edu>
> + * Web address: http://polybench.sourceforge.net
> + */
> +#ifndef SYRK_H
> +# define SYRK_H
> +
> +/* Default to STANDARD_DATASET. */
> +# if !defined(MINI_DATASET) && !defined(SMALL_DATASET) && !defined(LARGE_DATASET) && !defined(EXTRALARGE_DATASET)
> +#  define STANDARD_DATASET
> +# endif
> +
> +/* Do not define anything if the user manually defines the size. */
> +# if !defined(NI) && !defined(NJ)
> +/* Define the possible dataset sizes. */
> +#  ifdef MINI_DATASET
> +#   define NI 32
> +#   define NJ 32
> +#  endif
> +
> +#  ifdef SMALL_DATASET
> +#   define NI 128
> +#   define NJ 128
> +#  endif
> +
> +#  ifdef STANDARD_DATASET /* Default if unspecified. */
> +#   define NI 1024
> +#   define NJ 1024
> +#  endif
> +
> +#  ifdef LARGE_DATASET
> +#   define NI 2000
> +#   define NJ 2000
> +#  endif
> +
> +#  ifdef EXTRALARGE_DATASET
> +#   define NI 4000
> +#   define NJ 4000
> +#  endif
> +# endif /* !N */
> +
> +# define _PB_NI POLYBENCH_LOOP_BOUND(NI,ni)
> +# define _PB_NJ POLYBENCH_LOOP_BOUND(NJ,nj)
> +
> +# ifndef DATA_TYPE
> +#  define DATA_TYPE double
> +#  define DATA_PRINTF_MODIFIER "%0.2lf "
> +# endif
> +
> +
> +#endif /* !SYRK */
> 
> Propchange: test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/syrk/syrk.h
> ------------------------------------------------------------------------------
>    svn:executable = *
> 
> Added: test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/syrk/syrk.reference_output
> URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/syrk/syrk.reference_output?rev=159553&view=auto
> ==============================================================================
> --- test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/syrk/syrk.reference_output (added)
> +++ test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/syrk/syrk.reference_output Mon Jul  2 14:27:28 2012
> @@ -0,0 +1 @@
> +8e49771874c426a32c3cf2f1f3aa0385
> 
> Propchange: test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/syrk/syrk.reference_output
> ------------------------------------------------------------------------------
>    svn:executable = *
> 
> Added: test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/trisolv/Makefile
> URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/trisolv/Makefile?rev=159553&view=auto
> ==============================================================================
> --- test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/trisolv/Makefile (added)
> +++ test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/trisolv/Makefile Mon Jul  2 14:27:28 2012
> @@ -0,0 +1,10 @@
> +LEVEL = ../../../../../..
> +
> +POLYBENCH_UTILS = SingleSource/Benchmarks/Polybench/utilities 
> +PROG          = trisolv
> +CFLAGS        += -I $(PROJ_SRC_ROOT)/$(POLYBENCH_UTILS) -DPOLYBENCH_DUMP_ARRAYS
> +
> +HASH_PROGRAM_OUTPUT = 1
> +
> +include $(LEVEL)/SingleSource/Makefile.singlesrc
> +
> 
> Propchange: test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/trisolv/Makefile
> ------------------------------------------------------------------------------
>    svn:executable = *
> 
> Added: test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/trisolv/trisolv.c
> URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/trisolv/trisolv.c?rev=159553&view=auto
> ==============================================================================
> --- test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/trisolv/trisolv.c (added)
> +++ test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/trisolv/trisolv.c Mon Jul  2 14:27:28 2012
> @@ -0,0 +1,123 @@
> +/**
> + * trisolv.c: This file is part of the PolyBench/C 3.2 test suite.
> + *
> + *
> + * Contact: Louis-Noel Pouchet <pouchet at cse.ohio-state.edu>
> + * Web address: http://polybench.sourceforge.net
> + */
> +#include <stdio.h>
> +#include <unistd.h>
> +#include <string.h>
> +#include <math.h>
> +
> +/* Include polybench common header. */
> +#include <polybench.h>
> +
> +/* Include benchmark-specific header. */
> +/* Default data type is double, default size is 4000. */
> +#include "trisolv.h"
> +
> +
> +/* Array initialization. */
> +static
> +void init_array(int n,
> +		DATA_TYPE POLYBENCH_2D(A,N,N,n,n),
> +		DATA_TYPE POLYBENCH_1D(x,N,n),
> +		DATA_TYPE POLYBENCH_1D(c,N,n))
> +{
> +  int i, j;
> +  /*
> +  LLVM: This change ensures we do not calculate nan values, which are
> +        formatted differently on different platforms and which may also
> +        be optimized unexpectedly.
> +  Original code:
> +  for (i = 0; i < n; i++)
> +    {
> +      c[i] = x[i] = ((DATA_TYPE) i) / n;
> +      for (j = 0; j < n; j++)
> +	      A[i][j] = ((DATA_TYPE) i*j) / n;
> +    }
> +  */
> +  for (i = 0; i < n; i++)
> +    {
> +      c[i] = x[i] = ((DATA_TYPE) i+n) / n;
> +      for (j = 0; j < n; j++)
> +      	A[i][j] = ((DATA_TYPE) i*j+n) / n;
> +    }
> +}
> +
> +
> +/* DCE code. Must scan the entire live-out data.
> +   Can be used also to check the correctness of the output. */
> +static
> +void print_array(int n,
> +		 DATA_TYPE POLYBENCH_1D(x,N,n))
> +
> +{
> +  int i;
> +
> +  for (i = 0; i < n; i++) {
> +    fprintf (stderr, DATA_PRINTF_MODIFIER, x[i]);
> +    if (i % 20 == 0) fprintf (stderr, "\n");
> +  }
> +}
> +
> +
> +/* Main computational kernel. The whole function will be timed,
> +   including the call and return. */
> +static
> +void kernel_trisolv(int n,
> +		    DATA_TYPE POLYBENCH_2D(A,N,N,n,n),
> +		    DATA_TYPE POLYBENCH_1D(x,N,n),
> +		    DATA_TYPE POLYBENCH_1D(c,N,n))
> +{
> +  int i, j;
> +
> +#pragma scop
> +  for (i = 0; i < _PB_N; i++)
> +    {
> +      x[i] = c[i];
> +      for (j = 0; j <= i - 1; j++)
> +        x[i] = x[i] - A[i][j] * x[j];
> +      x[i] = x[i] / A[i][i];
> +    }
> +#pragma endscop
> +
> +}
> +
> +
> +int main(int argc, char** argv)
> +{
> +  /* Retrieve problem size. */
> +  int n = N;
> +
> +  /* Variable declaration/allocation. */
> +  POLYBENCH_2D_ARRAY_DECL(A, DATA_TYPE, N, N, n, n);
> +  POLYBENCH_1D_ARRAY_DECL(x, DATA_TYPE, N, n);
> +  POLYBENCH_1D_ARRAY_DECL(c, DATA_TYPE, N, n);
> +
> +
> +  /* Initialize array(s). */
> +  init_array (n, POLYBENCH_ARRAY(A), POLYBENCH_ARRAY(x), POLYBENCH_ARRAY(c));
> +
> +  /* Start timer. */
> +  polybench_start_instruments;
> +
> +  /* Run kernel. */
> +  kernel_trisolv (n, POLYBENCH_ARRAY(A), POLYBENCH_ARRAY(x), POLYBENCH_ARRAY(c));
> +
> +  /* Stop and print timer. */
> +  polybench_stop_instruments;
> +  polybench_print_instruments;
> +
> +  /* Prevent dead-code elimination. All live-out data must be printed
> +     by the function call in argument. */
> +  polybench_prevent_dce(print_array(n, POLYBENCH_ARRAY(x)));
> +
> +  /* Be clean. */
> +  POLYBENCH_FREE_ARRAY(A);
> +  POLYBENCH_FREE_ARRAY(x);
> +  POLYBENCH_FREE_ARRAY(c);
> +
> +  return 0;
> +}
> 
> Propchange: test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/trisolv/trisolv.c
> ------------------------------------------------------------------------------
>    svn:executable = *
> 
> Added: test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/trisolv/trisolv.h
> URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/trisolv/trisolv.h?rev=159553&view=auto
> ==============================================================================
> --- test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/trisolv/trisolv.h (added)
> +++ test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/trisolv/trisolv.h Mon Jul  2 14:27:28 2012
> @@ -0,0 +1,48 @@
> +/**
> + * trisolv.h: This file is part of the PolyBench/C 3.2 test suite.
> + *
> + *
> + * Contact: Louis-Noel Pouchet <pouchet at cse.ohio-state.edu>
> + * Web address: http://polybench.sourceforge.net
> + */
> +#ifndef TRISOLV_H
> +# define TRISOLV_H
> +
> +/* Default to STANDARD_DATASET. */
> +# if !defined(MINI_DATASET) && !defined(SMALL_DATASET) && !defined(LARGE_DATASET) && !defined(EXTRALARGE_DATASET)
> +#  define STANDARD_DATASET
> +# endif
> +
> +/* Do not define anything if the user manually defines the size. */
> +# ifndef N
> +/* Define the possible dataset sizes. */
> +#  ifdef MINI_DATASET
> +#   define N 32
> +#  endif
> +
> +#  ifdef SMALL_DATASET
> +#   define N 500
> +#  endif
> +
> +#  ifdef STANDARD_DATASET /* Default if unspecified. */
> +#   define N 4000
> +#  endif
> +
> +#  ifdef LARGE_DATASET
> +#   define N 8000
> +#  endif
> +
> +#  ifdef EXTRALARGE_DATASET
> +#   define N 100000
> +#  endif
> +# endif /* !N */
> +
> +# define _PB_N POLYBENCH_LOOP_BOUND(N,n)
> +
> +# ifndef DATA_TYPE
> +#  define DATA_TYPE double
> +#  define DATA_PRINTF_MODIFIER "%0.2lf "
> +# endif
> +
> +
> +#endif /* !TRISOLV */
> 
> Propchange: test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/trisolv/trisolv.h
> ------------------------------------------------------------------------------
>    svn:executable = *
> 
> Added: test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/trisolv/trisolv.reference_output
> URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/trisolv/trisolv.reference_output?rev=159553&view=auto
> ==============================================================================
> --- test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/trisolv/trisolv.reference_output (added)
> +++ test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/trisolv/trisolv.reference_output Mon Jul  2 14:27:28 2012
> @@ -0,0 +1 @@
> +41151c37936a7c5c0ed56884b86b6270
> 
> Propchange: test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/trisolv/trisolv.reference_output
> ------------------------------------------------------------------------------
>    svn:executable = *
> 
> Added: test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/trmm/Makefile
> URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/trmm/Makefile?rev=159553&view=auto
> ==============================================================================
> --- test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/trmm/Makefile (added)
> +++ test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/trmm/Makefile Mon Jul  2 14:27:28 2012
> @@ -0,0 +1,10 @@
> +LEVEL = ../../../../../..
> +
> +POLYBENCH_UTILS = SingleSource/Benchmarks/Polybench/utilities 
> +PROG          = trmm
> +CFLAGS        += -I $(PROJ_SRC_ROOT)/$(POLYBENCH_UTILS) -DPOLYBENCH_DUMP_ARRAYS
> +
> +HASH_PROGRAM_OUTPUT = 1
> +
> +include $(LEVEL)/SingleSource/Makefile.singlesrc
> +
> 
> Propchange: test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/trmm/Makefile
> ------------------------------------------------------------------------------
>    svn:executable = *
> 
> Added: test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/trmm/trmm.c
> URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/trmm/trmm.c?rev=159553&view=auto
> ==============================================================================
> --- test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/trmm/trmm.c (added)
> +++ test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/trmm/trmm.c Mon Jul  2 14:27:28 2012
> @@ -0,0 +1,109 @@
> +/**
> + * trmm.c: This file is part of the PolyBench/C 3.2 test suite.
> + *
> + *
> + * Contact: Louis-Noel Pouchet <pouchet at cse.ohio-state.edu>
> + * Web address: http://polybench.sourceforge.net
> + */
> +#include <stdio.h>
> +#include <unistd.h>
> +#include <string.h>
> +#include <math.h>
> +
> +/* Include polybench common header. */
> +#include <polybench.h>
> +
> +/* Include benchmark-specific header. */
> +/* Default data type is double, default size is 4000. */
> +#include "trmm.h"
> +
> +
> +/* Array initialization. */
> +static
> +void init_array(int ni,
> +		DATA_TYPE *alpha,
> +		DATA_TYPE POLYBENCH_2D(A,NI,NI,ni,ni),
> +		DATA_TYPE POLYBENCH_2D(B,NI,NI,ni,ni))
> +{
> +  int i, j;
> +
> +  *alpha = 32412;
> +  for (i = 0; i < ni; i++)
> +    for (j = 0; j < ni; j++) {
> +      A[i][j] = ((DATA_TYPE) i*j) / ni;
> +      B[i][j] = ((DATA_TYPE) i*j) / ni;
> +    }
> +}
> +
> +
> +/* DCE code. Must scan the entire live-out data.
> +   Can be used also to check the correctness of the output. */
> +static
> +void print_array(int ni,
> +		 DATA_TYPE POLYBENCH_2D(B,NI,NI,ni,ni))
> +{
> +  int i, j;
> +
> +  for (i = 0; i < ni; i++)
> +    for (j = 0; j < ni; j++) {
> +	fprintf (stderr, DATA_PRINTF_MODIFIER, B[i][j]);
> +	if ((i * ni + j) % 20 == 0) fprintf (stderr, "\n");
> +    }
> +  fprintf (stderr, "\n");
> +}
> +
> +
> +/* Main computational kernel. The whole function will be timed,
> +   including the call and return. */
> +static
> +void kernel_trmm(int ni,
> +		 DATA_TYPE alpha,
> +		 DATA_TYPE POLYBENCH_2D(A,NI,NI,ni,ni),
> +		 DATA_TYPE POLYBENCH_2D(B,NI,NI,ni,ni))
> +{
> +  int i, j, k;
> +
> +#pragma scop
> +  /*  B := alpha*A'*B, A triangular */
> +  for (i = 1; i < _PB_NI; i++)
> +    for (j = 0; j < _PB_NI; j++)
> +      for (k = 0; k < i; k++)
> +        B[i][j] += alpha * A[i][k] * B[j][k];
> +#pragma endscop
> +
> +}
> +
> +
> +int main(int argc, char** argv)
> +{
> +  /* Retrieve problem size. */
> +  int ni = NI;
> +
> +  /* Variable declaration/allocation. */
> +  DATA_TYPE alpha;
> +  POLYBENCH_2D_ARRAY_DECL(A,DATA_TYPE,NI,NI,ni,ni);
> +  POLYBENCH_2D_ARRAY_DECL(B,DATA_TYPE,NI,NI,ni,ni);
> +
> +  /* Initialize array(s). */
> +  init_array (ni, &alpha, POLYBENCH_ARRAY(A), POLYBENCH_ARRAY(B));
> +
> +  /* Start timer. */
> +  polybench_start_instruments;
> +
> +  /* Run kernel. */
> +  kernel_trmm (ni, alpha, POLYBENCH_ARRAY(A), POLYBENCH_ARRAY(B));
> +
> +  /* Stop and print timer. */
> +  polybench_stop_instruments;
> +  polybench_print_instruments;
> +
> +  /* Prevent dead-code elimination. All live-out data must be printed
> +     by the function call in argument. */
> +  polybench_prevent_dce(print_array(ni, POLYBENCH_ARRAY(B)));
> +
> +  /* Be clean. */
> +  POLYBENCH_FREE_ARRAY(A);
> +  POLYBENCH_FREE_ARRAY(B);
> +
> +  return 0;
> +}
> 
> Propchange: test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/trmm/trmm.c
> ------------------------------------------------------------------------------
>    svn:executable = *
> 
> Added: test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/trmm/trmm.h
> URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/trmm/trmm.h?rev=159553&view=auto
> ==============================================================================
> --- test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/trmm/trmm.h (added)
> +++ test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/trmm/trmm.h Mon Jul  2 14:27:28 2012
> @@ -0,0 +1,48 @@
> +/**
> + * trmm.h: This file is part of the PolyBench/C 3.2 test suite.
> + *
> + *
> + * Contact: Louis-Noel Pouchet <pouchet at cse.ohio-state.edu>
> + * Web address: http://polybench.sourceforge.net
> + */
> +#ifndef TRMM_H
> +# define TRMM_H
> +
> +/* Default to STANDARD_DATASET. */
> +# if !defined(MINI_DATASET) && !defined(SMALL_DATASET) && !defined(LARGE_DATASET) && !defined(EXTRALARGE_DATASET)
> +#  define STANDARD_DATASET
> +# endif
> +
> +/* Do not define anything if the user manually defines the size. */
> +# if !defined(NI)
> +/* Define the possible dataset sizes. */
> +#  ifdef MINI_DATASET
> +#   define NI 32
> +#  endif
> +
> +#  ifdef SMALL_DATASET
> +#   define NI 128
> +#  endif
> +
> +#  ifdef STANDARD_DATASET /* Default if unspecified. */
> +#   define NI 1024
> +#  endif
> +
> +#  ifdef LARGE_DATASET
> +#   define NI 2000
> +#  endif
> +
> +#  ifdef EXTRALARGE_DATASET
> +#   define NI 4000
> +#  endif
> +# endif /* !N */
> +
> +# define _PB_NI POLYBENCH_LOOP_BOUND(NI,ni)
> +
> +# ifndef DATA_TYPE
> +#  define DATA_TYPE double
> +#  define DATA_PRINTF_MODIFIER "%0.2lf "
> +# endif
> +
> +
> +#endif /* !TRMM */
> 
> Propchange: test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/trmm/trmm.h
> ------------------------------------------------------------------------------
>    svn:executable = *
> 
> Added: test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/trmm/trmm.reference_output
> URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/trmm/trmm.reference_output?rev=159553&view=auto
> ==============================================================================
> --- test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/trmm/trmm.reference_output (added)
> +++ test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/trmm/trmm.reference_output Mon Jul  2 14:27:28 2012
> @@ -0,0 +1 @@
> +fd1579a9f0ec5c2585fdc77df8e870cc
> 
> Propchange: test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/kernels/trmm/trmm.reference_output
> ------------------------------------------------------------------------------
>    svn:executable = *
> 
> Added: test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/solvers/Makefile
> URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/solvers/Makefile?rev=159553&view=auto
> ==============================================================================
> --- test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/solvers/Makefile (added)
> +++ test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/solvers/Makefile Mon Jul  2 14:27:28 2012
> @@ -0,0 +1,13 @@
> +# SingleSource/Polybench/linear-algebra
> +# Makefile:  Build all subdirectories automatically
> +
> +LEVEL = ../../../../..
> +PARALLEL_DIRS = durbin dynprog gramschmidt lu
> +
> +# LLVM: We removed the benchmark ludcmp. This change ensures we do not
> +# calculate nan values, which are formatted differently on different platforms
> +# and which may also be optimized unexpectedly.
> +
> +include $(LEVEL)/Makefile.config
> +include $(LEVEL)/Makefile.programs
> +
> 
> Propchange: test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/solvers/Makefile
> ------------------------------------------------------------------------------
>    svn:executable = *
> 
> Added: test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/solvers/durbin/Makefile
> URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/solvers/durbin/Makefile?rev=159553&view=auto
> ==============================================================================
> --- test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/solvers/durbin/Makefile (added)
> +++ test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/solvers/durbin/Makefile Mon Jul  2 14:27:28 2012
> @@ -0,0 +1,10 @@
> +LEVEL = ../../../../../..
> +
> +POLYBENCH_UTILS = SingleSource/Benchmarks/Polybench/utilities 
> +PROG          = durbin
> +CFLAGS        += -I $(PROJ_SRC_ROOT)/$(POLYBENCH_UTILS) -DPOLYBENCH_DUMP_ARRAYS
> +
> +HASH_PROGRAM_OUTPUT = 1
> +
> +include $(LEVEL)/SingleSource/Makefile.singlesrc
> +
> 
> Propchange: test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/solvers/durbin/Makefile
> ------------------------------------------------------------------------------
>    svn:executable = *
> 
> Added: test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/solvers/durbin/durbin.c
> URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/solvers/durbin/durbin.c?rev=159553&view=auto
> ==============================================================================
> --- test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/solvers/durbin/durbin.c (added)
> +++ test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/solvers/durbin/durbin.c Mon Jul  2 14:27:28 2012
> @@ -0,0 +1,147 @@
> +/**
> + * durbin.c: This file is part of the PolyBench/C 3.2 test suite.
> + *
> + *
> + * Contact: Louis-Noel Pouchet <pouchet at cse.ohio-state.edu>
> + * Web address: http://polybench.sourceforge.net
> + */
> +#include <stdio.h>
> +#include <unistd.h>
> +#include <string.h>
> +#include <math.h>
> +
> +/* Include polybench common header. */
> +#include <polybench.h>
> +
> +/* Include benchmark-specific header. */
> +/* Default data type is double, default size is 4000. */
> +#include "durbin.h"
> +
> +
> +/* Array initialization. */
> +static
> +void init_array (int n,
> +		 DATA_TYPE POLYBENCH_2D(y,N,N,n,n),
> +		 DATA_TYPE POLYBENCH_2D(sum,N,N,n,n),
> +		 DATA_TYPE POLYBENCH_1D(alpha,N,n),
> +		 DATA_TYPE POLYBENCH_1D(beta,N,n),
> +		 DATA_TYPE POLYBENCH_1D(r,N,n))
> +{
> +  int i, j;
> +
> +  for (i = 0; i < n; i++)
> +    {
> +      alpha[i] = i;
> +      beta[i] = (i+1)/n/2.0;
> +      r[i] = (i+1)/n/4.0;
> +      for (j = 0; j < n; j++) {
> +	y[i][j] = ((DATA_TYPE) i*j) / n;
> +	sum[i][j] = ((DATA_TYPE) i*j) / n;
> +      }
> +    }
> +}
> +
> +
> +/* DCE code. Must scan the entire live-out data.
> +   Can be used also to check the correctness of the output. */
> +static
> +void print_array(int n,
> +		 DATA_TYPE POLYBENCH_1D(out,N,n))
> +
> +{
> +  int i;
> +
> +  for (i = 0; i < n; i++) {
> +    fprintf (stderr, DATA_PRINTF_MODIFIER, out[i]);
> +    if (i % 20 == 0) fprintf (stderr, "\n");
> +  }
> +}
> +
> +
> +/* Main computational kernel. The whole function will be timed,
> +   including the call and return. */
> +static
> +void kernel_durbin(int n,
> +		   DATA_TYPE POLYBENCH_2D(y,N,N,n,n),
> +		   DATA_TYPE POLYBENCH_2D(sum,N,N,n,n),
> +		   DATA_TYPE POLYBENCH_1D(alpha,N,n),
> +		   DATA_TYPE POLYBENCH_1D(beta,N,n),
> +		   DATA_TYPE POLYBENCH_1D(r,N,n),
> +		   DATA_TYPE POLYBENCH_1D(out,N,n))
> +{
> +  int i, k;
> +
> +#pragma scop
> +  y[0][0] = r[0];
> +  beta[0] = 1;
> +  alpha[0] = r[0];
> +  for (k = 1; k < _PB_N; k++)
> +    {
> +      beta[k] = beta[k-1] - alpha[k-1] * alpha[k-1] * beta[k-1];
> +      sum[0][k] = r[k];
> +      for (i = 0; i <= k - 1; i++)
> +	sum[i+1][k] = sum[i][k] + r[k-i-1] * y[i][k-1];
> +      alpha[k] = -sum[k][k] * beta[k];
> +      for (i = 0; i <= k-1; i++)
> +	y[i][k] = y[i][k-1] + alpha[k] * y[k-i-1][k-1];
> +      y[k][k] = alpha[k];
> +    }
> +  for (i = 0; i < _PB_N; i++)
> +    out[i] = y[i][_PB_N-1];
> +#pragma endscop
> +
> +}
> +
> +
> +int main(int argc, char** argv)
> +{
> +  /* Retrieve problem size. */
> +  int n = N;
> +
> +  /* Variable declaration/allocation. */
> +  POLYBENCH_2D_ARRAY_DECL(y, DATA_TYPE, N, N, n, n);
> +  POLYBENCH_2D_ARRAY_DECL(sum, DATA_TYPE, N, N, n, n);
> +  POLYBENCH_1D_ARRAY_DECL(alpha, DATA_TYPE, N, n);
> +  POLYBENCH_1D_ARRAY_DECL(beta, DATA_TYPE, N, n);
> +  POLYBENCH_1D_ARRAY_DECL(r, DATA_TYPE, N, n);
> +  POLYBENCH_1D_ARRAY_DECL(out, DATA_TYPE, N, n);
> +
> +
> +  /* Initialize array(s). */
> +  init_array (n,
> +	      POLYBENCH_ARRAY(y),
> +	      POLYBENCH_ARRAY(sum),
> +	      POLYBENCH_ARRAY(alpha),
> +	      POLYBENCH_ARRAY(beta),
> +	      POLYBENCH_ARRAY(r));
> +
> +  /* Start timer. */
> +  polybench_start_instruments;
> +
> +  /* Run kernel. */
> +  kernel_durbin (n,
> +		 POLYBENCH_ARRAY(y),
> +		 POLYBENCH_ARRAY(sum),
> +		 POLYBENCH_ARRAY(alpha),
> +		 POLYBENCH_ARRAY(beta),
> +		 POLYBENCH_ARRAY(r),
> +		 POLYBENCH_ARRAY(out));
> +
> +  /* Stop and print timer. */
> +  polybench_stop_instruments;
> +  polybench_print_instruments;
> +
> +  /* Prevent dead-code elimination. All live-out data must be printed
> +     by the function call in argument. */
> +  polybench_prevent_dce(print_array(n, POLYBENCH_ARRAY(out)));
> +
> +  /* Be clean. */
> +  POLYBENCH_FREE_ARRAY(y);
> +  POLYBENCH_FREE_ARRAY(sum);
> +  POLYBENCH_FREE_ARRAY(alpha);
> +  POLYBENCH_FREE_ARRAY(beta);
> +  POLYBENCH_FREE_ARRAY(r);
> +  POLYBENCH_FREE_ARRAY(out);
> +
> +  return 0;
> +}
> 
> Propchange: test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/solvers/durbin/durbin.c
> ------------------------------------------------------------------------------
>    svn:executable = *
> 
> Added: test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/solvers/durbin/durbin.h
> URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/solvers/durbin/durbin.h?rev=159553&view=auto
> ==============================================================================
> --- test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/solvers/durbin/durbin.h (added)
> +++ test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/solvers/durbin/durbin.h Mon Jul  2 14:27:28 2012
> @@ -0,0 +1,48 @@
> +/**
> + * durbin.h: This file is part of the PolyBench/C 3.2 test suite.
> + *
> + *
> + * Contact: Louis-Noel Pouchet <pouchet at cse.ohio-state.edu>
> + * Web address: http://polybench.sourceforge.net
> + */
> +#ifndef DURBIN_H
> +# define DURBIN_H
> +
> +/* Default to STANDARD_DATASET. */
> +# if !defined(MINI_DATASET) && !defined(SMALL_DATASET) && !defined(LARGE_DATASET) && !defined(EXTRALARGE_DATASET)
> +#  define STANDARD_DATASET
> +# endif
> +
> +/* Do not define anything if the user manually defines the size. */
> +# ifndef N
> +/* Define the possible dataset sizes. */
> +#  ifdef MINI_DATASET
> +#   define N 32
> +#  endif
> +
> +#  ifdef SMALL_DATASET
> +#   define N 500
> +#  endif
> +
> +#  ifdef STANDARD_DATASET /* Default if unspecified. */
> +#   define N 4000
> +#  endif
> +
> +#  ifdef LARGE_DATASET
> +#   define N 8000
> +#  endif
> +
> +#  ifdef EXTRALARGE_DATASET
> +#   define N 100000
> +#  endif
> +# endif /* !N */
> +
> +# define _PB_N POLYBENCH_LOOP_BOUND(N,n)
> +
> +# ifndef DATA_TYPE
> +#  define DATA_TYPE double
> +#  define DATA_PRINTF_MODIFIER "%0.2lf "
> +# endif
> +
> +
> +#endif /* !DURBIN */
> 
> Propchange: test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/solvers/durbin/durbin.h
> ------------------------------------------------------------------------------
>    svn:executable = *
> 
> Added: test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/solvers/durbin/durbin.reference_output
> URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/solvers/durbin/durbin.reference_output?rev=159553&view=auto
> ==============================================================================
> --- test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/solvers/durbin/durbin.reference_output (added)
> +++ test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/solvers/durbin/durbin.reference_output Mon Jul  2 14:27:28 2012
> @@ -0,0 +1 @@
> +5a60e01ba29a050bf6526ed97989884f
> 
> Propchange: test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/solvers/durbin/durbin.reference_output
> ------------------------------------------------------------------------------
>    svn:executable = *
> 
> Added: test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/solvers/dynprog/Makefile
> URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/solvers/dynprog/Makefile?rev=159553&view=auto
> ==============================================================================
> --- test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/solvers/dynprog/Makefile (added)
> +++ test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/solvers/dynprog/Makefile Mon Jul  2 14:27:28 2012
> @@ -0,0 +1,10 @@
> +LEVEL = ../../../../../..
> +
> +POLYBENCH_UTILS = SingleSource/Benchmarks/Polybench/utilities 
> +PROG          = dynprog
> +CFLAGS        += -I $(PROJ_SRC_ROOT)/$(POLYBENCH_UTILS) -DPOLYBENCH_DUMP_ARRAYS
> +
> +HASH_PROGRAM_OUTPUT = 1
> +
> +include $(LEVEL)/SingleSource/Makefile.singlesrc
> +
> 
> Propchange: test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/solvers/dynprog/Makefile
> ------------------------------------------------------------------------------
>    svn:executable = *
> 
> Added: test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/solvers/dynprog/dynprog.c
> URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/solvers/dynprog/dynprog.c?rev=159553&view=auto
> ==============================================================================
> --- test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/solvers/dynprog/dynprog.c (added)
> +++ test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/solvers/dynprog/dynprog.c Mon Jul  2 14:27:28 2012
> @@ -0,0 +1,123 @@
> +/**
> + * dynprog.c: This file is part of the PolyBench/C 3.2 test suite.
> + *
> + *
> + * Contact: Louis-Noel Pouchet <pouchet at cse.ohio-state.edu>
> + * Web address: http://polybench.sourceforge.net
> + */
> +#include <stdio.h>
> +#include <unistd.h>
> +#include <string.h>
> +#include <math.h>
> +
> +/* Include polybench common header. */
> +#include <polybench.h>
> +
> +/* Include benchmark-specific header. */
> +/* Default data type is int, default size is 50. */
> +#include "dynprog.h"
> +
> +
> +/* Array initialization. */
> +static
> +void init_array(int length,
> +		DATA_TYPE POLYBENCH_2D(c,LENGTH,LENGTH,length,length),
> +		DATA_TYPE POLYBENCH_2D(W,LENGTH,LENGTH,length,length))
> +{
> +  int i, j;
> +  for (i = 0; i < length; i++)
> +    for (j = 0; j < length; j++) {
> +      c[i][j] = i*j % 2;
> +      W[i][j] = ((DATA_TYPE) i-j) / length;
> +    }
> +}
> +
> +
> +/* DCE code. Must scan the entire live-out data.
> +   Can be used also to check the correctness of the output. */
> +static
> +void print_array(DATA_TYPE out)
> +{
> +  fprintf (stderr, DATA_PRINTF_MODIFIER, out);
> +  fprintf (stderr, "\n");
> +}
> +
> +
> +/* Main computational kernel. The whole function will be timed,
> +   including the call and return. */
> +static
> +void kernel_dynprog(int tsteps, int length,
> +		    DATA_TYPE POLYBENCH_2D(c,LENGTH,LENGTH,length,length),
> +		    DATA_TYPE POLYBENCH_2D(W,LENGTH,LENGTH,length,length),
> +		    DATA_TYPE POLYBENCH_3D(sum_c,LENGTH,LENGTH,LENGTH,length,length,length),
> +		    DATA_TYPE *out)
> +{
> +  int iter, i, j, k;
> +
> +  DATA_TYPE out_l = 0;
> +
> +#pragma scop
> +  for (iter = 0; iter < _PB_TSTEPS; iter++)
> +    {
> +      for (i = 0; i <= _PB_LENGTH - 1; i++)
> +	for (j = 0; j <= _PB_LENGTH - 1; j++)
> +	  c[i][j] = 0;
> +
> +      for (i = 0; i <= _PB_LENGTH - 2; i++)
> +	{
> +	  for (j = i + 1; j <= _PB_LENGTH - 1; j++)
> +	    {
> +	      sum_c[i][j][i] = 0;
> +	      for (k = i + 1; k <= j-1; k++)
> +		sum_c[i][j][k] = sum_c[i][j][k - 1] + c[i][k] + c[k][j];
> +	      c[i][j] = sum_c[i][j][j-1] + W[i][j];
> +	    }
> +	}
> +      out_l += c[0][_PB_LENGTH - 1];
> +    }
> +#pragma endscop
> +
> +  *out = out_l;
> +}
> +
> +
> +int main(int argc, char** argv)
> +{
> +  /* Retrieve problem size. */
> +  int length = LENGTH;
> +  int tsteps = TSTEPS;
> +
> +  /* Variable declaration/allocation. */
> +  DATA_TYPE out;
> +  POLYBENCH_3D_ARRAY_DECL(sum_c,DATA_TYPE,LENGTH,LENGTH,LENGTH,length,length,length);
> +  POLYBENCH_2D_ARRAY_DECL(c,DATA_TYPE,LENGTH,LENGTH,length,length);
> +  POLYBENCH_2D_ARRAY_DECL(W,DATA_TYPE,LENGTH,LENGTH,length,length);
> +
> +  /* Initialize array(s). */
> +  init_array (length, POLYBENCH_ARRAY(c), POLYBENCH_ARRAY(W));
> +
> +  /* Start timer. */
> +  polybench_start_instruments;
> +
> +  /* Run kernel. */
> +  kernel_dynprog (tsteps, length,
> +		  POLYBENCH_ARRAY(c),
> +		  POLYBENCH_ARRAY(W),
> +		  POLYBENCH_ARRAY(sum_c),
> +		  &out);
> +
> +  /* Stop and print timer. */
> +  polybench_stop_instruments;
> +  polybench_print_instruments;
> +
> +  /* Prevent dead-code elimination. All live-out data must be printed
> +     by the function call in argument. */
> +  polybench_prevent_dce(print_array(out));
> +
> +  /* Be clean. */
> +  POLYBENCH_FREE_ARRAY(sum_c);
> +  POLYBENCH_FREE_ARRAY(c);
> +  POLYBENCH_FREE_ARRAY(W);
> +
> +  return 0;
> +}
> 
> Propchange: test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/solvers/dynprog/dynprog.c
> ------------------------------------------------------------------------------
>    svn:executable = *
> 
> Added: test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/solvers/dynprog/dynprog.h
> URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/solvers/dynprog/dynprog.h?rev=159553&view=auto
> ==============================================================================
> --- test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/solvers/dynprog/dynprog.h (added)
> +++ test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/solvers/dynprog/dynprog.h Mon Jul  2 14:27:28 2012
> @@ -0,0 +1,54 @@
> +/**
> + * dynprog.h: This file is part of the PolyBench/C 3.2 test suite.
> + *
> + *
> + * Contact: Louis-Noel Pouchet <pouchet at cse.ohio-state.edu>
> + * Web address: http://polybench.sourceforge.net
> + */
> +#ifndef DYNPROG_H
> +# define DYNPROG_H
> +
> +/* Default to STANDARD_DATASET. */
> +# if !defined(MINI_DATASET) && !defined(SMALL_DATASET) && !defined(LARGE_DATASET) && !defined(EXTRALARGE_DATASET)
> +#  define STANDARD_DATASET
> +# endif
> +
> +/* Do not define anything if the user manually defines the size. */
> +# if !defined(TSTEPS) && !defined(LENGTH)
> +/* Define the possible dataset sizes. */
> +#  ifdef MINI_DATASET
> +#   define TSTEPS 10
> +#   define LENGTH 32
> +#  endif
> +
> +#  ifdef SMALL_DATASET
> +#   define TSTEPS 100
> +#   define LENGTH 50
> +#  endif
> +
> +#  ifdef STANDARD_DATASET /* Default if unspecified. */
> +#   define TSTEPS 10000
> +#   define LENGTH 50
> +#  endif
> +
> +#  ifdef LARGE_DATASET
> +#   define TSTEPS 1000
> +#   define LENGTH 500
> +#  endif
> +
> +#  ifdef EXTRALARGE_DATASET
> +#   define TSTEPS 10000
> +#   define LENGTH 500
> +#  endif
> +# endif /* !N */
> +
> +# define _PB_TSTEPS POLYBENCH_LOOP_BOUND(TSTEPS,tsteps)
> +# define _PB_LENGTH POLYBENCH_LOOP_BOUND(LENGTH,length)
> +
> +# ifndef DATA_TYPE
> +#  define DATA_TYPE int
> +#  define DATA_PRINTF_MODIFIER "%d "
> +# endif
> +
> +
> +#endif /* !DYNPROG */
> 
> Propchange: test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/solvers/dynprog/dynprog.h
> ------------------------------------------------------------------------------
>    svn:executable = *
> 
> Added: test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/solvers/dynprog/dynprog.reference_output
> URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/solvers/dynprog/dynprog.reference_output?rev=159553&view=auto
> ==============================================================================
> --- test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/solvers/dynprog/dynprog.reference_output (added)
> +++ test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/solvers/dynprog/dynprog.reference_output Mon Jul  2 14:27:28 2012
> @@ -0,0 +1 @@
> +3266e7ad50094462f6638a86d596e029
> 
> Propchange: test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/solvers/dynprog/dynprog.reference_output
> ------------------------------------------------------------------------------
>    svn:executable = *
> 
> Added: test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/solvers/gramschmidt/Makefile
> URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/solvers/gramschmidt/Makefile?rev=159553&view=auto
> ==============================================================================
> --- test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/solvers/gramschmidt/Makefile (added)
> +++ test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/solvers/gramschmidt/Makefile Mon Jul  2 14:27:28 2012
> @@ -0,0 +1,10 @@
> +LEVEL = ../../../../../..
> +
> +POLYBENCH_UTILS = SingleSource/Benchmarks/Polybench/utilities 
> +PROG          = gramschmidt
> +CFLAGS        += -I $(PROJ_SRC_ROOT)/$(POLYBENCH_UTILS) -DPOLYBENCH_DUMP_ARRAYS
> +
> +HASH_PROGRAM_OUTPUT = 1
> +
> +include $(LEVEL)/SingleSource/Makefile.singlesrc
> +
> 
> Propchange: test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/solvers/gramschmidt/Makefile
> ------------------------------------------------------------------------------
>    svn:executable = *
> 
> Added: test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/solvers/gramschmidt/gramschmidt.c
> URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/solvers/gramschmidt/gramschmidt.c?rev=159553&view=auto
> ==============================================================================
> --- test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/solvers/gramschmidt/gramschmidt.c (added)
> +++ test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/solvers/gramschmidt/gramschmidt.c Mon Jul  2 14:27:28 2012
> @@ -0,0 +1,160 @@
> +/**
> + * gramschmidt.c: This file is part of the PolyBench/C 3.2 test suite.
> + *
> + *
> + * Contact: Louis-Noel Pouchet <pouchet at cse.ohio-state.edu>
> + * Web address: http://polybench.sourceforge.net
> + */
> +#include <stdio.h>
> +#include <unistd.h>
> +#include <string.h>
> +#include <math.h>
> +
> +/* Include polybench common header. */
> +#include <polybench.h>
> +
> +/* Include benchmark-specific header. */
> +/* Default data type is double, default size is 512. */
> +#include "gramschmidt.h"
> +
> +
> +/* Array initialization. */
> +static
> +void init_array(int ni, int nj,
> +		DATA_TYPE POLYBENCH_2D(A,NI,NJ,ni,nj),
> +		DATA_TYPE POLYBENCH_2D(R,NJ,NJ,nj,nj),
> +		DATA_TYPE POLYBENCH_2D(Q,NI,NJ,ni,nj))
> +{
> +  int i, j;
> +  /*
> +  LLVM: This change ensures we do not calculate nan values, which are
> +        formatted differently on different platforms and which may also
> +        be optimized unexpectedly.
> +  Original code:
> +  for (i = 0; i < ni; i++)
> +    for (j = 0; j < nj; j++) {
> +      A[i][j] = ((DATA_TYPE) i*j) / ni;
> +      Q[i][j] = ((DATA_TYPE) i*(j+1)) / nj;
> +    }
> +  for (i = 0; i < nj; i++)
> +    for (j = 0; j < nj; j++)
> +      R[i][j] = ((DATA_TYPE) i*(j+2)) / nj;
> +  */
> +  for (i = 0; i < ni; i++)
> +    for (j = 0; j < nj; j++) {
> +      A[i][j] = ((DATA_TYPE) i*j+ni) / ni;
> +      Q[i][j] = ((DATA_TYPE) i*(j+1)+nj) / nj;
> +    }
> +  for (i = 0; i < nj; i++)
> +    for (j = 0; j < nj; j++)
> +      R[i][j] = ((DATA_TYPE) i*(j+2)+nj) / nj;
> +}
> +
> +
> +/* DCE code. Must scan the entire live-out data.
> +   Can be used also to check the correctness of the output. */
> +static
> +void print_array(int ni, int nj,
> +		 DATA_TYPE POLYBENCH_2D(A,NI,NJ,ni,nj),
> +		 DATA_TYPE POLYBENCH_2D(R,NJ,NJ,nj,nj),
> +		 DATA_TYPE POLYBENCH_2D(Q,NI,NJ,ni,nj))
> +{
> +  int i, j;
> +
> +  for (i = 0; i < ni; i++)
> +    for (j = 0; j < nj; j++) {
> +	fprintf (stderr, DATA_PRINTF_MODIFIER, A[i][j]);
> +	if (i % 20 == 0) fprintf (stderr, "\n");
> +    }
> +  fprintf (stderr, "\n");
> +  for (i = 0; i < nj; i++)
> +    for (j = 0; j < nj; j++) {
> +	fprintf (stderr, DATA_PRINTF_MODIFIER, R[i][j]);
> +	if (i % 20 == 0) fprintf (stderr, "\n");
> +    }
> +  fprintf (stderr, "\n");
> +  for (i = 0; i < ni; i++)
> +    for (j = 0; j < nj; j++) {
> +	fprintf (stderr, DATA_PRINTF_MODIFIER, Q[i][j]);
> +	if (i % 20 == 0) fprintf (stderr, "\n");
> +    }
> +  fprintf (stderr, "\n");
> +}
> +
> +
> +/* Main computational kernel. The whole function will be timed,
> +   including the call and return. */
> +static
> +void kernel_gramschmidt(int ni, int nj,
> +			DATA_TYPE POLYBENCH_2D(A,NI,NJ,ni,nj),
> +			DATA_TYPE POLYBENCH_2D(R,NJ,NJ,nj,nj),
> +			DATA_TYPE POLYBENCH_2D(Q,NI,NJ,ni,nj))
> +{
> +  int i, j, k;
> +
> +  DATA_TYPE nrm;
> +
> +#pragma scop
> +  for (k = 0; k < _PB_NJ; k++)
> +    {
> +      nrm = 0;
> +      for (i = 0; i < _PB_NI; i++)
> +        nrm += A[i][k] * A[i][k];
> +      R[k][k] = sqrt(nrm);
> +      for (i = 0; i < _PB_NI; i++)
> +        Q[i][k] = A[i][k] / R[k][k];
> +      for (j = k + 1; j < _PB_NJ; j++)
> +	{
> +	  R[k][j] = 0;
> +	  for (i = 0; i < _PB_NI; i++)
> +	    R[k][j] += Q[i][k] * A[i][j];
> +	  for (i = 0; i < _PB_NI; i++)
> +	    A[i][j] = A[i][j] - Q[i][k] * R[k][j];
> +	}
> +    }
> +#pragma endscop
> +
> +}
> +
> +
> +int main(int argc, char** argv)
> +{
> +  /* Retrieve problem size. */
> +  int ni = NI;
> +  int nj = NJ;
> +
> +  /* Variable declaration/allocation. */
> +  POLYBENCH_2D_ARRAY_DECL(A,DATA_TYPE,NI,NJ,ni,nj);
> +  POLYBENCH_2D_ARRAY_DECL(R,DATA_TYPE,NJ,NJ,nj,nj);
> +  POLYBENCH_2D_ARRAY_DECL(Q,DATA_TYPE,NI,NJ,ni,nj);
> +
> +  /* Initialize array(s). */
> +  init_array (ni, nj,
> +	      POLYBENCH_ARRAY(A),
> +	      POLYBENCH_ARRAY(R),
> +	      POLYBENCH_ARRAY(Q));
> +
> +  /* Start timer. */
> +  polybench_start_instruments;
> +
> +  /* Run kernel. */
> +  kernel_gramschmidt (ni, nj,
> +		      POLYBENCH_ARRAY(A),
> +		      POLYBENCH_ARRAY(R),
> +		      POLYBENCH_ARRAY(Q));
> +
> +  /* Stop and print timer. */
> +  polybench_stop_instruments;
> +  polybench_print_instruments;
> +
> +  /* Prevent dead-code elimination. All live-out data must be printed
> +     by the function call in argument. */
> +  polybench_prevent_dce(print_array(ni, nj, POLYBENCH_ARRAY(A), POLYBENCH_ARRAY(R), POLYBENCH_ARRAY(Q)));
> +
> +  /* Be clean. */
> +  POLYBENCH_FREE_ARRAY(A);
> +  POLYBENCH_FREE_ARRAY(R);
> +  POLYBENCH_FREE_ARRAY(Q);
> +
> +  return 0;
> +}
> 
> Propchange: test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/solvers/gramschmidt/gramschmidt.c
> ------------------------------------------------------------------------------
>    svn:executable = *
> 
> Added: test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/solvers/gramschmidt/gramschmidt.h
> URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/solvers/gramschmidt/gramschmidt.h?rev=159553&view=auto
> ==============================================================================
> --- test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/solvers/gramschmidt/gramschmidt.h (added)
> +++ test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/solvers/gramschmidt/gramschmidt.h Mon Jul  2 14:27:28 2012
> @@ -0,0 +1,54 @@
> +/**
> + * gramschmidt.h: This file is part of the PolyBench/C 3.2 test suite.
> + *
> + *
> + * Contact: Louis-Noel Pouchet <pouchet at cse.ohio-state.edu>
> + * Web address: http://polybench.sourceforge.net
> + */
> +#ifndef GRAMSCHMIDT_H
> +# define GRAMSCHMIDT_H
> +
> +/* Default to STANDARD_DATASET. */
> +# if !defined(MINI_DATASET) && !defined(SMALL_DATASET) && !defined(LARGE_DATASET) && !defined(EXTRALARGE_DATASET)
> +#  define STANDARD_DATASET
> +# endif
> +
> +/* Do not define anything if the user manually defines the size. */
> +# if !defined(NI) && !defined(NJ)
> +/* Define the possible dataset sizes. */
> +#  ifdef MINI_DATASET
> +#   define NI 32
> +#   define NJ 32
> +#  endif
> +
> +#  ifdef SMALL_DATASET
> +#   define NI 128
> +#   define NJ 128
> +#  endif
> +
> +#  ifdef STANDARD_DATASET /* Default if unspecified. */
> +#   define NI 512
> +#   define NJ 512
> +#  endif
> +
> +#  ifdef LARGE_DATASET
> +#   define NI 2000
> +#   define NJ 2000
> +#  endif
> +
> +#  ifdef EXTRALARGE_DATASET
> +#   define NI 4000
> +#   define NJ 4000
> +#  endif
> +# endif /* !N */
> +
> +# define _PB_NI POLYBENCH_LOOP_BOUND(NI,ni)
> +# define _PB_NJ POLYBENCH_LOOP_BOUND(NJ,nj)
> +
> +# ifndef DATA_TYPE
> +#  define DATA_TYPE double
> +#  define DATA_PRINTF_MODIFIER "%0.2lf "
> +# endif
> +
> +
> +#endif /* !GRAMSCHMIDT */
> 
> Propchange: test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/solvers/gramschmidt/gramschmidt.h
> ------------------------------------------------------------------------------
>    svn:executable = *
> 
> Added: test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/solvers/gramschmidt/gramschmidt.reference_output
> URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/solvers/gramschmidt/gramschmidt.reference_output?rev=159553&view=auto
> ==============================================================================
> --- test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/solvers/gramschmidt/gramschmidt.reference_output (added)
> +++ test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/solvers/gramschmidt/gramschmidt.reference_output Mon Jul  2 14:27:28 2012
> @@ -0,0 +1 @@
> +afd6148086976ac742f6e23d958a9abd
> 
> Propchange: test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/solvers/gramschmidt/gramschmidt.reference_output
> ------------------------------------------------------------------------------
>    svn:executable = *
> 
> Added: test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/solvers/lu/Makefile
> URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/solvers/lu/Makefile?rev=159553&view=auto
> ==============================================================================
> --- test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/solvers/lu/Makefile (added)
> +++ test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/solvers/lu/Makefile Mon Jul  2 14:27:28 2012
> @@ -0,0 +1,10 @@
> +LEVEL = ../../../../../..
> +
> +POLYBENCH_UTILS = SingleSource/Benchmarks/Polybench/utilities 
> +PROG          = lu
> +CFLAGS        += -I $(PROJ_SRC_ROOT)/$(POLYBENCH_UTILS) -DPOLYBENCH_DUMP_ARRAYS
> +
> +HASH_PROGRAM_OUTPUT = 1
> +
> +include $(LEVEL)/SingleSource/Makefile.singlesrc
> +
> 
> Propchange: test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/solvers/lu/Makefile
> ------------------------------------------------------------------------------
>    svn:executable = *
> 
> Added: test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/solvers/lu/lu.c
> URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/solvers/lu/lu.c?rev=159553&view=auto
> ==============================================================================
> --- test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/solvers/lu/lu.c (added)
> +++ test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/solvers/lu/lu.c Mon Jul  2 14:27:28 2012
> @@ -0,0 +1,112 @@
> +/**
> + * lu.c: This file is part of the PolyBench/C 3.2 test suite.
> + *
> + *
> + * Contact: Louis-Noel Pouchet <pouchet at cse.ohio-state.edu>
> + * Web address: http://polybench.sourceforge.net
> + */
> +#include <stdio.h>
> +#include <unistd.h>
> +#include <string.h>
> +#include <math.h>
> +
> +/* Include polybench common header. */
> +#include <polybench.h>
> +
> +/* Include benchmark-specific header. */
> +/* Default data type is double, default size is 1024. */
> +#include "lu.h"
> +
> +
> +/* Array initialization. */
> +static
> +void init_array (int n,
> +		 DATA_TYPE POLYBENCH_2D(A,N,N,n,n))
> +{
> +  int i, j;
> +
> +  for (i = 0; i < n; i++)
> +    for (j = 0; j < n; j++)
> +      A[i][j] = ((DATA_TYPE) (i+1)*(j+1)) / n;
> +}
> +
> +
> +/* DCE code. Must scan the entire live-out data.
> +   Can be used also to check the correctness of the output. */
> +static
> +void print_array(int n,
> +		 DATA_TYPE POLYBENCH_2D(A,N,N,n,n))
> +
> +{
> +  int i, j;
> +
> +  for (i = 0; i < n; i++)
> +    for (j = 0; j < n; j++) {
> +      fprintf (stderr, DATA_PRINTF_MODIFIER, A[i][j]);
> +      if ((i * n + j) % 20 == 0) fprintf (stderr, "\n");
> +    }
> +  fprintf (stderr, "\n");
> +}
> +
> +
> +/* Main computational kernel. The whole function will be timed,
> +   including the call and return. */
> +static
> +void kernel_lu(int n,
> +	       DATA_TYPE POLYBENCH_2D(A,N,N,n,n))
> +{
> +  int i, j, k;
> +
> +#pragma scop
> +  for (k = 0; k < _PB_N; k++)
> +    {
> +      for (j = k + 1; j < _PB_N; j++)
> +	A[k][j] = A[k][j] / A[k][k];
> +      for(i = k + 1; i < _PB_N; i++)
> +  /*
> +  LLVM: This change ensures we do not calculate nan values, which are
> +        formatted differently on different platforms and which may also
> +        be optimized unexpectedly.
> +  Original code:
> +  	for (j = k + 1; j < _PB_N; j++)
> +  	  A[i][j] = A[i][j] - A[i][k] * A[k][j];
> +  */
> +	for (j = k + 1; j < _PB_N; j++)
> +	  A[i][j] = A[i][j] + A[i][k] * A[k][j];
> +    }
> +#pragma endscop
> +
> +}
> +
> +
> +int main(int argc, char** argv)
> +{
> +  /* Retrieve problem size. */
> +  int n = N;
> +
> +  /* Variable declaration/allocation. */
> +  POLYBENCH_2D_ARRAY_DECL(A, DATA_TYPE, N, N, n, n);
> +
> +
> +  /* Initialize array(s). */
> +  init_array (n, POLYBENCH_ARRAY(A));
> +
> +  /* Start timer. */
> +  polybench_start_instruments;
> +
> +  /* Run kernel. */
> +  kernel_lu (n, POLYBENCH_ARRAY(A));
> +
> +  /* Stop and print timer. */
> +  polybench_stop_instruments;
> +  polybench_print_instruments;
> +
> +  /* Prevent dead-code elimination. All live-out data must be printed
> +     by the function call in argument. */
> +  polybench_prevent_dce(print_array(n, POLYBENCH_ARRAY(A)));
> +
> +  /* Be clean. */
> +  POLYBENCH_FREE_ARRAY(A);
> +
> +  return 0;
> +}
> 
> Propchange: test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/solvers/lu/lu.c
> ------------------------------------------------------------------------------
>    svn:executable = *
> 
> Added: test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/solvers/lu/lu.h
> URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/solvers/lu/lu.h?rev=159553&view=auto
> ==============================================================================
> --- test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/solvers/lu/lu.h (added)
> +++ test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/solvers/lu/lu.h Mon Jul  2 14:27:28 2012
> @@ -0,0 +1,56 @@
> +/**
> + * lu.h: This file is part of the PolyBench/C 3.2 test suite.
> + *
> + *
> + * Contact: Louis-Noel Pouchet <pouchet at cse.ohio-state.edu>
> + * Web address: http://polybench.sourceforge.net
> + */
> +#ifndef LU_H
> +# define LU_H
> +
> +/*
> +  LLVM: Use SMALL_DATASET instead of STANDARD_DATASET.
> +        This change ensures we do not calculate nan values, which are
> +        formatted differently on different platforms and which may also
> +        be optimized unexpectedly.
> +*/
> +#   define N 128
> +
> +/* Default to STANDARD_DATASET. */
> +# if !defined(MINI_DATASET) && !defined(SMALL_DATASET) && !defined(LARGE_DATASET) && !defined(EXTRALARGE_DATASET)
> +#  define STANDARD_DATASET
> +# endif
> +
> +/* Do not define anything if the user manually defines the size. */
> +# ifndef N
> +/* Define the possible dataset sizes. */
> +#  ifdef MINI_DATASET
> +#   define N 32
> +#  endif
> +
> +#  ifdef SMALL_DATASET
> +#   define N 128
> +#  endif
> +
> +#  ifdef STANDARD_DATASET /* Default if unspecified. */
> +#   define N 1024
> +#  endif
> +
> +#  ifdef LARGE_DATASET
> +#   define N 2000
> +#  endif
> +
> +#  ifdef EXTRALARGE_DATASET
> +#   define N 4000
> +#  endif
> +# endif /* !N */
> +
> +# define _PB_N POLYBENCH_LOOP_BOUND(N,n)
> +
> +# ifndef DATA_TYPE
> +#  define DATA_TYPE double
> +#  define DATA_PRINTF_MODIFIER "%0.2lf "
> +# endif
> +
> +
> +#endif /* !LU */
> 
> Propchange: test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/solvers/lu/lu.h
> ------------------------------------------------------------------------------
>    svn:executable = *
> 
> Added: test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/solvers/lu/lu.reference_output
> URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/solvers/lu/lu.reference_output?rev=159553&view=auto
> ==============================================================================
> --- test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/solvers/lu/lu.reference_output (added)
> +++ test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/solvers/lu/lu.reference_output Mon Jul  2 14:27:28 2012
> @@ -0,0 +1 @@
> +e755501e720addec3df7e4a44b31982c
> 
> Propchange: test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/solvers/lu/lu.reference_output
> ------------------------------------------------------------------------------
>    svn:executable = *
> 
> Added: test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/solvers/ludcmp/Makefile
> URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/solvers/ludcmp/Makefile?rev=159553&view=auto
> ==============================================================================
> --- test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/solvers/ludcmp/Makefile (added)
> +++ test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/solvers/ludcmp/Makefile Mon Jul  2 14:27:28 2012
> @@ -0,0 +1,10 @@
> +LEVEL = ../../../../../..
> +
> +POLYBENCH_UTILS = SingleSource/Benchmarks/Polybench/utilities 
> +PROG          = ludcmp
> +CFLAGS        += -I $(PROJ_SRC_ROOT)/$(POLYBENCH_UTILS) -DPOLYBENCH_DUMP_ARRAYS
> +
> +HASH_PROGRAM_OUTPUT = 1
> +
> +include $(LEVEL)/SingleSource/Makefile.singlesrc
> +
> 
> Propchange: test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/solvers/ludcmp/Makefile
> ------------------------------------------------------------------------------
>    svn:executable = *
> 
> Added: test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/solvers/ludcmp/ludcmp.c
> URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/solvers/ludcmp/ludcmp.c?rev=159553&view=auto
> ==============================================================================
> --- test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/solvers/ludcmp/ludcmp.c (added)
> +++ test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/solvers/ludcmp/ludcmp.c Mon Jul  2 14:27:28 2012
> @@ -0,0 +1,156 @@
> +/**
> + * ludcmp.c: This file is part of the PolyBench/C 3.2 test suite.
> + *
> + *
> + * Contact: Louis-Noel Pouchet <pouchet at cse.ohio-state.edu>
> + * Web address: http://polybench.sourceforge.net
> + */
> +#include <stdio.h>
> +#include <unistd.h>
> +#include <string.h>
> +#include <math.h>
> +
> +/* Include polybench common header. */
> +#include <polybench.h>
> +
> +/* Include benchmark-specific header. */
> +/* Default data type is double, default size is 1024. */
> +#include "ludcmp.h"
> +
> +
> +/* Array initialization. */
> +static
> +void init_array (int n,
> +		 DATA_TYPE POLYBENCH_2D(A,N+1,N+1,n+1,n+1),
> +		 DATA_TYPE POLYBENCH_1D(b,N+1,n+1),
> +		 DATA_TYPE POLYBENCH_1D(x,N+1,n+1),
> +		 DATA_TYPE POLYBENCH_1D(y,N+1,n+1))
> +{
> +  int i, j;
> +
> +  for (i = 0; i <= n; i++)
> +    {
> +      x[i] = i + 1;
> +      y[i] = (i+1)/n/2.0 + 1;
> +      b[i] = (i+1)/n/2.0 + 42;
> +      for (j = 0; j <= n; j++) {
> +	A[i][j] = ((DATA_TYPE) (i+1)*(j+1)) / n;
> +      }
> +    }
> +}
> +
> +
> +/* DCE code. Must scan the entire live-out data.
> +   Can be used also to check the correctness of the output. */
> +static
> +void print_array(int n,
> +		 DATA_TYPE POLYBENCH_1D(x,N+1,n+1))
> +
> +{
> +  int i;
> +
> +  for (i = 0; i <= n; i++) {
> +    fprintf (stderr, DATA_PRINTF_MODIFIER, x[i]);
> +    if (i % 20 == 0) fprintf (stderr, "\n");
> +  }
> +}
> +
> +
> +/* Main computational kernel. The whole function will be timed,
> +   including the call and return. */
> +static
> +void kernel_ludcmp(int n,
> +		   DATA_TYPE POLYBENCH_2D(A,N+1,N+1,n+1,n+1),
> +		   DATA_TYPE POLYBENCH_1D(b,N+1,n+1),
> +		   DATA_TYPE POLYBENCH_1D(x,N+1,n+1),
> +		   DATA_TYPE POLYBENCH_1D(y,N+1,n+1))
> +{
> +  int i, j, k;
> +
> +  DATA_TYPE w;
> +
> +#pragma scop
> +  b[0] = 1.0;
> +  for (i = 0; i < _PB_N; i++)
> +    {
> +      for (j = i+1; j <= _PB_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 <= _PB_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 <= _PB_N; i++)
> +    {
> +      w = b[i];
> +      for (j = 0; j < i; j++)
> +	w = w - A[i][j] * y[j];
> +      y[i] = w;
> +    }
> +  x[_PB_N] = y[_PB_N] / A[_PB_N][_PB_N];
> +  for (i = 0; i <= _PB_N - 1; i++)
> +    {
> +      w = y[_PB_N - 1 - (i)];
> +      for (j = _PB_N - i; j <= _PB_N; j++)
> +	w = w - A[_PB_N - 1 - i][j] * x[j];
> +      x[_PB_N - 1 - i] = w / A[_PB_N - 1 - (i)][_PB_N - 1-(i)];
> +    }
> +#pragma endscop
> +
> +}
> +
> +
> +int main(int argc, char** argv)
> +{
> +  /* Retrieve problem size. */
> +  int n = N;
> +
> +  /* Variable declaration/allocation. */
> +  POLYBENCH_2D_ARRAY_DECL(A, DATA_TYPE, N+1, N+1, n+1, n+1);
> +  POLYBENCH_1D_ARRAY_DECL(b, DATA_TYPE, N+1, n+1);
> +  POLYBENCH_1D_ARRAY_DECL(x, DATA_TYPE, N+1, n+1);
> +  POLYBENCH_1D_ARRAY_DECL(y, DATA_TYPE, N+1, n+1);
> +
> +
> +  /* Initialize array(s). */
> +  init_array (n,
> +	      POLYBENCH_ARRAY(A),
> +	      POLYBENCH_ARRAY(b),
> +	      POLYBENCH_ARRAY(x),
> +	      POLYBENCH_ARRAY(y));
> +
> +  /* Start timer. */
> +  polybench_start_instruments;
> +
> +  /* Run kernel. */
> +  kernel_ludcmp (n,
> +		 POLYBENCH_ARRAY(A),
> +		 POLYBENCH_ARRAY(b),
> +		 POLYBENCH_ARRAY(x),
> +		 POLYBENCH_ARRAY(y));
> +
> +  /* Stop and print timer. */
> +  polybench_stop_instruments;
> +  polybench_print_instruments;
> +
> +  /* Prevent dead-code elimination. All live-out data must be printed
> +     by the function call in argument. */
> +  polybench_prevent_dce(print_array(n, POLYBENCH_ARRAY(x)));
> +
> +  /* Be clean. */
> +  POLYBENCH_FREE_ARRAY(A);
> +  POLYBENCH_FREE_ARRAY(b);
> +  POLYBENCH_FREE_ARRAY(x);
> +  POLYBENCH_FREE_ARRAY(y);
> +
> +  return 0;
> +}
> 
> Propchange: test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/solvers/ludcmp/ludcmp.c
> ------------------------------------------------------------------------------
>    svn:executable = *
> 
> Added: test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/solvers/ludcmp/ludcmp.h
> URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/solvers/ludcmp/ludcmp.h?rev=159553&view=auto
> ==============================================================================
> --- test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/solvers/ludcmp/ludcmp.h (added)
> +++ test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/solvers/ludcmp/ludcmp.h Mon Jul  2 14:27:28 2012
> @@ -0,0 +1,48 @@
> +/**
> + * ludcmp.h: This file is part of the PolyBench/C 3.2 test suite.
> + *
> + *
> + * Contact: Louis-Noel Pouchet <pouchet at cse.ohio-state.edu>
> + * Web address: http://polybench.sourceforge.net
> + */
> +#ifndef LUDCMP_H
> +# define LUDCMP_H
> +
> +/* Default to STANDARD_DATASET. */
> +# if !defined(MINI_DATASET) && !defined(SMALL_DATASET) && !defined(LARGE_DATASET) && !defined(EXTRALARGE_DATASET)
> +#  define STANDARD_DATASET
> +# endif
> +
> +/* Do not define anything if the user manually defines the size. */
> +# ifndef N
> +/* Define the possible dataset sizes. */
> +#  ifdef MINI_DATASET
> +#   define N 32
> +#  endif
> +
> +#  ifdef SMALL_DATASET
> +#   define N 128
> +#  endif
> +
> +#  ifdef STANDARD_DATASET /* Default if unspecified. */
> +#   define N 1024
> +#  endif
> +
> +#  ifdef LARGE_DATASET
> +#   define N 2000
> +#  endif
> +
> +#  ifdef EXTRALARGE_DATASET
> +#   define N 4000
> +#  endif
> +# endif /* !N */
> +
> +# define _PB_N POLYBENCH_LOOP_BOUND(N,n)
> +
> +# ifndef DATA_TYPE
> +#  define DATA_TYPE double
> +#  define DATA_PRINTF_MODIFIER "%0.2lf "
> +# endif
> +
> +
> +#endif /* !LUDCMP */
> 
> Propchange: test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/solvers/ludcmp/ludcmp.h
> ------------------------------------------------------------------------------
>    svn:executable = *
> 
> Added: test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/solvers/ludcmp/ludcmp.reference_output
> URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/solvers/ludcmp/ludcmp.reference_output?rev=159553&view=auto
> ==============================================================================
> --- test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/solvers/ludcmp/ludcmp.reference_output (added)
> +++ test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/solvers/ludcmp/ludcmp.reference_output Mon Jul  2 14:27:28 2012
> @@ -0,0 +1 @@
> +2d81d0faefc2105d1435216b16a7b8c7
> 
> Propchange: test-suite/trunk/SingleSource/Benchmarks/Polybench/linear-algebra/solvers/ludcmp/ludcmp.reference_output
> ------------------------------------------------------------------------------
>    svn:executable = *
> 
> Added: test-suite/trunk/SingleSource/Benchmarks/Polybench/medley/Makefile
> URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/Benchmarks/Polybench/medley/Makefile?rev=159553&view=auto
> ==============================================================================
> --- test-suite/trunk/SingleSource/Benchmarks/Polybench/medley/Makefile (added)
> +++ test-suite/trunk/SingleSource/Benchmarks/Polybench/medley/Makefile Mon Jul  2 14:27:28 2012
> @@ -0,0 +1,9 @@
> +# SingleSource/Polybench/medley
> +# Makefile:  Build all subdirectories automatically
> +
> +LEVEL = ../../../..
> +PARALLEL_DIRS = floyd-warshall reg_detect
> +
> +include $(LEVEL)/Makefile.config
> +include $(LEVEL)/Makefile.programs
> +
> 
> Propchange: test-suite/trunk/SingleSource/Benchmarks/Polybench/medley/Makefile
> ------------------------------------------------------------------------------
>    svn:executable = *
> 
> Added: test-suite/trunk/SingleSource/Benchmarks/Polybench/medley/floyd-warshall/Makefile
> URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/Benchmarks/Polybench/medley/floyd-warshall/Makefile?rev=159553&view=auto
> ==============================================================================
> --- test-suite/trunk/SingleSource/Benchmarks/Polybench/medley/floyd-warshall/Makefile (added)
> +++ test-suite/trunk/SingleSource/Benchmarks/Polybench/medley/floyd-warshall/Makefile Mon Jul  2 14:27:28 2012
> @@ -0,0 +1,10 @@
> +LEVEL = ../../../../..
> +
> +POLYBENCH_UTILS = SingleSource/Benchmarks/Polybench/utilities 
> +PROG          = floyd-warshall
> +CFLAGS        += -I $(PROJ_SRC_ROOT)/$(POLYBENCH_UTILS) -DPOLYBENCH_DUMP_ARRAYS
> +
> +HASH_PROGRAM_OUTPUT = 1
> +
> +include $(LEVEL)/SingleSource/Makefile.singlesrc
> +
> 
> Propchange: test-suite/trunk/SingleSource/Benchmarks/Polybench/medley/floyd-warshall/Makefile
> ------------------------------------------------------------------------------
>    svn:executable = *
> 
> Added: test-suite/trunk/SingleSource/Benchmarks/Polybench/medley/floyd-warshall/floyd-warshall.c
> URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/Benchmarks/Polybench/medley/floyd-warshall/floyd-warshall.c?rev=159553&view=auto
> ==============================================================================
> --- test-suite/trunk/SingleSource/Benchmarks/Polybench/medley/floyd-warshall/floyd-warshall.c (added)
> +++ test-suite/trunk/SingleSource/Benchmarks/Polybench/medley/floyd-warshall/floyd-warshall.c Mon Jul  2 14:27:28 2012
> @@ -0,0 +1,103 @@
> +/**
> + * floyd-warshall.c: This file is part of the PolyBench/C 3.2 test suite.
> + *
> + *
> + * Contact: Louis-Noel Pouchet <pouchet at cse.ohio-state.edu>
> + * Web address: http://polybench.sourceforge.net
> + */
> +#include <stdio.h>
> +#include <unistd.h>
> +#include <string.h>
> +#include <math.h>
> +
> +/* Include polybench common header. */
> +#include <polybench.h>
> +
> +/* Include benchmark-specific header. */
> +/* Default data type is double, default size is 1024. */
> +#include "floyd-warshall.h"
> +
> +
> +/* Array initialization. */
> +static
> +void init_array (int n,
> +		 DATA_TYPE POLYBENCH_2D(path,N,N,n,n))
> +{
> +  int i, j;
> +
> +  for (i = 0; i < n; i++)
> +    for (j = 0; j < n; j++)
> +      path[i][j] = ((DATA_TYPE) (i+1)*(j+1)) / n;
> +}
> +
> +
> +/* DCE code. Must scan the entire live-out data.
> +   Can be used also to check the correctness of the output. */
> +static
> +void print_array(int n,
> +		 DATA_TYPE POLYBENCH_2D(path,N,N,n,n))
> +
> +{
> +  int i, j;
> +
> +  for (i = 0; i < n; i++)
> +    for (j = 0; j < n; j++) {
> +      fprintf (stderr, DATA_PRINTF_MODIFIER, path[i][j]);
> +      if ((i * n + j) % 20 == 0) fprintf (stderr, "\n");
> +    }
> +  fprintf (stderr, "\n");
> +}
> +
> +
> +/* Main computational kernel. The whole function will be timed,
> +   including the call and return. */
> +static
> +void kernel_floyd_warshall(int n,
> +			   DATA_TYPE POLYBENCH_2D(path,N,N,n,n))
> +{
> +  int i, j, k;
> +
> +#pragma scop
> +  for (k = 0; k < _PB_N; k++)
> +    {
> +      for(i = 0; i < _PB_N; i++)
> +	for (j = 0; j < _PB_N; j++)
> +	  path[i][j] = path[i][j] < path[i][k] + path[k][j] ?
> +	    path[i][j] : path[i][k] + path[k][j];
> +    }
> +#pragma endscop
> +
> +}
> +
> +
> +int main(int argc, char** argv)
> +{
> +  /* Retrieve problem size. */
> +  int n = N;
> +
> +  /* Variable declaration/allocation. */
> +  POLYBENCH_2D_ARRAY_DECL(path, DATA_TYPE, N, N, n, n);
> +
> +
> +  /* Initialize array(s). */
> +  init_array (n, POLYBENCH_ARRAY(path));
> +
> +  /* Start timer. */
> +  polybench_start_instruments;
> +
> +  /* Run kernel. */
> +  kernel_floyd_warshall (n, POLYBENCH_ARRAY(path));
> +
> +  /* Stop and print timer. */
> +  polybench_stop_instruments;
> +  polybench_print_instruments;
> +
> +  /* Prevent dead-code elimination. All live-out data must be printed
> +     by the function call in argument. */
> +  polybench_prevent_dce(print_array(n, POLYBENCH_ARRAY(path)));
> +
> +  /* Be clean. */
> +  POLYBENCH_FREE_ARRAY(path);
> +
> +  return 0;
> +}
> 
> Propchange: test-suite/trunk/SingleSource/Benchmarks/Polybench/medley/floyd-warshall/floyd-warshall.c
> ------------------------------------------------------------------------------
>    svn:executable = *
> 
> Added: test-suite/trunk/SingleSource/Benchmarks/Polybench/medley/floyd-warshall/floyd-warshall.h
> URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/Benchmarks/Polybench/medley/floyd-warshall/floyd-warshall.h?rev=159553&view=auto
> ==============================================================================
> --- test-suite/trunk/SingleSource/Benchmarks/Polybench/medley/floyd-warshall/floyd-warshall.h (added)
> +++ test-suite/trunk/SingleSource/Benchmarks/Polybench/medley/floyd-warshall/floyd-warshall.h Mon Jul  2 14:27:28 2012
> @@ -0,0 +1,48 @@
> +/**
> + * floyd-warshall.h: This file is part of the PolyBench/C 3.2 test suite.
> + *
> + *
> + * Contact: Louis-Noel Pouchet <pouchet at cse.ohio-state.edu>
> + * Web address: http://polybench.sourceforge.net
> + */
> +#ifndef FLOYD_WARSHALL_H
> +# define FLOYD_WARSHALL_H
> +
> +/* Default to STANDARD_DATASET. */
> +# if !defined(MINI_DATASET) && !defined(SMALL_DATASET) && !defined(LARGE_DATASET) && !defined(EXTRALARGE_DATASET)
> +#  define STANDARD_DATASET
> +# endif
> +
> +/* Do not define anything if the user manually defines the size. */
> +# ifndef N
> +/* Define the possible dataset sizes. */
> +#  ifdef MINI_DATASET
> +#   define N 32
> +#  endif
> +
> +#  ifdef SMALL_DATASET
> +#   define N 128
> +#  endif
> +
> +#  ifdef STANDARD_DATASET /* Default if unspecified. */
> +#   define N 1024
> +#  endif
> +
> +#  ifdef LARGE_DATASET
> +#   define N 2000
> +#  endif
> +
> +#  ifdef EXTRALARGE_DATASET
> +#   define N 4000
> +#  endif
> +# endif /* !N */
> +
> +# define _PB_N POLYBENCH_LOOP_BOUND(N,n)
> +
> +# ifndef DATA_TYPE
> +#  define DATA_TYPE double
> +#  define DATA_PRINTF_MODIFIER "%0.2lf "
> +# endif
> +
> +
> +#endif /* !FLOYD_WARSHALL */
> 
> Propchange: test-suite/trunk/SingleSource/Benchmarks/Polybench/medley/floyd-warshall/floyd-warshall.h
> ------------------------------------------------------------------------------
>    svn:executable = *
> 
> Added: test-suite/trunk/SingleSource/Benchmarks/Polybench/medley/floyd-warshall/floyd-warshall.reference_output
> URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/Benchmarks/Polybench/medley/floyd-warshall/floyd-warshall.reference_output?rev=159553&view=auto
> ==============================================================================
> --- test-suite/trunk/SingleSource/Benchmarks/Polybench/medley/floyd-warshall/floyd-warshall.reference_output (added)
> +++ test-suite/trunk/SingleSource/Benchmarks/Polybench/medley/floyd-warshall/floyd-warshall.reference_output Mon Jul  2 14:27:28 2012
> @@ -0,0 +1 @@
> +1e06b1215b8234ad7dc8012e6c9ad7ab
> 
> Propchange: test-suite/trunk/SingleSource/Benchmarks/Polybench/medley/floyd-warshall/floyd-warshall.reference_output
> ------------------------------------------------------------------------------
>    svn:executable = *
> 
> Added: test-suite/trunk/SingleSource/Benchmarks/Polybench/medley/reg_detect/Makefile
> URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/Benchmarks/Polybench/medley/reg_detect/Makefile?rev=159553&view=auto
> ==============================================================================
> --- test-suite/trunk/SingleSource/Benchmarks/Polybench/medley/reg_detect/Makefile (added)
> +++ test-suite/trunk/SingleSource/Benchmarks/Polybench/medley/reg_detect/Makefile Mon Jul  2 14:27:28 2012
> @@ -0,0 +1,10 @@
> +LEVEL = ../../../../..
> +
> +POLYBENCH_UTILS = SingleSource/Benchmarks/Polybench/utilities 
> +PROG          = reg_detect
> +CFLAGS        += -I $(PROJ_SRC_ROOT)/$(POLYBENCH_UTILS) -DPOLYBENCH_DUMP_ARRAYS
> +
> +HASH_PROGRAM_OUTPUT = 1
> +
> +include $(LEVEL)/SingleSource/Makefile.singlesrc
> +
> 
> Propchange: test-suite/trunk/SingleSource/Benchmarks/Polybench/medley/reg_detect/Makefile
> ------------------------------------------------------------------------------
>    svn:executable = *
> 
> Added: test-suite/trunk/SingleSource/Benchmarks/Polybench/medley/reg_detect/reg_detect.c
> URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/Benchmarks/Polybench/medley/reg_detect/reg_detect.c?rev=159553&view=auto
> ==============================================================================
> --- test-suite/trunk/SingleSource/Benchmarks/Polybench/medley/reg_detect/reg_detect.c (added)
> +++ test-suite/trunk/SingleSource/Benchmarks/Polybench/medley/reg_detect/reg_detect.c Mon Jul  2 14:27:28 2012
> @@ -0,0 +1,147 @@
> +/**
> + * reg_detect.c: This file is part of the PolyBench/C 3.2 test suite.
> + *
> + *
> + * Contact: Louis-Noel Pouchet <pouchet at cse.ohio-state.edu>
> + * Web address: http://polybench.sourceforge.net
> + */
> +#include <stdio.h>
> +#include <unistd.h>
> +#include <string.h>
> +#include <math.h>
> +
> +/* Include polybench common header. */
> +#include <polybench.h>
> +
> +/* Include benchmark-specific header. */
> +/* Default data type is int, default size is 50. */
> +#include "reg_detect.h"
> +
> +
> +/* Array initialization. */
> +static
> +void init_array(int maxgrid,
> +		DATA_TYPE POLYBENCH_2D(sum_tang,MAXGRID,MAXGRID,maxgrid,maxgrid),
> +		DATA_TYPE POLYBENCH_2D(mean,MAXGRID,MAXGRID,maxgrid,maxgrid),
> +		DATA_TYPE POLYBENCH_2D(path,MAXGRID,MAXGRID,maxgrid,maxgrid))
> +{
> +  int i, j;
> +
> +  for (i = 0; i < maxgrid; i++)
> +    for (j = 0; j < maxgrid; j++) {
> +      sum_tang[i][j] = (DATA_TYPE)((i+1)*(j+1));
> +      mean[i][j] = ((DATA_TYPE) i-j) / maxgrid;
> +      path[i][j] = ((DATA_TYPE) i*(j-1)) / maxgrid;
> +    }
> +}
> +
> +
> +/* DCE code. Must scan the entire live-out data.
> +   Can be used also to check the correctness of the output. */
> +static
> +void print_array(int maxgrid,
> +		 DATA_TYPE POLYBENCH_2D(path,MAXGRID,MAXGRID,maxgrid,maxgrid))
> +{
> +  int i, j;
> +
> +  for (i = 0; i < maxgrid; i++)
> +    for (j = 0; j < maxgrid; j++) {
> +      fprintf (stderr, DATA_PRINTF_MODIFIER, path[i][j]);
> +      if ((i * maxgrid + j) % 20 == 0) fprintf (stderr, "\n");
> +    }
> +  fprintf (stderr, "\n");
> +}
> +
> +
> +/* Main computational kernel. The whole function will be timed,
> +   including the call and return. */
> +/* Source (modified): http://www.cs.uic.edu/~iluican/reg_detect.c */
> +static
> +void kernel_reg_detect(int niter, int maxgrid, int length,
> +		       DATA_TYPE POLYBENCH_2D(sum_tang,MAXGRID,MAXGRID,maxgrid,maxgrid),
> +		       DATA_TYPE POLYBENCH_2D(mean,MAXGRID,MAXGRID,maxgrid,maxgrid),
> +		       DATA_TYPE POLYBENCH_2D(path,MAXGRID,MAXGRID,maxgrid,maxgrid),
> +		       DATA_TYPE POLYBENCH_3D(diff,MAXGRID,MAXGRID,LENGTH,maxgrid,maxgrid,length),
> +		       DATA_TYPE POLYBENCH_3D(sum_diff,MAXGRID,MAXGRID,LENGTH,maxgrid,maxgrid,length))
> +{
> +  int t, i, j, cnt;
> +
> +#pragma scop
> +  for (t = 0; t < _PB_NITER; t++)
> +    {
> +      for (j = 0; j <= _PB_MAXGRID - 1; j++)
> +	for (i = j; i <= _PB_MAXGRID - 1; i++)
> +	  for (cnt = 0; cnt <= _PB_LENGTH - 1; cnt++)
> +	    diff[j][i][cnt] = sum_tang[j][i];
> +
> +      for (j = 0; j <= _PB_MAXGRID - 1; j++)
> +        {
> +	  for (i = j; i <= _PB_MAXGRID - 1; i++)
> +            {
> +	      sum_diff[j][i][0] = diff[j][i][0];
> +	      for (cnt = 1; cnt <= _PB_LENGTH - 1; cnt++)
> +		sum_diff[j][i][cnt] = sum_diff[j][i][cnt - 1] + diff[j][i][cnt];
> +	      mean[j][i] = sum_diff[j][i][_PB_LENGTH - 1];
> +            }
> +        }
> +
> +      for (i = 0; i <= _PB_MAXGRID - 1; i++)
> +	path[0][i] = mean[0][i];
> +
> +      for (j = 1; j <= _PB_MAXGRID - 1; j++)
> +	for (i = j; i <= _PB_MAXGRID - 1; i++)
> +	  path[j][i] = path[j - 1][i - 1] + mean[j][i];
> +    }
> +#pragma endscop
> +
> +}
> +
> +
> +int main(int argc, char** argv)
> +{
> +  /* Retrieve problem size. */
> +  int niter = NITER;
> +  int maxgrid = MAXGRID;
> +  int length = LENGTH;
> +
> +  /* Variable declaration/allocation. */
> +  POLYBENCH_2D_ARRAY_DECL(sum_tang, DATA_TYPE, MAXGRID, MAXGRID, maxgrid, maxgrid);
> +  POLYBENCH_2D_ARRAY_DECL(mean, DATA_TYPE, MAXGRID, MAXGRID, maxgrid, maxgrid);
> +  POLYBENCH_2D_ARRAY_DECL(path, DATA_TYPE, MAXGRID, MAXGRID, maxgrid, maxgrid);
> +  POLYBENCH_3D_ARRAY_DECL(diff, DATA_TYPE, MAXGRID, MAXGRID, LENGTH, maxgrid, maxgrid, length);
> +  POLYBENCH_3D_ARRAY_DECL(sum_diff, DATA_TYPE, MAXGRID, MAXGRID, LENGTH, maxgrid, maxgrid, length);
> +
> +  /* Initialize array(s). */
> +  init_array (maxgrid,
> +	      POLYBENCH_ARRAY(sum_tang),
> +	      POLYBENCH_ARRAY(mean),
> +	      POLYBENCH_ARRAY(path));
> +
> +  /* Start timer. */
> +  polybench_start_instruments;
> +
> +  /* Run kernel. */
> +  kernel_reg_detect (niter, maxgrid, length,
> +		     POLYBENCH_ARRAY(sum_tang),
> +		     POLYBENCH_ARRAY(mean),
> +		     POLYBENCH_ARRAY(path),
> +		     POLYBENCH_ARRAY(diff),
> +		     POLYBENCH_ARRAY(sum_diff));
> +
> +  /* Stop and print timer. */
> +  polybench_stop_instruments;
> +  polybench_print_instruments;
> +
> +  /* Prevent dead-code elimination. All live-out data must be printed
> +     by the function call in argument. */
> +  polybench_prevent_dce(print_array(maxgrid, POLYBENCH_ARRAY(path)));
> +
> +  /* Be clean. */
> +  POLYBENCH_FREE_ARRAY(sum_tang);
> +  POLYBENCH_FREE_ARRAY(mean);
> +  POLYBENCH_FREE_ARRAY(path);
> +  POLYBENCH_FREE_ARRAY(diff);
> +  POLYBENCH_FREE_ARRAY(sum_diff);
> +
> +  return 0;
> +}
> 
> Propchange: test-suite/trunk/SingleSource/Benchmarks/Polybench/medley/reg_detect/reg_detect.c
> ------------------------------------------------------------------------------
>    svn:executable = *
> 
> Added: test-suite/trunk/SingleSource/Benchmarks/Polybench/medley/reg_detect/reg_detect.h
> URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/Benchmarks/Polybench/medley/reg_detect/reg_detect.h?rev=159553&view=auto
> ==============================================================================
> --- test-suite/trunk/SingleSource/Benchmarks/Polybench/medley/reg_detect/reg_detect.h (added)
> +++ test-suite/trunk/SingleSource/Benchmarks/Polybench/medley/reg_detect/reg_detect.h Mon Jul  2 14:27:28 2012
> @@ -0,0 +1,60 @@
> +/**
> + * reg_detect.h: This file is part of the PolyBench/C 3.2 test suite.
> + *
> + *
> + * Contact: Louis-Noel Pouchet <pouchet at cse.ohio-state.edu>
> + * Web address: http://polybench.sourceforge.net
> + */
> +#ifndef REG_DETECT_H
> +# define REG_DETECT_H
> +
> +/* Default to STANDARD_DATASET. */
> +# if !defined(MINI_DATASET) && !defined(SMALL_DATASET) && !defined(LARGE_DATASET) && !defined(EXTRALARGE_DATASET)
> +#  define STANDARD_DATASET
> +# endif
> +
> +/* Do not define anything if the user manually defines the size. */
> +# if !defined(NITER) && !defined(LENGTH) && !defined(MAXGRID)
> +/* Define the possible dataset sizes. */
> +#  ifdef MINI_DATASET
> +#   define NITER 10
> +#   define LENGTH 32
> +#   define MAXGRID 2
> +#  endif
> +
> +#  ifdef SMALL_DATASET
> +#   define NITER 100
> +#   define LENGTH 50
> +#   define MAXGRID 6
> +#  endif
> +
> +#  ifdef STANDARD_DATASET /* Default if unspecified. */
> +#   define NITER 10000
> +#   define LENGTH 64
> +#   define MAXGRID 6
> +#  endif
> +
> +#  ifdef LARGE_DATASET
> +#   define NITER 1000
> +#   define LENGTH 500
> +#   define MAXGRID 12
> +#  endif
> +
> +#  ifdef EXTRALARGE_DATASET
> +#   define NITER 10000
> +#   define LENGTH 500
> +#   define MAXGRID 12
> +#  endif
> +# endif /* !N */
> +
> +# define _PB_NITER POLYBENCH_LOOP_BOUND(NITER,niter)
> +# define _PB_LENGTH POLYBENCH_LOOP_BOUND(LENGTH,length)
> +# define _PB_MAXGRID POLYBENCH_LOOP_BOUND(MAXGRID,maxgrid)
> +
> +# ifndef DATA_TYPE
> +#  define DATA_TYPE int
> +#  define DATA_PRINTF_MODIFIER "%d "
> +# endif
> +
> +
> +#endif /* !REG_DETECT */
> 
> Propchange: test-suite/trunk/SingleSource/Benchmarks/Polybench/medley/reg_detect/reg_detect.h
> ------------------------------------------------------------------------------
>    svn:executable = *
> 
> Added: test-suite/trunk/SingleSource/Benchmarks/Polybench/medley/reg_detect/reg_detect.reference_output
> URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/Benchmarks/Polybench/medley/reg_detect/reg_detect.reference_output?rev=159553&view=auto
> ==============================================================================
> --- test-suite/trunk/SingleSource/Benchmarks/Polybench/medley/reg_detect/reg_detect.reference_output (added)
> +++ test-suite/trunk/SingleSource/Benchmarks/Polybench/medley/reg_detect/reg_detect.reference_output Mon Jul  2 14:27:28 2012
> @@ -0,0 +1 @@
> +eef6cdaf9c1cdebe72d8f267816fad2d
> 
> Propchange: test-suite/trunk/SingleSource/Benchmarks/Polybench/medley/reg_detect/reg_detect.reference_output
> ------------------------------------------------------------------------------
>    svn:executable = *
> 
> Added: test-suite/trunk/SingleSource/Benchmarks/Polybench/stencils/Makefile
> URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/Benchmarks/Polybench/stencils/Makefile?rev=159553&view=auto
> ==============================================================================
> --- test-suite/trunk/SingleSource/Benchmarks/Polybench/stencils/Makefile (added)
> +++ test-suite/trunk/SingleSource/Benchmarks/Polybench/stencils/Makefile Mon Jul  2 14:27:28 2012
> @@ -0,0 +1,10 @@
> +# SingleSource/Polybench/stencils
> +# Makefile:  Build all subdirectories automatically
> +
> +LEVEL = ../../../..
> +PARALLEL_DIRS = adi fdtd-2d fdtd-apml jacobi-1d-imper \
> +		jacobi-2d-imper seidel-2d
> +
> +include $(LEVEL)/Makefile.config
> +include $(LEVEL)/Makefile.programs
> +
> 
> Propchange: test-suite/trunk/SingleSource/Benchmarks/Polybench/stencils/Makefile
> ------------------------------------------------------------------------------
>    svn:executable = *
> 
> Added: test-suite/trunk/SingleSource/Benchmarks/Polybench/stencils/adi/Makefile
> URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/Benchmarks/Polybench/stencils/adi/Makefile?rev=159553&view=auto
> ==============================================================================
> --- test-suite/trunk/SingleSource/Benchmarks/Polybench/stencils/adi/Makefile (added)
> +++ test-suite/trunk/SingleSource/Benchmarks/Polybench/stencils/adi/Makefile Mon Jul  2 14:27:28 2012
> @@ -0,0 +1,10 @@
> +LEVEL = ../../../../..
> +
> +POLYBENCH_UTILS = SingleSource/Benchmarks/Polybench/utilities 
> +PROG          = adi
> +CFLAGS        += -I $(PROJ_SRC_ROOT)/$(POLYBENCH_UTILS) -DPOLYBENCH_DUMP_ARRAYS
> +
> +HASH_PROGRAM_OUTPUT = 1
> +
> +include $(LEVEL)/SingleSource/Makefile.singlesrc
> +
> 
> Propchange: test-suite/trunk/SingleSource/Benchmarks/Polybench/stencils/adi/Makefile
> ------------------------------------------------------------------------------
>    svn:executable = *
> 
> Added: test-suite/trunk/SingleSource/Benchmarks/Polybench/stencils/adi/adi.c
> URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/Benchmarks/Polybench/stencils/adi/adi.c?rev=159553&view=auto
> ==============================================================================
> --- test-suite/trunk/SingleSource/Benchmarks/Polybench/stencils/adi/adi.c (added)
> +++ test-suite/trunk/SingleSource/Benchmarks/Polybench/stencils/adi/adi.c Mon Jul  2 14:27:28 2012
> @@ -0,0 +1,140 @@
> +/**
> + * adi.c: This file is part of the PolyBench/C 3.2 test suite.
> + *
> + *
> + * Contact: Louis-Noel Pouchet <pouchet at cse.ohio-state.edu>
> + * Web address: http://polybench.sourceforge.net
> + */
> +#include <stdio.h>
> +#include <unistd.h>
> +#include <string.h>
> +#include <math.h>
> +
> +/* Include polybench common header. */
> +#include <polybench.h>
> +
> +/* Include benchmark-specific header. */
> +/* Default data type is double, default size is 10x1024x1024. */
> +#include "adi.h"
> +
> +
> +/* Array initialization. */
> +static
> +void init_array (int n,
> +		 DATA_TYPE POLYBENCH_2D(X,N,N,n,n),
> +		 DATA_TYPE POLYBENCH_2D(A,N,N,n,n),
> +		 DATA_TYPE POLYBENCH_2D(B,N,N,n,n))
> +{
> +  int i, j;
> +
> +  for (i = 0; i < n; i++)
> +    for (j = 0; j < n; j++)
> +      {
> +	X[i][j] = ((DATA_TYPE) i*(j+1) + 1) / n;
> +	A[i][j] = ((DATA_TYPE) i*(j+2) + 2) / n;
> +	B[i][j] = ((DATA_TYPE) i*(j+3) + 3) / n;
> +      }
> +}
> +
> +
> +/* DCE code. Must scan the entire live-out data.
> +   Can be used also to check the correctness of the output. */
> +static
> +void print_array(int n,
> +		 DATA_TYPE POLYBENCH_2D(X,N,N,n,n))
> +
> +{
> +  int i, j;
> +
> +  for (i = 0; i < n; i++)
> +    for (j = 0; j < n; j++) {
> +      fprintf(stderr, DATA_PRINTF_MODIFIER, X[i][j]);
> +      if ((i * N + j) % 20 == 0) fprintf(stderr, "\n");
> +    }
> +  fprintf(stderr, "\n");
> +}
> +
> +
> +/* Main computational kernel. The whole function will be timed,
> +   including the call and return. */
> +static
> +void kernel_adi(int tsteps,
> +		int n,
> +		DATA_TYPE POLYBENCH_2D(X,N,N,n,n),
> +		DATA_TYPE POLYBENCH_2D(A,N,N,n,n),
> +		DATA_TYPE POLYBENCH_2D(B,N,N,n,n))
> +{
> +  int t, i1, i2;
> +
> +#pragma scop
> +  for (t = 0; t < _PB_TSTEPS; t++)
> +    {
> +      for (i1 = 0; i1 < _PB_N; i1++)
> +	for (i2 = 1; i2 < _PB_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 < _PB_N; i1++)
> +	X[i1][_PB_N-1] = X[i1][_PB_N-1] / B[i1][_PB_N-1];
> +
> +      for (i1 = 0; i1 < _PB_N; i1++)
> +	for (i2 = 0; i2 < _PB_N-2; i2++)
> +	  X[i1][_PB_N-i2-2] = (X[i1][_PB_N-2-i2] - X[i1][_PB_N-2-i2-1] * A[i1][_PB_N-i2-3]) / B[i1][_PB_N-3-i2];
> +
> +      for (i1 = 1; i1 < _PB_N; i1++)
> +	for (i2 = 0; i2 < _PB_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 < _PB_N; i2++)
> +	X[_PB_N-1][i2] = X[_PB_N-1][i2] / B[_PB_N-1][i2];
> +
> +      for (i1 = 0; i1 < _PB_N-2; i1++)
> +	for (i2 = 0; i2 < _PB_N; i2++)
> +	  X[_PB_N-2-i1][i2] = (X[_PB_N-2-i1][i2] - X[_PB_N-i1-3][i2] * A[_PB_N-3-i1][i2]) / B[_PB_N-2-i1][i2];
> +    }
> +#pragma endscop
> +
> +}
> +
> +
> +int main(int argc, char** argv)
> +{
> +  /* Retrieve problem size. */
> +  int n = N;
> +  int tsteps = TSTEPS;
> +
> +  /* Variable declaration/allocation. */
> +  POLYBENCH_2D_ARRAY_DECL(X, DATA_TYPE, N, N, n, n);
> +  POLYBENCH_2D_ARRAY_DECL(A, DATA_TYPE, N, N, n, n);
> +  POLYBENCH_2D_ARRAY_DECL(B, DATA_TYPE, N, N, n, n);
> +
> +
> +  /* Initialize array(s). */
> +  init_array (n, POLYBENCH_ARRAY(X), POLYBENCH_ARRAY(A), POLYBENCH_ARRAY(B));
> +
> +  /* Start timer. */
> +  polybench_start_instruments;
> +
> +  /* Run kernel. */
> +  kernel_adi (tsteps, n, POLYBENCH_ARRAY(X),
> +	      POLYBENCH_ARRAY(A), POLYBENCH_ARRAY(B));
> +
> +  /* Stop and print timer. */
> +  polybench_stop_instruments;
> +  polybench_print_instruments;
> +
> +  /* Prevent dead-code elimination. All live-out data must be printed
> +     by the function call in argument. */
> +  polybench_prevent_dce(print_array(n, POLYBENCH_ARRAY(X)));
> +
> +  /* Be clean. */
> +  POLYBENCH_FREE_ARRAY(X);
> +  POLYBENCH_FREE_ARRAY(A);
> +  POLYBENCH_FREE_ARRAY(B);
> +
> +  return 0;
> +}
> 
> Propchange: test-suite/trunk/SingleSource/Benchmarks/Polybench/stencils/adi/adi.c
> ------------------------------------------------------------------------------
>    svn:executable = *
> 
> Added: test-suite/trunk/SingleSource/Benchmarks/Polybench/stencils/adi/adi.h
> URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/Benchmarks/Polybench/stencils/adi/adi.h?rev=159553&view=auto
> ==============================================================================
> --- test-suite/trunk/SingleSource/Benchmarks/Polybench/stencils/adi/adi.h (added)
> +++ test-suite/trunk/SingleSource/Benchmarks/Polybench/stencils/adi/adi.h Mon Jul  2 14:27:28 2012
> @@ -0,0 +1,54 @@
> +/**
> + * adi.h: This file is part of the PolyBench/C 3.2 test suite.
> + *
> + *
> + * Contact: Louis-Noel Pouchet <pouchet at cse.ohio-state.edu>
> + * Web address: http://polybench.sourceforge.net
> + */
> +#ifndef ADI_H
> +# define ADI_H
> +
> +/* Default to STANDARD_DATASET. */
> +# if !defined(MINI_DATASET) && !defined(SMALL_DATASET) && !defined(LARGE_DATASET) && !defined(EXTRALARGE_DATASET)
> +#  define STANDARD_DATASET
> +# endif
> +
> +/* Do not define anything if the user manually defines the size. */
> +# if !defined(TSTEPS) && ! defined(N)
> +/* Define the possible dataset sizes. */
> +#  ifdef MINI_DATASET
> +#   define TSTEPS 2
> +#   define N 32
> +#  endif
> +
> +#  ifdef SMALL_DATASET
> +#   define TSTEPS 10
> +#   define N 500
> +#  endif
> +
> +#  ifdef STANDARD_DATASET /* Default if unspecified. */
> +#   define TSTEPS 50
> +#   define N 1024
> +#  endif
> +
> +#  ifdef LARGE_DATASET
> +#   define TSTEPS 50
> +#   define N 2000
> +#  endif
> +
> +#  ifdef EXTRALARGE_DATASET
> +#   define TSTEPS 100
> +#   define N 4000
> +#  endif
> +# endif /* !N */
> +
> +# define _PB_TSTEPS POLYBENCH_LOOP_BOUND(TSTEPS,tsteps)
> +# define _PB_N POLYBENCH_LOOP_BOUND(N,n)
> +
> +# ifndef DATA_TYPE
> +#  define DATA_TYPE double
> +#  define DATA_PRINTF_MODIFIER "%0.2lf "
> +# endif
> +
> +
> +#endif /* !ADI */
> 
> Propchange: test-suite/trunk/SingleSource/Benchmarks/Polybench/stencils/adi/adi.h
> ------------------------------------------------------------------------------
>    svn:executable = *
> 
> Added: test-suite/trunk/SingleSource/Benchmarks/Polybench/stencils/adi/adi.reference_output
> URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/Benchmarks/Polybench/stencils/adi/adi.reference_output?rev=159553&view=auto
> ==============================================================================
> --- test-suite/trunk/SingleSource/Benchmarks/Polybench/stencils/adi/adi.reference_output (added)
> +++ test-suite/trunk/SingleSource/Benchmarks/Polybench/stencils/adi/adi.reference_output Mon Jul  2 14:27:28 2012
> @@ -0,0 +1 @@
> +af131f7f24a4d9666b459cb425f6c6d2
> 
> Propchange: test-suite/trunk/SingleSource/Benchmarks/Polybench/stencils/adi/adi.reference_output
> ------------------------------------------------------------------------------
>    svn:executable = *
> 
> Added: test-suite/trunk/SingleSource/Benchmarks/Polybench/stencils/fdtd-2d/Makefile
> URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/Benchmarks/Polybench/stencils/fdtd-2d/Makefile?rev=159553&view=auto
> ==============================================================================
> --- test-suite/trunk/SingleSource/Benchmarks/Polybench/stencils/fdtd-2d/Makefile (added)
> +++ test-suite/trunk/SingleSource/Benchmarks/Polybench/stencils/fdtd-2d/Makefile Mon Jul  2 14:27:28 2012
> @@ -0,0 +1,10 @@
> +LEVEL = ../../../../..
> +
> +POLYBENCH_UTILS = SingleSource/Benchmarks/Polybench/utilities 
> +PROG          = fdtd-2d
> +CFLAGS        += -I $(PROJ_SRC_ROOT)/$(POLYBENCH_UTILS) -DPOLYBENCH_DUMP_ARRAYS
> +
> +HASH_PROGRAM_OUTPUT = 1
> +
> +include $(LEVEL)/SingleSource/Makefile.singlesrc
> +
> 
> Propchange: test-suite/trunk/SingleSource/Benchmarks/Polybench/stencils/fdtd-2d/Makefile
> ------------------------------------------------------------------------------
>    svn:executable = *
> 
> Added: test-suite/trunk/SingleSource/Benchmarks/Polybench/stencils/fdtd-2d/fdtd-2d.c
> URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/Benchmarks/Polybench/stencils/fdtd-2d/fdtd-2d.c?rev=159553&view=auto
> ==============================================================================
> --- test-suite/trunk/SingleSource/Benchmarks/Polybench/stencils/fdtd-2d/fdtd-2d.c (added)
> +++ test-suite/trunk/SingleSource/Benchmarks/Polybench/stencils/fdtd-2d/fdtd-2d.c Mon Jul  2 14:27:28 2012
> @@ -0,0 +1,150 @@
> +/**
> + * fdtd-2d.c: This file is part of the PolyBench/C 3.2 test suite.
> + *
> + *
> + * Contact: Louis-Noel Pouchet <pouchet at cse.ohio-state.edu>
> + * Web address: http://polybench.sourceforge.net
> + */
> +#include <stdio.h>
> +#include <unistd.h>
> +#include <string.h>
> +#include <math.h>
> +
> +/* Include polybench common header. */
> +#include <polybench.h>
> +
> +/* Include benchmark-specific header. */
> +/* Default data type is double, default size is 50x1000x1000. */
> +#include "fdtd-2d.h"
> +
> +
> +/* Array initialization. */
> +static
> +void init_array (int tmax,
> +		 int nx,
> +		 int ny,
> +		 DATA_TYPE POLYBENCH_2D(ex,NX,NY,nx,ny),
> +		 DATA_TYPE POLYBENCH_2D(ey,NX,NY,nx,ny),
> +		 DATA_TYPE POLYBENCH_2D(hz,NX,NY,nx,ny),
> +		 DATA_TYPE POLYBENCH_1D(_fict_,TMAX,tmax))
> +{
> +  int i, j;
> +
> +  for (i = 0; i < tmax; i++)
> +    _fict_[i] = (DATA_TYPE) i;
> +  for (i = 0; i < nx; i++)
> +    for (j = 0; j < ny; j++)
> +      {
> +	ex[i][j] = ((DATA_TYPE) i*(j+1)) / nx;
> +	ey[i][j] = ((DATA_TYPE) i*(j+2)) / ny;
> +	hz[i][j] = ((DATA_TYPE) i*(j+3)) / nx;
> +      }
> +}
> +
> +
> +/* DCE code. Must scan the entire live-out data.
> +   Can be used also to check the correctness of the output. */
> +static
> +void print_array(int nx,
> +		 int ny,
> +		 DATA_TYPE POLYBENCH_2D(ex,NX,NY,nx,ny),
> +		 DATA_TYPE POLYBENCH_2D(ey,NX,NY,nx,ny),
> +		 DATA_TYPE POLYBENCH_2D(hz,NX,NY,nx,ny))
> +{
> +  int i, j;
> +
> +  for (i = 0; i < nx; i++)
> +    for (j = 0; j < ny; j++) {
> +      fprintf(stderr, DATA_PRINTF_MODIFIER, ex[i][j]);
> +      fprintf(stderr, DATA_PRINTF_MODIFIER, ey[i][j]);
> +      fprintf(stderr, DATA_PRINTF_MODIFIER, hz[i][j]);
> +      if ((i * nx + j) % 20 == 0) fprintf(stderr, "\n");
> +    }
> +  fprintf(stderr, "\n");
> +}
> +
> +
> +/* Main computational kernel. The whole function will be timed,
> +   including the call and return. */
> +static
> +void kernel_fdtd_2d(int tmax,
> +		    int nx,
> +		    int ny,
> +		    DATA_TYPE POLYBENCH_2D(ex,NX,NY,nx,ny),
> +		    DATA_TYPE POLYBENCH_2D(ey,NX,NY,nx,ny),
> +		    DATA_TYPE POLYBENCH_2D(hz,NX,NY,nx,ny),
> +		    DATA_TYPE POLYBENCH_1D(_fict_,TMAX,tmax))
> +{
> +  int t, i, j;
> +
> +#pragma scop
> +
> +  for(t = 0; t < _PB_TMAX; t++)
> +    {
> +      for (j = 0; j < _PB_NY; j++)
> +	ey[0][j] = _fict_[t];
> +      for (i = 1; i < _PB_NX; i++)
> +	for (j = 0; j < _PB_NY; j++)
> +	  ey[i][j] = ey[i][j] - 0.5*(hz[i][j]-hz[i-1][j]);
> +      for (i = 0; i < _PB_NX; i++)
> +	for (j = 1; j < _PB_NY; j++)
> +	  ex[i][j] = ex[i][j] - 0.5*(hz[i][j]-hz[i][j-1]);
> +      for (i = 0; i < _PB_NX - 1; i++)
> +	for (j = 0; j < _PB_NY - 1; j++)
> +	  hz[i][j] = hz[i][j] - 0.7*  (ex[i][j+1] - ex[i][j] +
> +				       ey[i+1][j] - ey[i][j]);
> +    }
> +
> +#pragma endscop
> +}
> +
> +
> +int main(int argc, char** argv)
> +{
> +  /* Retrieve problem size. */
> +  int tmax = TMAX;
> +  int nx = NX;
> +  int ny = NY;
> +
> +  /* Variable declaration/allocation. */
> +  POLYBENCH_2D_ARRAY_DECL(ex,DATA_TYPE,NX,NY,nx,ny);
> +  POLYBENCH_2D_ARRAY_DECL(ey,DATA_TYPE,NX,NY,nx,ny);
> +  POLYBENCH_2D_ARRAY_DECL(hz,DATA_TYPE,NX,NY,nx,ny);
> +  POLYBENCH_1D_ARRAY_DECL(_fict_,DATA_TYPE,TMAX,tmax);
> +
> +  /* Initialize array(s). */
> +  init_array (tmax, nx, ny,
> +	      POLYBENCH_ARRAY(ex),
> +	      POLYBENCH_ARRAY(ey),
> +	      POLYBENCH_ARRAY(hz),
> +	      POLYBENCH_ARRAY(_fict_));
> +
> +  /* Start timer. */
> +  polybench_start_instruments;
> +
> +  /* Run kernel. */
> +  kernel_fdtd_2d (tmax, nx, ny,
> +		  POLYBENCH_ARRAY(ex),
> +		  POLYBENCH_ARRAY(ey),
> +		  POLYBENCH_ARRAY(hz),
> +		  POLYBENCH_ARRAY(_fict_));
> +
> +
> +  /* Stop and print timer. */
> +  polybench_stop_instruments;
> +  polybench_print_instruments;
> +
> +  /* Prevent dead-code elimination. All live-out data must be printed
> +     by the function call in argument. */
> +  polybench_prevent_dce(print_array(nx, ny, POLYBENCH_ARRAY(ex),
> +				    POLYBENCH_ARRAY(ey),
> +				    POLYBENCH_ARRAY(hz)));
> +
> +  /* Be clean. */
> +  POLYBENCH_FREE_ARRAY(ex);
> +  POLYBENCH_FREE_ARRAY(ey);
> +  POLYBENCH_FREE_ARRAY(hz);
> +  POLYBENCH_FREE_ARRAY(_fict_);
> +
> +  return 0;
> +}
> 
> Propchange: test-suite/trunk/SingleSource/Benchmarks/Polybench/stencils/fdtd-2d/fdtd-2d.c
> ------------------------------------------------------------------------------
>    svn:executable = *
> 
> Added: test-suite/trunk/SingleSource/Benchmarks/Polybench/stencils/fdtd-2d/fdtd-2d.h
> URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/Benchmarks/Polybench/stencils/fdtd-2d/fdtd-2d.h?rev=159553&view=auto
> ==============================================================================
> --- test-suite/trunk/SingleSource/Benchmarks/Polybench/stencils/fdtd-2d/fdtd-2d.h (added)
> +++ test-suite/trunk/SingleSource/Benchmarks/Polybench/stencils/fdtd-2d/fdtd-2d.h Mon Jul  2 14:27:28 2012
> @@ -0,0 +1,60 @@
> +/**
> + * fdtd-2d.h: This file is part of the PolyBench/C 3.2 test suite.
> + *
> + *
> + * Contact: Louis-Noel Pouchet <pouchet at cse.ohio-state.edu>
> + * Web address: http://polybench.sourceforge.net
> + */
> +#ifndef FDTD_2D_H
> +# define FDTD_2D_H
> +
> +/* Default to STANDARD_DATASET. */
> +# if !defined(MINI_DATASET) && !defined(SMALL_DATASET) && !defined(LARGE_DATASET) && !defined(EXTRALARGE_DATASET)
> +#  define STANDARD_DATASET
> +# endif
> +
> +/* Do not define anything if the user manually defines the size. */
> +# if !defined(NX) && ! defined(NY) && !defined(TMAX)
> +/* Define the possible dataset sizes. */
> +#  ifdef MINI_DATASET
> +#   define TMAX 2
> +#   define NX 32
> +#   define NY 32
> +#  endif
> +
> +#  ifdef SMALL_DATASET
> +#   define TMAX 10
> +#   define NX 500
> +#   define NY 500
> +#  endif
> +
> +#  ifdef STANDARD_DATASET /* Default if unspecified. */
> +#   define TMAX 50
> +#   define NX 1000
> +#   define NY 1000
> +#  endif
> +
> +#  ifdef LARGE_DATASET
> +#   define TMAX 50
> +#   define NX 2000
> +#   define NY 2000
> +#  endif
> +
> +#  ifdef EXTRALARGE_DATASET
> +#   define TMAX 100
> +#   define NX 4000
> +#   define NY 4000
> +#  endif
> +# endif /* !N */
> +
> +# define _PB_TMAX POLYBENCH_LOOP_BOUND(TMAX,tmax)
> +# define _PB_NX POLYBENCH_LOOP_BOUND(NX,nx)
> +# define _PB_NY POLYBENCH_LOOP_BOUND(NY,ny)
> +
> +# ifndef DATA_TYPE
> +#  define DATA_TYPE double
> +#  define DATA_PRINTF_MODIFIER "%0.2lf "
> +# endif
> +
> +
> +#endif /* !FDTD_2D */
> 
> Propchange: test-suite/trunk/SingleSource/Benchmarks/Polybench/stencils/fdtd-2d/fdtd-2d.h
> ------------------------------------------------------------------------------
>    svn:executable = *
> 
> Added: test-suite/trunk/SingleSource/Benchmarks/Polybench/stencils/fdtd-2d/fdtd-2d.reference_output
> URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/Benchmarks/Polybench/stencils/fdtd-2d/fdtd-2d.reference_output?rev=159553&view=auto
> ==============================================================================
> --- test-suite/trunk/SingleSource/Benchmarks/Polybench/stencils/fdtd-2d/fdtd-2d.reference_output (added)
> +++ test-suite/trunk/SingleSource/Benchmarks/Polybench/stencils/fdtd-2d/fdtd-2d.reference_output Mon Jul  2 14:27:28 2012
> @@ -0,0 +1 @@
> +a0c67eb784fcf1b38991d3c7ffe7381b
> 
> Propchange: test-suite/trunk/SingleSource/Benchmarks/Polybench/stencils/fdtd-2d/fdtd-2d.reference_output
> ------------------------------------------------------------------------------
>    svn:executable = *
> 
> Added: test-suite/trunk/SingleSource/Benchmarks/Polybench/stencils/fdtd-apml/Makefile
> URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/Benchmarks/Polybench/stencils/fdtd-apml/Makefile?rev=159553&view=auto
> ==============================================================================
> --- test-suite/trunk/SingleSource/Benchmarks/Polybench/stencils/fdtd-apml/Makefile (added)
> +++ test-suite/trunk/SingleSource/Benchmarks/Polybench/stencils/fdtd-apml/Makefile Mon Jul  2 14:27:28 2012
> @@ -0,0 +1,10 @@
> +LEVEL = ../../../../..
> +
> +POLYBENCH_UTILS = SingleSource/Benchmarks/Polybench/utilities 
> +PROG          = fdtd-apml
> +CFLAGS        += -I $(PROJ_SRC_ROOT)/$(POLYBENCH_UTILS) -DPOLYBENCH_DUMP_ARRAYS
> +
> +HASH_PROGRAM_OUTPUT = 1
> +
> +include $(LEVEL)/SingleSource/Makefile.singlesrc
> +
> 
> Propchange: test-suite/trunk/SingleSource/Benchmarks/Polybench/stencils/fdtd-apml/Makefile
> ------------------------------------------------------------------------------
>    svn:executable = *
> 
> Added: test-suite/trunk/SingleSource/Benchmarks/Polybench/stencils/fdtd-apml/fdtd-apml.c
> URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/Benchmarks/Polybench/stencils/fdtd-apml/fdtd-apml.c?rev=159553&view=auto
> ==============================================================================
> --- test-suite/trunk/SingleSource/Benchmarks/Polybench/stencils/fdtd-apml/fdtd-apml.c (added)
> +++ test-suite/trunk/SingleSource/Benchmarks/Polybench/stencils/fdtd-apml/fdtd-apml.c Mon Jul  2 14:27:28 2012
> @@ -0,0 +1,256 @@
> +/**
> + * fdtd-apml.c: This file is part of the PolyBench/C 3.2 test suite.
> + *
> + *
> + * Contact: Louis-Noel Pouchet <pouchet at cse.ohio-state.edu>
> + * Web address: http://polybench.sourceforge.net
> + */
> +#include <stdio.h>
> +#include <unistd.h>
> +#include <string.h>
> +#include <math.h>
> +
> +/* Include polybench common header. */
> +#include <polybench.h>
> +
> +/* Include benchmark-specific header. */
> +/* Default data type is double, default size is 256x256x256. */
> +#include "fdtd-apml.h"
> +
> +
> +/* Array initialization. */
> +static
> +void init_array (int cz,
> +		 int cxm,
> +		 int cym,
> +		 DATA_TYPE *mui,
> +		 DATA_TYPE *ch,
> +		 DATA_TYPE POLYBENCH_2D(Ax,CZ+1,CYM+1,cz+1,cym+1),
> +		 DATA_TYPE POLYBENCH_2D(Ry,CZ+1,CYM+1,cz+1,cym+1),
> +		 DATA_TYPE POLYBENCH_3D(Ex,CZ+1,CYM+1,CXM+1,cz+1,cym+1,cxm+1),
> +		 DATA_TYPE POLYBENCH_3D(Ey,CZ+1,CYM+1,CXM+1,cz+1,cym+1,cxm+1),
> +		 DATA_TYPE POLYBENCH_3D(Hz,CZ+1,CYM+1,CXM+1,cz+1,cym+1,cxm+1),
> +		 DATA_TYPE POLYBENCH_1D(czm,CZ+1,cz+1),
> +		 DATA_TYPE POLYBENCH_1D(czp,CZ+1,cz+1),
> +		 DATA_TYPE POLYBENCH_1D(cxmh,CXM+1,cxm+1),
> +		 DATA_TYPE POLYBENCH_1D(cxph,CXM+1,cxm+1),
> +		 DATA_TYPE POLYBENCH_1D(cymh,CYM+1,cym+1),
> +		 DATA_TYPE POLYBENCH_1D(cyph,CYM+1,cym+1))
> +{
> +  int i, j, k;
> +  *mui = 2341;
> +  *ch = 42;
> +  for (i = 0; i <= cz; i++)
> +    {
> +      czm[i] = ((DATA_TYPE) i + 1) / cxm;
> +      czp[i] = ((DATA_TYPE) i + 2) / cxm;
> +    }
> +  for (i = 0; i <= cxm; i++)
> +    {
> +      cxmh[i] = ((DATA_TYPE) i + 3) / cxm;
> +      cxph[i] = ((DATA_TYPE) i + 4) / cxm;
> +    }
> +  for (i = 0; i <= cym; i++)
> +    {
> +      cymh[i] = ((DATA_TYPE) i + 5) / cxm;
> +      cyph[i] = ((DATA_TYPE) i + 6) / cxm;
> +    }
> +
> +  for (i = 0; i <= cz; i++)
> +    for (j = 0; j <= cym; j++)
> +      {
> +	Ry[i][j] = ((DATA_TYPE) i*(j+1) + 10) / cym;
> +	Ax[i][j] = ((DATA_TYPE) i*(j+2) + 11) / cym;
> +	for (k = 0; k <= cxm; k++)
> +	  {
> +	    Ex[i][j][k] = ((DATA_TYPE) i*(j+3) + k + 1) / cxm;
> +	    Ey[i][j][k] = ((DATA_TYPE) i*(j+4) + k + 2) / cym;
> +	    Hz[i][j][k] = ((DATA_TYPE) i*(j+5) + k + 3) / cz;
> +	  }
> +      }
> +}
> +
> +
> +/* DCE code. Must scan the entire live-out data.
> +   Can be used also to check the correctness of the output. */
> +static
> +void print_array(int cz,
> +		 int cxm,
> +		 int cym,
> +		 DATA_TYPE POLYBENCH_3D(Bza,CZ+1,CYM+1,CXM+1,cz+1,cym+1,cxm+1),
> +		 DATA_TYPE POLYBENCH_3D(Ex,CZ+1,CYM+1,CXM+1,cz+1,cym+1,cxm+1),
> +		 DATA_TYPE POLYBENCH_3D(Ey,CZ+1,CYM+1,CXM+1,cz+1,cym+1,cxm+1),
> +		 DATA_TYPE POLYBENCH_3D(Hz,CZ+1,CYM+1,CXM+1,cz+1,cym+1,cxm+1))
> +{
> +  int i, j, k;
> +
> +  for (i = 0; i <= cz; i++)
> +    for (j = 0; j <= cym; j++)
> +      for (k = 0; k <= cxm; k++) {
> +	fprintf(stderr, DATA_PRINTF_MODIFIER, Bza[i][j][k]);
> +	fprintf(stderr, DATA_PRINTF_MODIFIER, Ex[i][j][k]);
> +	fprintf(stderr, DATA_PRINTF_MODIFIER, Ey[i][j][k]);
> +	fprintf(stderr, DATA_PRINTF_MODIFIER, Hz[i][j][k]);
> +	if ((i * cxm + j) % 20 == 0) fprintf(stderr, "\n");
> +      }
> +  fprintf(stderr, "\n");
> +}
> +
> +
> +/* Main computational kernel. The whole function will be timed,
> +   including the call and return. */
> +static
> +void kernel_fdtd_apml(int cz,
> +		      int cxm,
> +		      int cym,
> +		      DATA_TYPE mui,
> +		      DATA_TYPE ch,
> +		      DATA_TYPE POLYBENCH_2D(Ax,CZ+1,CYM+1,cz+1,cym+1),
> +		      DATA_TYPE POLYBENCH_2D(Ry,CZ+1,CYM+1,cz+1,cym+1),
> +		      DATA_TYPE POLYBENCH_2D(clf,CYM+1,CXM+1,cym+1,cxm+1),
> +		      DATA_TYPE POLYBENCH_2D(tmp,CYM+1,CXM+1,cym+1,cxm+1),
> +		      DATA_TYPE POLYBENCH_3D(Bza,CZ+1,CYM+1,CXM+1,cz+1,cym+1,cxm+1),
> +		      DATA_TYPE POLYBENCH_3D(Ex,CZ+1,CYM+1,CXM+1,cz+1,cym+1,cxm+1),
> +		      DATA_TYPE POLYBENCH_3D(Ey,CZ+1,CYM+1,CXM+1,cz+1,cym+1,cxm+1),
> +		      DATA_TYPE POLYBENCH_3D(Hz,CZ+1,CYM+1,CXM+1,cz+1,cym+1,cxm+1),
> +		      DATA_TYPE POLYBENCH_1D(czm,CZ+1,cz+1),
> +		      DATA_TYPE POLYBENCH_1D(czp,CZ+1,cz+1),
> +		      DATA_TYPE POLYBENCH_1D(cxmh,CXM+1,cxm+1),
> +		      DATA_TYPE POLYBENCH_1D(cxph,CXM+1,cxm+1),
> +		      DATA_TYPE POLYBENCH_1D(cymh,CYM+1,cym+1),
> +		      DATA_TYPE POLYBENCH_1D(cyph,CYM+1,cym+1))
> +{
> +  int iz, iy, ix;
> +
> +#pragma scop
> +  for (iz = 0; iz < _PB_CZ; iz++)
> +    {
> +      for (iy = 0; iy < _PB_CYM; iy++)
> +	{
> +	  for (ix = 0; ix < _PB_CXM; ix++)
> +	    {
> +	      clf[iz][iy] = Ex[iz][iy][ix] - Ex[iz][iy+1][ix] + Ey[iz][iy][ix+1] - Ey[iz][iy][ix];
> +	      tmp[iz][iy] = (cymh[iy] / cyph[iy]) * Bza[iz][iy][ix] - (ch / cyph[iy]) * clf[iz][iy];
> +	      Hz[iz][iy][ix] = (cxmh[ix] /cxph[ix]) * Hz[iz][iy][ix]
> +		+ (mui * czp[iz] / cxph[ix]) * tmp[iz][iy]
> +		- (mui * czm[iz] / cxph[ix]) * Bza[iz][iy][ix];
> +	      Bza[iz][iy][ix] = tmp[iz][iy];
> +	    }
> +	  clf[iz][iy] = Ex[iz][iy][_PB_CXM] - Ex[iz][iy+1][_PB_CXM] + Ry[iz][iy] - Ey[iz][iy][_PB_CXM];
> +	  tmp[iz][iy] = (cymh[iy] / cyph[iy]) * Bza[iz][iy][_PB_CXM] - (ch / cyph[iy]) * clf[iz][iy];
> +	  Hz[iz][iy][_PB_CXM]=(cxmh[_PB_CXM] / cxph[_PB_CXM]) * Hz[iz][iy][_PB_CXM]
> +	    + (mui * czp[iz] / cxph[_PB_CXM]) * tmp[iz][iy]
> +	    - (mui * czm[iz] / cxph[_PB_CXM]) * Bza[iz][iy][_PB_CXM];
> +	  Bza[iz][iy][_PB_CXM] = tmp[iz][iy];
> +	  for (ix = 0; ix < _PB_CXM; ix++)
> +	    {
> +	      clf[iz][iy] = Ex[iz][_PB_CYM][ix] - Ax[iz][ix] + Ey[iz][_PB_CYM][ix+1] - Ey[iz][_PB_CYM][ix];
> +	      tmp[iz][iy] = (cymh[_PB_CYM] / cyph[iy]) * Bza[iz][iy][ix] - (ch / cyph[iy]) * clf[iz][iy];
> +	      Hz[iz][_PB_CYM][ix] = (cxmh[ix] / cxph[ix]) * Hz[iz][_PB_CYM][ix]
> +		+ (mui * czp[iz] / cxph[ix]) * tmp[iz][iy]
> +		- (mui * czm[iz] / cxph[ix]) * Bza[iz][_PB_CYM][ix];
> +	      Bza[iz][_PB_CYM][ix] = tmp[iz][iy];
> +	    }
> +	  clf[iz][iy] = Ex[iz][_PB_CYM][_PB_CXM] - Ax[iz][_PB_CXM] + Ry[iz][_PB_CYM] - Ey[iz][_PB_CYM][_PB_CXM];
> +	  tmp[iz][iy] = (cymh[_PB_CYM] / cyph[_PB_CYM]) * Bza[iz][_PB_CYM][_PB_CXM] - (ch / cyph[_PB_CYM]) * clf[iz][iy];
> +	  Hz[iz][_PB_CYM][_PB_CXM] = (cxmh[_PB_CXM] / cxph[_PB_CXM]) * Hz[iz][_PB_CYM][_PB_CXM]
> +	    + (mui * czp[iz] / cxph[_PB_CXM]) * tmp[iz][iy]
> +	    - (mui * czm[iz] / cxph[_PB_CXM]) * Bza[iz][_PB_CYM][_PB_CXM];
> +	  Bza[iz][_PB_CYM][_PB_CXM] = tmp[iz][iy];
> +	}
> +    }
> +#pragma endscop
> +
> +}
> +
> +
> +int main(int argc, char** argv)
> +{
> +  /* Retrieve problem size. */
> +  int cz = CZ;
> +  int cym = CYM;
> +  int cxm = CXM;
> +
> +  /* Variable declaration/allocation. */
> +  DATA_TYPE mui;
> +  DATA_TYPE ch;
> +  POLYBENCH_2D_ARRAY_DECL(Ax,DATA_TYPE,CZ+1,CYM+1,cz+1,cym+1);
> +  POLYBENCH_2D_ARRAY_DECL(Ry,DATA_TYPE,CZ+1,CYM+1,cz+1,cym+1);
> +  POLYBENCH_2D_ARRAY_DECL(clf,DATA_TYPE,CYM+1,CXM+1,cym+1,cxm+1);
> +  POLYBENCH_2D_ARRAY_DECL(tmp,DATA_TYPE,CYM+1,CXM+1,cym+1,cxm+1);
> +  POLYBENCH_3D_ARRAY_DECL(Bza,DATA_TYPE,CZ+1,CYM+1,CXM+1,cz+1,cym+1,cxm+1);
> +  POLYBENCH_3D_ARRAY_DECL(Ex,DATA_TYPE,CZ+1,CYM+1,CXM+1,cz+1,cym+1,cxm+1);
> +  POLYBENCH_3D_ARRAY_DECL(Ey,DATA_TYPE,CZ+1,CYM+1,CXM+1,cz+1,cym+1,cxm+1);
> +  POLYBENCH_3D_ARRAY_DECL(Hz,DATA_TYPE,CZ+1,CYM+1,CXM+1,cz+1,cym+1,cxm+1);
> +  POLYBENCH_1D_ARRAY_DECL(czm,DATA_TYPE,CZ+1,cz+1);
> +  POLYBENCH_1D_ARRAY_DECL(czp,DATA_TYPE,CZ+1,cz+1);
> +  POLYBENCH_1D_ARRAY_DECL(cxmh,DATA_TYPE,CXM+1,cxm+1);
> +  POLYBENCH_1D_ARRAY_DECL(cxph,DATA_TYPE,CXM+1,cxm+1);
> +  POLYBENCH_1D_ARRAY_DECL(cymh,DATA_TYPE,CYM+1,cym+1);
> +  POLYBENCH_1D_ARRAY_DECL(cyph,DATA_TYPE,CYM+1,cym+1);
> +
> +  /* Initialize array(s). */
> +  init_array (cz, cxm, cym, &mui, &ch,
> +  	      POLYBENCH_ARRAY(Ax),
> +  	      POLYBENCH_ARRAY(Ry),
> +  	      POLYBENCH_ARRAY(Ex),
> +  	      POLYBENCH_ARRAY(Ey),
> +  	      POLYBENCH_ARRAY(Hz),
> +  	      POLYBENCH_ARRAY(czm),
> +  	      POLYBENCH_ARRAY(czp),
> +  	      POLYBENCH_ARRAY(cxmh),
> +  	      POLYBENCH_ARRAY(cxph),
> +  	      POLYBENCH_ARRAY(cymh),
> +  	      POLYBENCH_ARRAY(cyph));
> +
> +  /* Start timer. */
> +  polybench_start_instruments;
> +
> +  /* Run kernel. */
> +  kernel_fdtd_apml (cz, cxm, cym, mui, ch,
> +  		    POLYBENCH_ARRAY(Ax),
> +  		    POLYBENCH_ARRAY(Ry),
> +  		    POLYBENCH_ARRAY(clf),
> +  		    POLYBENCH_ARRAY(tmp),
> +  		    POLYBENCH_ARRAY(Bza),
> +  		    POLYBENCH_ARRAY(Ex),
> +  		    POLYBENCH_ARRAY(Ey),
> +  		    POLYBENCH_ARRAY(Hz),
> +  		    POLYBENCH_ARRAY(czm),
> +  		    POLYBENCH_ARRAY(czp),
> +  		    POLYBENCH_ARRAY(cxmh),
> +  		    POLYBENCH_ARRAY(cxph),
> +  		    POLYBENCH_ARRAY(cymh),
> +  		    POLYBENCH_ARRAY(cyph));
> +
> +  /* Stop and print timer. */
> +  polybench_stop_instruments;
> +  polybench_print_instruments;
> +
> +  /* Prevent dead-code elimination. All live-out data must be printed
> +     by the function call in argument. */
> +  polybench_prevent_dce(print_array(cz, cxm, cym,
> +  				    POLYBENCH_ARRAY(Bza),
> +  				    POLYBENCH_ARRAY(Ex),
> +  				    POLYBENCH_ARRAY(Ey),
> +  				    POLYBENCH_ARRAY(Hz)));
> +
> +  /* Be clean. */
> +  POLYBENCH_FREE_ARRAY(Ax);
> +  POLYBENCH_FREE_ARRAY(Ry);
> +  POLYBENCH_FREE_ARRAY(clf);
> +  POLYBENCH_FREE_ARRAY(tmp);
> +  POLYBENCH_FREE_ARRAY(Bza);
> +  POLYBENCH_FREE_ARRAY(Ex);
> +  POLYBENCH_FREE_ARRAY(Ey);
> +  POLYBENCH_FREE_ARRAY(Hz);
> +  POLYBENCH_FREE_ARRAY(czm);
> +  POLYBENCH_FREE_ARRAY(czp);
> +  POLYBENCH_FREE_ARRAY(cxmh);
> +  POLYBENCH_FREE_ARRAY(cxph);
> +  POLYBENCH_FREE_ARRAY(cymh);
> +  POLYBENCH_FREE_ARRAY(cyph);
> +
> +  return 0;
> +}
> +
> 
> Propchange: test-suite/trunk/SingleSource/Benchmarks/Polybench/stencils/fdtd-apml/fdtd-apml.c
> ------------------------------------------------------------------------------
>    svn:executable = *
> 
> Added: test-suite/trunk/SingleSource/Benchmarks/Polybench/stencils/fdtd-apml/fdtd-apml.h
> URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/Benchmarks/Polybench/stencils/fdtd-apml/fdtd-apml.h?rev=159553&view=auto
> ==============================================================================
> --- test-suite/trunk/SingleSource/Benchmarks/Polybench/stencils/fdtd-apml/fdtd-apml.h (added)
> +++ test-suite/trunk/SingleSource/Benchmarks/Polybench/stencils/fdtd-apml/fdtd-apml.h Mon Jul  2 14:27:28 2012
> @@ -0,0 +1,71 @@
> +/**
> + * fdtd-apml.h: This file is part of the PolyBench/C 3.2 test suite.
> + *
> + *
> + * Contact: Louis-Noel Pouchet <pouchet at cse.ohio-state.edu>
> + * Web address: http://polybench.sourceforge.net
> + */
> +#ifndef FDTD_APML_H
> +# define FDTD_AMPL_H
> +
> +/*
> +  LLVM:  We are using SMALL_DATASET here because the size of the output file
> +         for a STANDARD_DATASET is too big to be used in the LLVM test suite.
> +         Even using hashed output, the test suite aborts the execution of this
> +         benchmark if we use STANDARD_DATASET.
> +*/
> +#define CZ  64
> +#define CYM 64
> +#define CXM 64
> +
> +
> +/* Default to STANDARD_DATASET. */
> +# if !defined(MINI_DATASET) && !defined(SMALL_DATASET) && !defined(LARGE_DATASET) && !defined(EXTRALARGE_DATASET)
> +#  define STANDARD_DATASET
> +# endif
> +
> +/* Do not define anything if the user manually defines the size. */
> +# if !defined(CZ) && ! defined(CYM) && !defined(CXM)
> +/* Define the possible dataset sizes. */
> +#  ifdef MINI_DATASET
> +#   define CZ 32
> +#   define CYM 32
> +#   define CXM 32
> +#  endif
> +
> +#  ifdef SMALL_DATASET
> +#   define CZ 64
> +#   define CYM 64
> +#   define CXM 64
> +#  endif
> +
> +#  ifdef STANDARD_DATASET /* Default if unspecified. */
> +#   define CZ 256
> +#   define CYM 256
> +#   define CXM 256
> +#  endif
> +
> +#  ifdef LARGE_DATASET
> +#   define CZ 512
> +#   define CYM 512
> +#   define CXM 512
> +#  endif
> +
> +#  ifdef EXTRALARGE_DATASET
> +#   define CZ 1000
> +#   define CYM 1000
> +#   define CXM 1000
> +#  endif
> +# endif /* !N */
> +
> +# define _PB_CZ POLYBENCH_LOOP_BOUND(CZ,cz)
> +# define _PB_CYM POLYBENCH_LOOP_BOUND(CYM,cym)
> +# define _PB_CXM POLYBENCH_LOOP_BOUND(CXM,cxm)
> +
> +# ifndef DATA_TYPE
> +#  define DATA_TYPE double
> +#  define DATA_PRINTF_MODIFIER "%0.2lf "
> +# endif
> +
> +
> +#endif /* !FDTD_APML */
> 
> Propchange: test-suite/trunk/SingleSource/Benchmarks/Polybench/stencils/fdtd-apml/fdtd-apml.h
> ------------------------------------------------------------------------------
>    svn:executable = *
> 
> Added: test-suite/trunk/SingleSource/Benchmarks/Polybench/stencils/fdtd-apml/fdtd-apml.reference_output
> URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/Benchmarks/Polybench/stencils/fdtd-apml/fdtd-apml.reference_output?rev=159553&view=auto
> ==============================================================================
> --- test-suite/trunk/SingleSource/Benchmarks/Polybench/stencils/fdtd-apml/fdtd-apml.reference_output (added)
> +++ test-suite/trunk/SingleSource/Benchmarks/Polybench/stencils/fdtd-apml/fdtd-apml.reference_output Mon Jul  2 14:27:28 2012
> @@ -0,0 +1 @@
> +2106d674b5073dd2209dc6d1e2131fa6
> 
> Propchange: test-suite/trunk/SingleSource/Benchmarks/Polybench/stencils/fdtd-apml/fdtd-apml.reference_output
> ------------------------------------------------------------------------------
>    svn:executable = *
> 
> Added: test-suite/trunk/SingleSource/Benchmarks/Polybench/stencils/jacobi-1d-imper/Makefile
> URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/Benchmarks/Polybench/stencils/jacobi-1d-imper/Makefile?rev=159553&view=auto
> ==============================================================================
> --- test-suite/trunk/SingleSource/Benchmarks/Polybench/stencils/jacobi-1d-imper/Makefile (added)
> +++ test-suite/trunk/SingleSource/Benchmarks/Polybench/stencils/jacobi-1d-imper/Makefile Mon Jul  2 14:27:28 2012
> @@ -0,0 +1,10 @@
> +LEVEL = ../../../../..
> +
> +POLYBENCH_UTILS = SingleSource/Benchmarks/Polybench/utilities 
> +PROG          = jacobi-1d-imper
> +CFLAGS        += -I $(PROJ_SRC_ROOT)/$(POLYBENCH_UTILS) -DPOLYBENCH_DUMP_ARRAYS
> +
> +HASH_PROGRAM_OUTPUT = 1
> +
> +include $(LEVEL)/SingleSource/Makefile.singlesrc
> +
> 
> Propchange: test-suite/trunk/SingleSource/Benchmarks/Polybench/stencils/jacobi-1d-imper/Makefile
> ------------------------------------------------------------------------------
>    svn:executable = *
> 
> Added: test-suite/trunk/SingleSource/Benchmarks/Polybench/stencils/jacobi-1d-imper/jacobi-1d-imper.c
> URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/Benchmarks/Polybench/stencils/jacobi-1d-imper/jacobi-1d-imper.c?rev=159553&view=auto
> ==============================================================================
> --- test-suite/trunk/SingleSource/Benchmarks/Polybench/stencils/jacobi-1d-imper/jacobi-1d-imper.c (added)
> +++ test-suite/trunk/SingleSource/Benchmarks/Polybench/stencils/jacobi-1d-imper/jacobi-1d-imper.c Mon Jul  2 14:27:28 2012
> @@ -0,0 +1,111 @@
> +/**
> + * jacobi-1d-imper.c: This file is part of the PolyBench/C 3.2 test suite.
> + *
> + *
> + * Contact: Louis-Noel Pouchet <pouchet at cse.ohio-state.edu>
> + * Web address: http://polybench.sourceforge.net
> + */
> +#include <stdio.h>
> +#include <unistd.h>
> +#include <string.h>
> +#include <math.h>
> +
> +/* Include polybench common header. */
> +#include <polybench.h>
> +
> +/* Include benchmark-specific header. */
> +/* Default data type is double, default size is 100x10000. */
> +#include "jacobi-1d-imper.h"
> +
> +
> +/* Array initialization. */
> +static
> +void init_array (int n,
> +		 DATA_TYPE POLYBENCH_1D(A,N,n),
> +		 DATA_TYPE POLYBENCH_1D(B,N,n))
> +{
> +  int i;
> +
> +  for (i = 0; i < n; i++)
> +      {
> +	A[i] = ((DATA_TYPE) i+ 2) / n;
> +	B[i] = ((DATA_TYPE) i+ 3) / n;
> +      }
> +}
> +
> +
> +/* DCE code. Must scan the entire live-out data.
> +   Can be used also to check the correctness of the output. */
> +static
> +void print_array(int n,
> +		 DATA_TYPE POLYBENCH_1D(A,N,n))
> +
> +{
> +  int i;
> +
> +  for (i = 0; i < n; i++)
> +    {
> +      fprintf(stderr, DATA_PRINTF_MODIFIER, A[i]);
> +      if (i % 20 == 0) fprintf(stderr, "\n");
> +    }
> +  fprintf(stderr, "\n");
> +}
> +
> +
> +/* Main computational kernel. The whole function will be timed,
> +   including the call and return. */
> +static
> +void kernel_jacobi_1d_imper(int tsteps,
> +			    int n,
> +			    DATA_TYPE POLYBENCH_1D(A,N,n),
> +			    DATA_TYPE POLYBENCH_1D(B,N,n))
> +{
> +  int t, i, j;
> +
> +#pragma scop
> +  for (t = 0; t < _PB_TSTEPS; t++)
> +    {
> +      for (i = 1; i < _PB_N - 1; i++)
> +	B[i] = 0.33333 * (A[i-1] + A[i] + A[i + 1]);
> +      for (j = 1; j < _PB_N - 1; j++)
> +	A[j] = B[j];
> +    }
> +#pragma endscop
> +
> +}
> +
> +
> +int main(int argc, char** argv)
> +{
> +  /* Retrieve problem size. */
> +  int n = N;
> +  int tsteps = TSTEPS;
> +
> +  /* Variable declaration/allocation. */
> +  POLYBENCH_1D_ARRAY_DECL(A, DATA_TYPE, N, n);
> +  POLYBENCH_1D_ARRAY_DECL(B, DATA_TYPE, N, n);
> +
> +
> +  /* Initialize array(s). */
> +  init_array (n, POLYBENCH_ARRAY(A), POLYBENCH_ARRAY(B));
> +
> +  /* Start timer. */
> +  polybench_start_instruments;
> +
> +  /* Run kernel. */
> +  kernel_jacobi_1d_imper (tsteps, n, POLYBENCH_ARRAY(A), POLYBENCH_ARRAY(B));
> +
> +  /* Stop and print timer. */
> +  polybench_stop_instruments;
> +  polybench_print_instruments;
> +
> +  /* Prevent dead-code elimination. All live-out data must be printed
> +     by the function call in argument. */
> +  polybench_prevent_dce(print_array(n, POLYBENCH_ARRAY(A)));
> +
> +  /* Be clean. */
> +  POLYBENCH_FREE_ARRAY(A);
> +  POLYBENCH_FREE_ARRAY(B);
> +
> +  return 0;
> +}
> 
> Propchange: test-suite/trunk/SingleSource/Benchmarks/Polybench/stencils/jacobi-1d-imper/jacobi-1d-imper.c
> ------------------------------------------------------------------------------
>    svn:executable = *
> 
> Added: test-suite/trunk/SingleSource/Benchmarks/Polybench/stencils/jacobi-1d-imper/jacobi-1d-imper.h
> URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/Benchmarks/Polybench/stencils/jacobi-1d-imper/jacobi-1d-imper.h?rev=159553&view=auto
> ==============================================================================
> --- test-suite/trunk/SingleSource/Benchmarks/Polybench/stencils/jacobi-1d-imper/jacobi-1d-imper.h (added)
> +++ test-suite/trunk/SingleSource/Benchmarks/Polybench/stencils/jacobi-1d-imper/jacobi-1d-imper.h Mon Jul  2 14:27:28 2012
> @@ -0,0 +1,54 @@
> +/**
> + * jacobi-1d-imper.h: This file is part of the PolyBench/C 3.2 test suite.
> + *
> + *
> + * Contact: Louis-Noel Pouchet <pouchet at cse.ohio-state.edu>
> + * Web address: http://polybench.sourceforge.net
> + */
> +#ifndef JACOBI_1D_IMPER_H
> +# define JACOBI_1D_IMPER_H
> +
> +/* Default to STANDARD_DATASET. */
> +# if !defined(MINI_DATASET) && !defined(SMALL_DATASET) && !defined(LARGE_DATASET) && !defined(EXTRALARGE_DATASET)
> +#  define STANDARD_DATASET
> +# endif
> +
> +/* Do not define anything if the user manually defines the size. */
> +# if !defined(TSTEPS) && ! defined(N)
> +/* Define the possible dataset sizes. */
> +#  ifdef MINI_DATASET
> +#   define TSTEPS 2
> +#   define N 500
> +#  endif
> +
> +#  ifdef SMALL_DATASET
> +#   define TSTEPS 10
> +#   define N 1000
> +#  endif
> +
> +#  ifdef STANDARD_DATASET /* Default if unspecified. */
> +#   define TSTEPS 100
> +#   define N 10000
> +#  endif
> +
> +#  ifdef LARGE_DATASET
> +#   define TSTEPS 1000
> +#   define N 100000
> +#  endif
> +
> +#  ifdef EXTRALARGE_DATASET
> +#   define TSTEPS 1000
> +#   define N 1000000
> +#  endif
> +# endif /* !N */
> +
> +# define _PB_TSTEPS POLYBENCH_LOOP_BOUND(TSTEPS,tsteps)
> +# define _PB_N POLYBENCH_LOOP_BOUND(N,n)
> +
> +# ifndef DATA_TYPE
> +#  define DATA_TYPE double
> +#  define DATA_PRINTF_MODIFIER "%0.2lf "
> +# endif
> +
> +
> +#endif /* !JACOBI_1D_IMPER */
> 
> Propchange: test-suite/trunk/SingleSource/Benchmarks/Polybench/stencils/jacobi-1d-imper/jacobi-1d-imper.h
> ------------------------------------------------------------------------------
>    svn:executable = *
> 
> Added: test-suite/trunk/SingleSource/Benchmarks/Polybench/stencils/jacobi-1d-imper/jacobi-1d-imper.reference_output
> URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/Benchmarks/Polybench/stencils/jacobi-1d-imper/jacobi-1d-imper.reference_output?rev=159553&view=auto
> ==============================================================================
> --- test-suite/trunk/SingleSource/Benchmarks/Polybench/stencils/jacobi-1d-imper/jacobi-1d-imper.reference_output (added)
> +++ test-suite/trunk/SingleSource/Benchmarks/Polybench/stencils/jacobi-1d-imper/jacobi-1d-imper.reference_output Mon Jul  2 14:27:28 2012
> @@ -0,0 +1 @@
> +2eddb1dbda3879a4038397cfc8bf9a61
> 
> Propchange: test-suite/trunk/SingleSource/Benchmarks/Polybench/stencils/jacobi-1d-imper/jacobi-1d-imper.reference_output
> ------------------------------------------------------------------------------
>    svn:executable = *
> 
> Added: test-suite/trunk/SingleSource/Benchmarks/Polybench/stencils/jacobi-2d-imper/Makefile
> URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/Benchmarks/Polybench/stencils/jacobi-2d-imper/Makefile?rev=159553&view=auto
> ==============================================================================
> --- test-suite/trunk/SingleSource/Benchmarks/Polybench/stencils/jacobi-2d-imper/Makefile (added)
> +++ test-suite/trunk/SingleSource/Benchmarks/Polybench/stencils/jacobi-2d-imper/Makefile Mon Jul  2 14:27:28 2012
> @@ -0,0 +1,10 @@
> +LEVEL = ../../../../..
> +
> +POLYBENCH_UTILS = SingleSource/Benchmarks/Polybench/utilities 
> +PROG          = jacobi-2d-imper
> +CFLAGS        += -I $(PROJ_SRC_ROOT)/$(POLYBENCH_UTILS) -DPOLYBENCH_DUMP_ARRAYS
> +
> +HASH_PROGRAM_OUTPUT = 1
> +
> +include $(LEVEL)/SingleSource/Makefile.singlesrc
> +
> 
> Propchange: test-suite/trunk/SingleSource/Benchmarks/Polybench/stencils/jacobi-2d-imper/Makefile
> ------------------------------------------------------------------------------
>    svn:executable = *
> 
> Added: test-suite/trunk/SingleSource/Benchmarks/Polybench/stencils/jacobi-2d-imper/jacobi-2d-imper.c
> URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/Benchmarks/Polybench/stencils/jacobi-2d-imper/jacobi-2d-imper.c?rev=159553&view=auto
> ==============================================================================
> --- test-suite/trunk/SingleSource/Benchmarks/Polybench/stencils/jacobi-2d-imper/jacobi-2d-imper.c (added)
> +++ test-suite/trunk/SingleSource/Benchmarks/Polybench/stencils/jacobi-2d-imper/jacobi-2d-imper.c Mon Jul  2 14:27:28 2012
> @@ -0,0 +1,114 @@
> +/**
> + * jacobi-2d-imper.c: This file is part of the PolyBench/C 3.2 test suite.
> + *
> + *
> + * Contact: Louis-Noel Pouchet <pouchet at cse.ohio-state.edu>
> + * Web address: http://polybench.sourceforge.net
> + */
> +#include <stdio.h>
> +#include <unistd.h>
> +#include <string.h>
> +#include <math.h>
> +
> +/* Include polybench common header. */
> +#include <polybench.h>
> +
> +/* Include benchmark-specific header. */
> +/* Default data type is double, default size is 20x1000. */
> +#include "jacobi-2d-imper.h"
> +
> +
> +/* Array initialization. */
> +static
> +void init_array (int n,
> +		 DATA_TYPE POLYBENCH_2D(A,N,N,n,n),
> +		 DATA_TYPE POLYBENCH_2D(B,N,N,n,n))
> +{
> +  int i, j;
> +
> +  for (i = 0; i < n; i++)
> +    for (j = 0; j < n; j++)
> +      {
> +	A[i][j] = ((DATA_TYPE) i*(j+2) + 2) / n;
> +	B[i][j] = ((DATA_TYPE) i*(j+3) + 3) / n;
> +      }
> +}
> +
> +
> +/* DCE code. Must scan the entire live-out data.
> +   Can be used also to check the correctness of the output. */
> +static
> +void print_array(int n,
> +		 DATA_TYPE POLYBENCH_2D(A,N,N,n,n))
> +
> +{
> +  int i, j;
> +
> +  for (i = 0; i < n; i++)
> +    for (j = 0; j < n; j++) {
> +      fprintf(stderr, DATA_PRINTF_MODIFIER, A[i][j]);
> +      if ((i * n + j) % 20 == 0) fprintf(stderr, "\n");
> +    }
> +  fprintf(stderr, "\n");
> +}
> +
> +
> +/* Main computational kernel. The whole function will be timed,
> +   including the call and return. */
> +static
> +void kernel_jacobi_2d_imper(int tsteps,
> +			    int n,
> +			    DATA_TYPE POLYBENCH_2D(A,N,N,n,n),
> +			    DATA_TYPE POLYBENCH_2D(B,N,N,n,n))
> +{
> +  int t, i, j;
> +
> +#pragma scop
> +  for (t = 0; t < _PB_TSTEPS; t++)
> +    {
> +      for (i = 1; i < _PB_N - 1; i++)
> +	for (j = 1; j < _PB_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 = 1; i < _PB_N-1; i++)
> +	for (j = 1; j < _PB_N-1; j++)
> +	  A[i][j] = B[i][j];
> +    }
> +#pragma endscop
> +
> +}
> +
> +
> +int main(int argc, char** argv)
> +{
> +  /* Retrieve problem size. */
> +  int n = N;
> +  int tsteps = TSTEPS;
> +
> +  /* Variable declaration/allocation. */
> +  POLYBENCH_2D_ARRAY_DECL(A, DATA_TYPE, N, N, n, n);
> +  POLYBENCH_2D_ARRAY_DECL(B, DATA_TYPE, N, N, n, n);
> +
> +
> +  /* Initialize array(s). */
> +  init_array (n, POLYBENCH_ARRAY(A), POLYBENCH_ARRAY(B));
> +
> +  /* Start timer. */
> +  polybench_start_instruments;
> +
> +  /* Run kernel. */
> +  kernel_jacobi_2d_imper (tsteps, n, POLYBENCH_ARRAY(A), POLYBENCH_ARRAY(B));
> +
> +  /* Stop and print timer. */
> +  polybench_stop_instruments;
> +  polybench_print_instruments;
> +
> +  /* Prevent dead-code elimination. All live-out data must be printed
> +     by the function call in argument. */
> +  polybench_prevent_dce(print_array(n, POLYBENCH_ARRAY(A)));
> +
> +  /* Be clean. */
> +  POLYBENCH_FREE_ARRAY(A);
> +  POLYBENCH_FREE_ARRAY(B);
> +
> +  return 0;
> +}
> 
> Propchange: test-suite/trunk/SingleSource/Benchmarks/Polybench/stencils/jacobi-2d-imper/jacobi-2d-imper.c
> ------------------------------------------------------------------------------
>    svn:executable = *
> 
> Added: test-suite/trunk/SingleSource/Benchmarks/Polybench/stencils/jacobi-2d-imper/jacobi-2d-imper.h
> URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/Benchmarks/Polybench/stencils/jacobi-2d-imper/jacobi-2d-imper.h?rev=159553&view=auto
> ==============================================================================
> --- test-suite/trunk/SingleSource/Benchmarks/Polybench/stencils/jacobi-2d-imper/jacobi-2d-imper.h (added)
> +++ test-suite/trunk/SingleSource/Benchmarks/Polybench/stencils/jacobi-2d-imper/jacobi-2d-imper.h Mon Jul  2 14:27:28 2012
> @@ -0,0 +1,54 @@
> +/**
> + * jacobi-2d-imper.h: This file is part of the PolyBench/C 3.2 test suite.
> + *
> + *
> + * Contact: Louis-Noel Pouchet <pouchet at cse.ohio-state.edu>
> + * Web address: http://polybench.sourceforge.net
> + */
> +#ifndef JACOBI_2D_IMPER_H
> +# define JACOBI_2D_IMPER_H
> +
> +/* Default to STANDARD_DATASET. */
> +# if !defined(MINI_DATASET) && !defined(SMALL_DATASET) && !defined(LARGE_DATASET) && !defined(EXTRALARGE_DATASET)
> +#  define STANDARD_DATASET
> +# endif
> +
> +/* Do not define anything if the user manually defines the size. */
> +# if !defined(TSTEPS) && ! defined(N)
> +/* Define the possible dataset sizes. */
> +#  ifdef MINI_DATASET
> +#   define TSTEPS 2
> +#   define N 32
> +#  endif
> +
> +#  ifdef SMALL_DATASET
> +#   define TSTEPS 10
> +#   define N 500
> +#  endif
> +
> +#  ifdef STANDARD_DATASET /* Default if unspecified. */
> +#   define TSTEPS 20
> +#   define N 1000
> +#  endif
> +
> +#  ifdef LARGE_DATASET
> +#   define TSTEPS 20
> +#   define N 2000
> +#  endif
> +
> +#  ifdef EXTRALARGE_DATASET
> +#   define TSTEPS 100
> +#   define N 4000
> +#  endif
> +# endif /* !N */
> +
> +# define _PB_TSTEPS POLYBENCH_LOOP_BOUND(TSTEPS,tsteps)
> +# define _PB_N POLYBENCH_LOOP_BOUND(N,n)
> +
> +# ifndef DATA_TYPE
> +#  define DATA_TYPE double
> +#  define DATA_PRINTF_MODIFIER "%0.2lf "
> +# endif
> +
> +
> +#endif /* !JACOBI_2D_IMPER */
> 
> Propchange: test-suite/trunk/SingleSource/Benchmarks/Polybench/stencils/jacobi-2d-imper/jacobi-2d-imper.h
> ------------------------------------------------------------------------------
>    svn:executable = *
> 
> Added: test-suite/trunk/SingleSource/Benchmarks/Polybench/stencils/jacobi-2d-imper/jacobi-2d-imper.reference_output
> URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/Benchmarks/Polybench/stencils/jacobi-2d-imper/jacobi-2d-imper.reference_output?rev=159553&view=auto
> ==============================================================================
> --- test-suite/trunk/SingleSource/Benchmarks/Polybench/stencils/jacobi-2d-imper/jacobi-2d-imper.reference_output (added)
> +++ test-suite/trunk/SingleSource/Benchmarks/Polybench/stencils/jacobi-2d-imper/jacobi-2d-imper.reference_output Mon Jul  2 14:27:28 2012
> @@ -0,0 +1 @@
> +61690122698707dc06d0f72e055fe42f
> 
> Propchange: test-suite/trunk/SingleSource/Benchmarks/Polybench/stencils/jacobi-2d-imper/jacobi-2d-imper.reference_output
> ------------------------------------------------------------------------------
>    svn:executable = *
> 
> Added: test-suite/trunk/SingleSource/Benchmarks/Polybench/stencils/seidel-2d/Makefile
> URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/Benchmarks/Polybench/stencils/seidel-2d/Makefile?rev=159553&view=auto
> ==============================================================================
> --- test-suite/trunk/SingleSource/Benchmarks/Polybench/stencils/seidel-2d/Makefile (added)
> +++ test-suite/trunk/SingleSource/Benchmarks/Polybench/stencils/seidel-2d/Makefile Mon Jul  2 14:27:28 2012
> @@ -0,0 +1,10 @@
> +LEVEL = ../../../../..
> +
> +POLYBENCH_UTILS = SingleSource/Benchmarks/Polybench/utilities 
> +PROG          = seidel-2d
> +CFLAGS        += -I $(PROJ_SRC_ROOT)/$(POLYBENCH_UTILS) -DPOLYBENCH_DUMP_ARRAYS
> +
> +HASH_PROGRAM_OUTPUT = 1
> +
> +include $(LEVEL)/SingleSource/Makefile.singlesrc
> +
> 
> Propchange: test-suite/trunk/SingleSource/Benchmarks/Polybench/stencils/seidel-2d/Makefile
> ------------------------------------------------------------------------------
>    svn:executable = *
> 
> Added: test-suite/trunk/SingleSource/Benchmarks/Polybench/stencils/seidel-2d/seidel-2d.c
> URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/Benchmarks/Polybench/stencils/seidel-2d/seidel-2d.c?rev=159553&view=auto
> ==============================================================================
> --- test-suite/trunk/SingleSource/Benchmarks/Polybench/stencils/seidel-2d/seidel-2d.c (added)
> +++ test-suite/trunk/SingleSource/Benchmarks/Polybench/stencils/seidel-2d/seidel-2d.c Mon Jul  2 14:27:28 2012
> @@ -0,0 +1,104 @@
> +/**
> + * seidel-2d.c: This file is part of the PolyBench/C 3.2 test suite.
> + *
> + *
> + * Contact: Louis-Noel Pouchet <pouchet at cse.ohio-state.edu>
> + * Web address: http://polybench.sourceforge.net
> + */
> +#include <stdio.h>
> +#include <unistd.h>
> +#include <string.h>
> +#include <math.h>
> +
> +/* Include polybench common header. */
> +#include <polybench.h>
> +
> +/* Include benchmark-specific header. */
> +/* Default data type is double, default size is 20x1000. */
> +#include "seidel-2d.h"
> +
> +
> +/* Array initialization. */
> +static
> +void init_array (int n,
> +		 DATA_TYPE POLYBENCH_2D(A,N,N,n,n))
> +{
> +  int i, j;
> +
> +  for (i = 0; i < n; i++)
> +    for (j = 0; j < n; j++)
> +      A[i][j] = ((DATA_TYPE) i*(j+2) + 2) / n;
> +}
> +
> +
> +/* DCE code. Must scan the entire live-out data.
> +   Can be used also to check the correctness of the output. */
> +static
> +void print_array(int n,
> +		 DATA_TYPE POLYBENCH_2D(A,N,N,n,n))
> +
> +{
> +  int i, j;
> +
> +  for (i = 0; i < n; i++)
> +    for (j = 0; j < n; j++) {
> +      fprintf(stderr, DATA_PRINTF_MODIFIER, A[i][j]);
> +      if ((i * n + j) % 20 == 0) fprintf(stderr, "\n");
> +    }
> +  fprintf(stderr, "\n");
> +}
> +
> +
> +/* Main computational kernel. The whole function will be timed,
> +   including the call and return. */
> +static
> +void kernel_seidel_2d(int tsteps,
> +		      int n,
> +		      DATA_TYPE POLYBENCH_2D(A,N,N,n,n))
> +{
> +  int t, i, j;
> +
> +#pragma scop
> +  for (t = 0; t <= _PB_TSTEPS - 1; t++)
> +    for (i = 1; i<= _PB_N - 2; i++)
> +      for (j = 1; j <= _PB_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)
> +{
> +  /* Retrieve problem size. */
> +  int n = N;
> +  int tsteps = TSTEPS;
> +
> +  /* Variable declaration/allocation. */
> +  POLYBENCH_2D_ARRAY_DECL(A, DATA_TYPE, N, N, n, n);
> +
> +
> +  /* Initialize array(s). */
> +  init_array (n, POLYBENCH_ARRAY(A));
> +
> +  /* Start timer. */
> +  polybench_start_instruments;
> +
> +  /* Run kernel. */
> +  kernel_seidel_2d (tsteps, n, POLYBENCH_ARRAY(A));
> +
> +  /* Stop and print timer. */
> +  polybench_stop_instruments;
> +  polybench_print_instruments;
> +
> +  /* Prevent dead-code elimination. All live-out data must be printed
> +     by the function call in argument. */
> +  polybench_prevent_dce(print_array(n, POLYBENCH_ARRAY(A)));
> +
> +  /* Be clean. */
> +  POLYBENCH_FREE_ARRAY(A);
> +
> +  return 0;
> +}
> 
> Propchange: test-suite/trunk/SingleSource/Benchmarks/Polybench/stencils/seidel-2d/seidel-2d.c
> ------------------------------------------------------------------------------
>    svn:executable = *
> 
> Added: test-suite/trunk/SingleSource/Benchmarks/Polybench/stencils/seidel-2d/seidel-2d.h
> URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/Benchmarks/Polybench/stencils/seidel-2d/seidel-2d.h?rev=159553&view=auto
> ==============================================================================
> --- test-suite/trunk/SingleSource/Benchmarks/Polybench/stencils/seidel-2d/seidel-2d.h (added)
> +++ test-suite/trunk/SingleSource/Benchmarks/Polybench/stencils/seidel-2d/seidel-2d.h Mon Jul  2 14:27:28 2012
> @@ -0,0 +1,54 @@
> +/**
> + * seidel-2d.h: This file is part of the PolyBench/C 3.2 test suite.
> + *
> + *
> + * Contact: Louis-Noel Pouchet <pouchet at cse.ohio-state.edu>
> + * Web address: http://polybench.sourceforge.net
> + */
> +#ifndef SEIDEL_2D_H
> +# define SEIDEL_2D_H
> +
> +/* Default to STANDARD_DATASET. */
> +# if !defined(MINI_DATASET) && !defined(SMALL_DATASET) && !defined(LARGE_DATASET) && !defined(EXTRALARGE_DATASET)
> +#  define STANDARD_DATASET
> +# endif
> +
> +/* Do not define anything if the user manually defines the size. */
> +# if !defined(TSTEPS) && ! defined(N)
> +/* Define the possible dataset sizes. */
> +#  ifdef MINI_DATASET
> +#   define TSTEPS 2
> +#   define N 32
> +#  endif
> +
> +#  ifdef SMALL_DATASET
> +#   define TSTEPS 10
> +#   define N 500
> +#  endif
> +
> +#  ifdef STANDARD_DATASET /* Default if unspecified. */
> +#   define TSTEPS 20
> +#   define N 1000
> +#  endif
> +
> +#  ifdef LARGE_DATASET
> +#   define TSTEPS 20
> +#   define N 2000
> +#  endif
> +
> +#  ifdef EXTRALARGE_DATASET
> +#   define TSTEPS 100
> +#   define N 4000
> +#  endif
> +# endif /* !N */
> +
> +# define _PB_TSTEPS POLYBENCH_LOOP_BOUND(TSTEPS,tsteps)
> +# define _PB_N POLYBENCH_LOOP_BOUND(N,n)
> +
> +# ifndef DATA_TYPE
> +#  define DATA_TYPE double
> +#  define DATA_PRINTF_MODIFIER "%0.2lf "
> +# endif
> +
> +
> +#endif /* !SEIDEL_2D */
> 
> Propchange: test-suite/trunk/SingleSource/Benchmarks/Polybench/stencils/seidel-2d/seidel-2d.h
> ------------------------------------------------------------------------------
>    svn:executable = *
> 
> Added: test-suite/trunk/SingleSource/Benchmarks/Polybench/stencils/seidel-2d/seidel-2d.reference_output
> URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/Benchmarks/Polybench/stencils/seidel-2d/seidel-2d.reference_output?rev=159553&view=auto
> ==============================================================================
> --- test-suite/trunk/SingleSource/Benchmarks/Polybench/stencils/seidel-2d/seidel-2d.reference_output (added)
> +++ test-suite/trunk/SingleSource/Benchmarks/Polybench/stencils/seidel-2d/seidel-2d.reference_output Mon Jul  2 14:27:28 2012
> @@ -0,0 +1 @@
> +73eaf8ec02cd5ecce448f83e00f93d1f
> 
> Propchange: test-suite/trunk/SingleSource/Benchmarks/Polybench/stencils/seidel-2d/seidel-2d.reference_output
> ------------------------------------------------------------------------------
>    svn:executable = *
> 
> Added: test-suite/trunk/SingleSource/Benchmarks/Polybench/utilities/benchmark_list
> URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/Benchmarks/Polybench/utilities/benchmark_list?rev=159553&view=auto
> ==============================================================================
> --- test-suite/trunk/SingleSource/Benchmarks/Polybench/utilities/benchmark_list (added)
> +++ test-suite/trunk/SingleSource/Benchmarks/Polybench/utilities/benchmark_list Mon Jul  2 14:27:28 2012
> @@ -0,0 +1,30 @@
> +./datamining/correlation/correlation.c
> +./datamining/covariance/covariance.c
> +./linear-algebra/kernels/2mm/2mm.c
> +./linear-algebra/kernels/3mm/3mm.c
> +./linear-algebra/kernels/atax/atax.c
> +./linear-algebra/kernels/bicg/bicg.c
> +./linear-algebra/kernels/cholesky/cholesky.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/kernels/mvt/mvt.c
> +./linear-algebra/kernels/symm/symm.c
> +./linear-algebra/kernels/syr2k/syr2k.c
> +./linear-algebra/kernels/syrk/syrk.c
> +./linear-algebra/kernels/trisolv/trisolv.c
> +./linear-algebra/kernels/trmm/trmm.c
> +./linear-algebra/solvers/durbin/durbin.c
> +./linear-algebra/solvers/dynprog/dynprog.c
> +./linear-algebra/solvers/gramschmidt/gramschmidt.c
> +./linear-algebra/solvers/lu/lu.c
> +./linear-algebra/solvers/ludcmp/ludcmp.c
> +./medley/floyd-warshall/floyd-warshall.c
> +./medley/reg_detect/reg_detect.c
> +./stencils/adi/adi.c
> +./stencils/fdtd-2d/fdtd-2d.c
> +./stencils/fdtd-apml/fdtd-apml.c
> +./stencils/jacobi-1d-imper/jacobi-1d-imper.c
> +./stencils/jacobi-2d-imper/jacobi-2d-imper.c
> +./stencils/seidel-2d/seidel-2d.c
> 
> Propchange: test-suite/trunk/SingleSource/Benchmarks/Polybench/utilities/benchmark_list
> ------------------------------------------------------------------------------
>    svn:executable = *
> 
> Added: test-suite/trunk/SingleSource/Benchmarks/Polybench/utilities/create_cpped_version.sh
> URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/Benchmarks/Polybench/utilities/create_cpped_version.sh?rev=159553&view=auto
> ==============================================================================
> --- test-suite/trunk/SingleSource/Benchmarks/Polybench/utilities/create_cpped_version.sh (added)
> +++ test-suite/trunk/SingleSource/Benchmarks/Polybench/utilities/create_cpped_version.sh Mon Jul  2 14:27:28 2012
> @@ -0,0 +1,28 @@
> +#!/bin/sh
> +## create_cpped_version.sh for  in /Users/pouchet
> +##
> +## Made by Louis-Noel Pouchet
> +## Contact: <pouchet at cse.ohio-state.edu>
> +##
> +## Started on  Mon Oct 31 16:20:01 2011 Louis-Noel Pouchet
> +## Last update Mon Oct 31 20:42:35 2011 Louis-Noel Pouchet
> +##
> +
> +if [ $# -lt 1 ]; then
> +    echo "Usage: create_cpped_version.sh <file.c> [gcc -E flags]";
> +    exit 1;
> +fi;
> +args="$2";
> +file="$1";
> +head -n 12 $file > .__poly_top.c;
> +tail -n +12 $file > .__poly_bottom.c;
> +filename=`echo "$file" | sed -e "s/\(.*\).c/\1/1"`;
> +filenameorig=`basename $file`;
> +benchdir=`dirname "$file"`;
> +gcc -E .__poly_bottom.c -I $benchdir $args 2>/dev/null > .__tmp_poly.c
> +sed -e "/^[ ]*;[ ]*$/d" .__tmp_poly.c | sed -e "s~.__poly_bottom.c~$filenameorig~g" > .__poly_bottom.c;
> +cat .__poly_top.c > $filename.preproc.c;
> +echo "#include <polybench.h>\n" >> $filename.preproc.c;
> +cat .__poly_bottom.c >> $filename.preproc.c;
> +rm -f .__tmp_poly.c .__poly_bottom.c .__poly_top.c;
> +
> 
> Propchange: test-suite/trunk/SingleSource/Benchmarks/Polybench/utilities/create_cpped_version.sh
> ------------------------------------------------------------------------------
>    svn:executable = *
> 
> Added: test-suite/trunk/SingleSource/Benchmarks/Polybench/utilities/papi_counters.list
> URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/Benchmarks/Polybench/utilities/papi_counters.list?rev=159553&view=auto
> ==============================================================================
> --- test-suite/trunk/SingleSource/Benchmarks/Polybench/utilities/papi_counters.list (added)
> +++ test-suite/trunk/SingleSource/Benchmarks/Polybench/utilities/papi_counters.list Mon Jul  2 14:27:28 2012
> @@ -0,0 +1,5 @@
> +// Counters must be delimited with ',' including the last one.
> +// C/C++ comments are allowed.
> +// Both native and standard PAPI events are supported.
> +"PAPI_TOT_CYC",
> +"L1D:REPL",
> 
> Propchange: test-suite/trunk/SingleSource/Benchmarks/Polybench/utilities/papi_counters.list
> ------------------------------------------------------------------------------
>    svn:executable = *
> 
> Added: test-suite/trunk/SingleSource/Benchmarks/Polybench/utilities/polybench.c
> URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/Benchmarks/Polybench/utilities/polybench.c?rev=159553&view=auto
> ==============================================================================
> --- test-suite/trunk/SingleSource/Benchmarks/Polybench/utilities/polybench.c (added)
> +++ test-suite/trunk/SingleSource/Benchmarks/Polybench/utilities/polybench.c Mon Jul  2 14:27:28 2012
> @@ -0,0 +1,402 @@
> +/**
> + * polybench.c: This file is part of the PolyBench/C 3.2 test suite.
> + *
> + *
> + * Contact: Louis-Noel Pouchet <pouchet at cse.ohio-state.edu>
> + * Web address: http://polybench.sourceforge.net
> + */
> +#include <stdio.h>
> +#include <string.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>
> +#ifdef _OPENMP
> +# include <omp.h>
> +#endif
> +
> +/* By default, collect PAPI counters on thread 0. */
> +#ifndef POLYBENCH_THREAD_MONITOR
> +# define POLYBENCH_THREAD_MONITOR 0
> +#endif
> +
> +/* Total LLC cache size. By default 32+MB.. */
> +#ifndef POLYBENCH_CACHE_SIZE_KB
> +# define POLYBENCH_CACHE_SIZE_KB 32770
> +#endif
> +
> +
> +int polybench_papi_counters_threadid = POLYBENCH_THREAD_MONITOR;
> +double polybench_program_total_flops = 0;
> +
> +#ifdef POLYBENCH_PAPI
> +# include <papi.h>
> +# define POLYBENCH_MAX_NB_PAPI_COUNTERS 96
> +  char* _polybench_papi_eventlist[] = {
> +#include "papi_counters.list"
> +    NULL
> +  };
> +  int polybench_papi_eventset;
> +  int polybench_papi_eventlist[POLYBENCH_MAX_NB_PAPI_COUNTERS];
> +  long_long polybench_papi_values[POLYBENCH_MAX_NB_PAPI_COUNTERS];
> +
> +#endif
> +
> +
> +/* Timer code (gettimeofday). */
> +double polybench_t_start, polybench_t_end;
> +/* Timer code (RDTSC). */
> +unsigned long long int polybench_c_start, polybench_c_end;
> +
> +static
> +double rtclock()
> +{
> +#ifdef POLYBENCH_TIME
> +    struct timeval Tp;
> +    int stat;
> +    stat = gettimeofday (&Tp, NULL);
> +    if (stat != 0)
> +      printf ("Error return from gettimeofday: %d", stat);
> +    return (Tp.tv_sec + Tp.tv_usec * 1.0e-6);
> +#else
> +    return 0;
> +#endif
> +}
> +
> +
> +#ifdef POLYBENCH_CYCLE_ACCURATE_TIMER
> +static
> +unsigned long long int rdtsc()
> +{
> +  unsigned long long int ret = 0;
> +  unsigned int cycles_lo;
> +  unsigned int cycles_hi;
> +  __asm__ volatile ("RDTSC" : "=a" (cycles_lo), "=d" (cycles_hi));
> +  ret = (unsigned long long int)cycles_hi << 32 | cycles_lo;
> +
> +  return ret;
> +}
> +#endif
> +
> +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;
> +#ifdef _OPENMP
> +#pragma omp parallel for
> +#endif
> +  for (i = 0; i < cs; i++)
> +    tmp += flush[i];
> +  assert (tmp <= 10.0);
> +  free (flush);
> +}
> +
> +
> +#ifdef POLYBENCH_LINUX_FIFO_SCHEDULER
> +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);
> +}
> +
> +
> +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
> +
> +#ifdef POLYBENCH_PAPI
> +
> +static
> +void test_fail(char *file, int line, char *call, int retval)
> +{
> +  char buf[128];
> +
> +  memset(buf, '\0', sizeof(buf));
> +  if (retval != 0)
> +    fprintf (stdout,"%-40s FAILED\nLine # %d\n", file, line);
> +  else
> +    {
> +      fprintf (stdout,"%-40s SKIPPED\n", file);
> +      fprintf (stdout,"Line # %d\n", line);
> +    }
> +  if (retval == PAPI_ESYS)
> +    {
> +      sprintf (buf, "System error in %s", call);
> +      perror (buf);
> +    }
> +  else if (retval > 0)
> +    fprintf (stdout,"Error: %s\n", call);
> +  else if (retval == 0)
> +    fprintf (stdout,"Error: %s\n", call);
> +  else
> +    {
> +      char errstring[PAPI_MAX_STR_LEN];
> +      PAPI_perror (retval, errstring, PAPI_MAX_STR_LEN);
> +      fprintf (stdout,"Error in %s: %s\n", call, errstring);
> +    }
> +  fprintf (stdout,"\n");
> +  if (PAPI_is_initialized ())
> +    PAPI_shutdown ();
> +  exit (1);
> +}
> +
> +
> +void polybench_papi_init()
> +{
> +# ifdef _OPENMP
> +#pragma omp parallel
> +  {
> +#pragma omp master
> +    {
> +      if (omp_get_max_threads () < polybench_papi_counters_threadid)
> +	polybench_papi_counters_threadid = omp_get_max_threads () - 1;
> +    }
> +#pragma omp barrier
> +
> +    if (omp_get_thread_num () == polybench_papi_counters_threadid)
> +      {
> +# endif
> +	int retval;
> +	polybench_papi_eventset = PAPI_NULL;
> +	if ((retval = PAPI_library_init (PAPI_VER_CURRENT)) != PAPI_VER_CURRENT)
> +	  test_fail (__FILE__, __LINE__, "PAPI_library_init", retval);
> +	if ((retval = PAPI_create_eventset (&polybench_papi_eventset))
> +	    != PAPI_OK)
> +	  test_fail (__FILE__, __LINE__, "PAPI_create_eventset", retval);
> +	int k;
> +	for (k = 0; _polybench_papi_eventlist[k]; ++k)
> +	  {
> +	    if ((retval =
> +		 PAPI_event_name_to_code (_polybench_papi_eventlist[k],
> +					  &(polybench_papi_eventlist[k])))
> +		!= PAPI_OK)
> +	      test_fail (__FILE__, __LINE__, "PAPI_event_name_to_code", retval);
> +	  }
> +	polybench_papi_eventlist[k] = 0;
> +
> +
> +# ifdef _OPENMP
> +      }
> +  }
> +#pragma omp barrier
> +# endif
> +}
> +
> +
> +void polybench_papi_close()
> +{
> +# ifdef _OPENMP
> +#pragma omp parallel
> +  {
> +    if (omp_get_thread_num () == polybench_papi_counters_threadid)
> +      {
> +# endif
> +	int retval;
> +	if ((retval = PAPI_destroy_eventset (&polybench_papi_eventset))
> +	    != PAPI_OK)
> +	  test_fail (__FILE__, __LINE__, "PAPI_destroy_eventset", retval);
> +	if (PAPI_is_initialized ())
> +	  PAPI_shutdown ();
> +# ifdef _OPENMP
> +      }
> +  }
> +#pragma omp barrier
> +# endif
> +}
> +
> +int polybench_papi_start_counter(int evid)
> +{
> +# ifndef POLYBENCH_NO_FLUSH_CACHE
> +    polybench_flush_cache();
> +# endif
> +
> +# ifdef _OPENMP
> +# pragma omp parallel
> +  {
> +    if (omp_get_thread_num () == polybench_papi_counters_threadid)
> +      {
> +# endif
> +
> +	int retval = 1;
> +	char descr[PAPI_MAX_STR_LEN];
> +	PAPI_event_info_t evinfo;
> +	PAPI_event_code_to_name (polybench_papi_eventlist[evid], descr);
> +	if (PAPI_add_event (polybench_papi_eventset,
> +			    polybench_papi_eventlist[evid]) != PAPI_OK)
> +	  test_fail (__FILE__, __LINE__, "PAPI_add_event", 1);
> +	if (PAPI_get_event_info (polybench_papi_eventlist[evid], &evinfo)
> +	    != PAPI_OK)
> +	  test_fail (__FILE__, __LINE__, "PAPI_get_event_info", retval);
> +	if ((retval = PAPI_start (polybench_papi_eventset)) != PAPI_OK)
> +	  test_fail (__FILE__, __LINE__, "PAPI_start", retval);
> +# ifdef _OPENMP
> +      }
> +  }
> +#pragma omp barrier
> +# endif
> +  return 0;
> +}
> +
> +
> +void polybench_papi_stop_counter(int evid)
> +{
> +# ifdef _OPENMP
> +# pragma omp parallel
> +  {
> +    if (omp_get_thread_num () == polybench_papi_counters_threadid)
> +      {
> +# endif
> +	int retval;
> +	long_long values[1];
> +	values[0] = 0;
> +	if ((retval = PAPI_read (polybench_papi_eventset, &values[0]))
> +	    != PAPI_OK)
> +	  test_fail (__FILE__, __LINE__, "PAPI_read", retval);
> +
> +	if ((retval = PAPI_stop (polybench_papi_eventset, NULL)) != PAPI_OK)
> +	  test_fail (__FILE__, __LINE__, "PAPI_stop", retval);
> +
> +	polybench_papi_values[evid] = values[0];
> +
> +	if ((retval = PAPI_remove_event
> +	     (polybench_papi_eventset,
> +	      polybench_papi_eventlist[evid])) != PAPI_OK)
> +	  test_fail (__FILE__, __LINE__, "PAPI_remove_event", retval);
> +# ifdef _OPENMP
> +      }
> +  }
> +#pragma omp barrier
> +# endif
> +}
> +
> +
> +void polybench_papi_print()
> +{
> +  int verbose = 0;
> +# ifdef _OPENMP
> +# pragma omp parallel
> +  {
> +    if (omp_get_thread_num() == polybench_papi_counters_threadid)
> +      {
> +#ifdef POLYBENCH_PAPI_VERBOSE
> +	verbose = 1;
> +#endif
> +	if (verbose)
> +	  printf ("On thread %d:\n", polybench_papi_counters_threadid);
> +#endif
> +	int evid;
> +	for (evid = 0; polybench_papi_eventlist[evid] != 0; ++evid)
> +	  {
> +	    if (verbose)
> +	      printf ("%s=", _polybench_papi_eventlist[evid]);
> +	    printf ("%llu ", polybench_papi_values[evid]);
> +	    if (verbose)
> +	      printf ("\n");
> +	  }
> +	printf ("\n");
> +# ifdef _OPENMP
> +      }
> +  }
> +#pragma omp barrier
> +# endif
> +}
> +
> +#endif
> +/* ! POLYBENCH_PAPI */
> +
> +void polybench_prepare_instruments()
> +{
> +#ifndef POLYBENCH_NO_FLUSH_CACHE
> +  polybench_flush_cache ();
> +#endif
> +#ifdef POLYBENCH_LINUX_FIFO_SCHEDULER
> +  polybench_linux_fifo_scheduler ();
> +#endif
> +}
> +
> +
> +void polybench_timer_start()
> +{
> +  polybench_prepare_instruments ();
> +#ifndef POLYBENCH_CYCLE_ACCURATE_TIMER
> +  polybench_t_start = rtclock ();
> +#else
> +  polybench_c_start = rdtsc ();
> +#endif
> +}
> +
> +
> +void polybench_timer_stop()
> +{
> +#ifndef POLYBENCH_CYCLE_ACCURATE_TIMER
> +  polybench_t_end = rtclock ();
> +#else
> +  polybench_c_end = rdtsc ();
> +#endif
> +#ifdef POLYBENCH_LINUX_FIFO_SCHEDULER
> +  polybench_linux_standard_scheduler ();
> +#endif
> +}
> +
> +
> +void polybench_timer_print()
> +{
> +#ifdef POLYBENCH_GFLOPS
> +      if  (__polybench_program_total_flops == 0)
> +	{
> +	  printf ("[PolyBench][WARNING] Program flops not defined, use polybench_set_program_flops(value)\n");
> +	  printf ("%0.6lf\n", polybench_t_end - polybench_t_start);
> +	}
> +      else
> +	printf ("%0.2lf\n",
> +		(__polybench_program_total_flops /
> +		 (double)(polybench_t_end - polybench_t_start)) / 1000000000);
> +#else
> +# ifndef POLYBENCH_CYCLE_ACCURATE_TIMER
> +      printf ("%0.6f\n", polybench_t_end - polybench_t_start);
> +# else
> +      printf ("%Ld\n", polybench_c_end - polybench_c_start);
> +# endif
> +#endif
> +}
> +
> +
> +
> +static
> +void *
> +xmalloc (size_t num)
> +{
> +  void* new = NULL;
> +  int ret = posix_memalign (&new, 32, num);
> +  if (! new || ret)
> +    {
> +      fprintf (stderr, "[PolyBench] posix_memalign: cannot allocate memory");
> +      exit (1);
> +    }
> +  return new;
> +}
> +
> +
> +void* polybench_alloc_data(unsigned long long int n, int elt_size)
> +{
> +  /// FIXME: detect overflow!
> +  size_t val = n;
> +  val *= elt_size;
> +  void* ret = xmalloc (val);
> +
> +  return ret;
> +}
> 
> Propchange: test-suite/trunk/SingleSource/Benchmarks/Polybench/utilities/polybench.c
> ------------------------------------------------------------------------------
>    svn:executable = *
> 
> Added: test-suite/trunk/SingleSource/Benchmarks/Polybench/utilities/polybench.h
> URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/Benchmarks/Polybench/utilities/polybench.h?rev=159553&view=auto
> ==============================================================================
> --- test-suite/trunk/SingleSource/Benchmarks/Polybench/utilities/polybench.h (added)
> +++ test-suite/trunk/SingleSource/Benchmarks/Polybench/utilities/polybench.h Mon Jul  2 14:27:28 2012
> @@ -0,0 +1,611 @@
> +/**
> + * polybench.h: This file is part of the PolyBench/C 3.2 test suite.
> + *
> + *
> + * Contact: Louis-Noel Pouchet <pouchet at cse.ohio-state.edu>
> + * Web address: http://polybench.sourceforge.net
> + */
> +/*
> + * Polybench header for instrumentation.
> + *
> + * Programs must be compiled with `-I utilities utilities/polybench.c'
> + *
> + * Optionally, one can define:
> + *
> + * -DPOLYBENCH_TIME, to report the execution time,
> + *   OR (exclusive):
> + * -DPOLYBENCH_PAPI, to use PAPI H/W counters (defined in polybench.c)
> + *
> + *
> + * See README or utilities/polybench.c for additional options.
> + *
> + */
> +#ifndef POLYBENCH_H
> +# define POLYBENCH_H
> +
> +# include <stdlib.h>
> +
> +/* Array padding. By default, none is used. */
> +# ifndef POLYBENCH_PADDING_FACTOR
> +/* default: */
> +#  define POLYBENCH_PADDING_FACTOR 0
> +# endif
> +
> +
> +/* C99 arrays in function prototype. By default, do not use. */
> +# ifdef POLYBENCH_USE_C99_PROTO
> +#  define POLYBENCH_C99_SELECT(x,y) y
> +# else
> +/* default: */
> +#  define POLYBENCH_C99_SELECT(x,y) x
> +# endif
> +
> +
> +/* Scalar loop bounds in SCoPs. By default, use parametric loop bounds. */
> +# ifdef POLYBENCH_USE_SCALAR_LB
> +#  define POLYBENCH_LOOP_BOUND(x,y) x
> +# else
> +/* default: */
> +#  define POLYBENCH_LOOP_BOUND(x,y) y
> +# endif
> +
> +
> +/* Macros to reference an array. Generic for heap and stack arrays
> +   (C99).  Each array dimensionality has his own macro, to be used at
> +   declaration or as a function argument.
> +   Example:
> +   int b[x] => POLYBENCH_1D_ARRAY(b, x)
> +   int A[N][N] => POLYBENCH_2D_ARRAY(A, N, N)
> +*/
> +# ifndef POLYBENCH_STACK_ARRAYS
> +#  define POLYBENCH_ARRAY(x) *x
> +#  define POLYBENCH_FREE_ARRAY(x) free((void*)x);
> +#  define POLYBENCH_DECL_VAR(x) (*x)
> +# else
> +#  define POLYBENCH_ARRAY(x) x
> +#  define POLYBENCH_FREE_ARRAY(x)
> +#  define POLYBENCH_DECL_VAR(x) x
> +# endif
> +/* Macros for using arrays in the function prototypes. */
> +# define POLYBENCH_1D(var, dim1,ddim1) var[POLYBENCH_C99_SELECT(dim1,ddim1) + POLYBENCH_PADDING_FACTOR]
> +# define POLYBENCH_2D(var, dim1, dim2, ddim1, ddim2) var[POLYBENCH_C99_SELECT(dim1,ddim1) + POLYBENCH_PADDING_FACTOR][POLYBENCH_C99_SELECT(dim2,ddim2) + POLYBENCH_PADDING_FACTOR]
> +# define POLYBENCH_3D(var, dim1, dim2, dim3, ddim1, ddim2, ddim3) var[POLYBENCH_C99_SELECT(dim1,ddim1) + POLYBENCH_PADDING_FACTOR][POLYBENCH_C99_SELECT(dim2,ddim2) + POLYBENCH_PADDING_FACTOR][POLYBENCH_C99_SELECT(dim3,ddim3) + POLYBENCH_PADDING_FACTOR]
> +# define POLYBENCH_4D(var, dim1, dim2, dim3, dim4, ddim1, ddim2, ddim3, ddim4) var[POLYBENCH_C99_SELECT(dim1,ddim1) + POLYBENCH_PADDING_FACTOR][POLYBENCH_C99_SELECT(dim2,ddim2) + POLYBENCH_PADDING_FACTOR][POLYBENCH_C99_SELECT(dim3,ddim3) + POLYBENCH_PADDING_FACTOR][POLYBENCH_C99_SELECT(dim4,ddim4) + POLYBENCH_PADDING_FACTOR]
> +# define POLYBENCH_5D(var, dim1, dim2, dim3, dim4, dim5, ddim1, ddim2, ddim3, ddim4, ddim5) var[POLYBENCH_C99_SELECT(dim1,ddim1) + POLYBENCH_PADDING_FACTOR][POLYBENCH_C99_SELECT(dim2,ddim2) + POLYBENCH_PADDING_FACTOR][POLYBENCH_C99_SELECT(dim3,ddim3) + POLYBENCH_PADDING_FACTOR][POLYBENCH_C99_SELECT(dim4,ddim4) + POLYBENCH_PADDING_FACTOR][POLYBENCH_C99_SELECT(dim5,ddim5) + POLYBENCH_PADDING_FACTOR]
> +
> +
> +/* Macros to allocate heap arrays.
> +   Example:
> +   polybench_alloc_2d_array(N, M, double) => allocates N x M x sizeof(double)
> +					  and returns a pointer to the 2d array
> + */
> +# define POLYBENCH_ALLOC_1D_ARRAY(n1, type)	\
> +  (type(*)[n1 + POLYBENCH_PADDING_FACTOR])polybench_alloc_data (n1 + POLYBENCH_PADDING_FACTOR, sizeof(type))
> +# define POLYBENCH_ALLOC_2D_ARRAY(n1, n2, type)		\
> +  (type(*)[n1 + POLYBENCH_PADDING_FACTOR][n2 + POLYBENCH_PADDING_FACTOR])polybench_alloc_data ((n1 + POLYBENCH_PADDING_FACTOR) * (n2 + POLYBENCH_PADDING_FACTOR), sizeof(type))
> +# define POLYBENCH_ALLOC_3D_ARRAY(n1, n2, n3, type)		\
> +  (type(*)[n1 + POLYBENCH_PADDING_FACTOR][n2 + POLYBENCH_PADDING_FACTOR][n3 + POLYBENCH_PADDING_FACTOR])polybench_alloc_data ((n1 + POLYBENCH_PADDING_FACTOR) * (n2 + POLYBENCH_PADDING_FACTOR) * (n3 + POLYBENCH_PADDING_FACTOR), sizeof(type))
> +# define POLYBENCH_ALLOC_4D_ARRAY(n1, n2, n3, n4, type)			\
> +  (type(*)[n1 + POLYBENCH_PADDING_FACTOR][n2 + POLYBENCH_PADDING_FACTOR][n3 + POLYBENCH_PADDING_FACTOR][n4 + POLYBENCH_PADDING_FACTOR])polybench_alloc_data ((n1 + POLYBENCH_PADDING_FACTOR) * (n2 + POLYBENCH_PADDING_FACTOR) * (n3 + POLYBENCH_PADDING_FACTOR) * (n4 + POLYBENCH_PADDING_FACTOR), sizeof(type))
> +# define POLYBENCH_ALLOC_5D_ARRAY(n1, n2, n3, n4, n5, type)		\
> +  (type(*)[n1 + POLYBENCH_PADDING_FACTOR][n2 + POLYBENCH_PADDING_FACTOR][n3 + POLYBENCH_PADDING_FACTOR][n4 + POLYBENCH_PADDING_FACTOR][n5 + POLYBENCH_PADDING_FACTOR])polybench_alloc_data ((n1 + POLYBENCH_PADDING_FACTOR) * (n2 + POLYBENCH_PADDING_FACTOR) * (n3 + POLYBENCH_PADDING_FACTOR) * (n4 + POLYBENCH_PADDING_FACTOR) * (n5 + POLYBENCH_PADDING_FACTOR), sizeof(type))
> +
> +/* Macros for array declaration. */
> +# ifndef POLYBENCH_STACK_ARRAYS
> +#  define POLYBENCH_1D_ARRAY_DECL(var, type, dim1, ddim1)		\
> +  type POLYBENCH_1D(POLYBENCH_DECL_VAR(var), dim1, ddim1); \
> +  var = POLYBENCH_ALLOC_1D_ARRAY(POLYBENCH_C99_SELECT(dim1, ddim1), type);
> +#  define POLYBENCH_2D_ARRAY_DECL(var, type, dim1, dim2, ddim1, ddim2)	\
> +  type POLYBENCH_2D(POLYBENCH_DECL_VAR(var), dim1, dim2, ddim1, ddim2); \
> +  var = POLYBENCH_ALLOC_2D_ARRAY(POLYBENCH_C99_SELECT(dim1, ddim1), POLYBENCH_C99_SELECT(dim2, ddim2), type);
> +#  define POLYBENCH_3D_ARRAY_DECL(var, type, dim1, dim2, dim3, ddim1, ddim2, ddim3) \
> +  type POLYBENCH_3D(POLYBENCH_DECL_VAR(var), dim1, dim2, dim3, ddim1, ddim2, ddim3); \
> +  var = POLYBENCH_ALLOC_3D_ARRAY(POLYBENCH_C99_SELECT(dim1, ddim1), POLYBENCH_C99_SELECT(dim2, ddim2), POLYBENCH_C99_SELECT(dim3, ddim3), type);
> +#  define POLYBENCH_4D_ARRAY_DECL(var, type, dim1, dim2, dim3, dim4, ddim1, ddim2, ddim3, ddim4) \
> +  type POLYBENCH_4D(POLYBENCH_DECL_VAR(var), dim1, dim2, ,dim3, dim4, ddim1, ddim2, ddim3, ddim4); \
> +  var = POLYBENCH_ALLOC_4D_ARRAY(POLYBENCH_C99_SELECT(dim1, ddim1), POLYBENCH_C99_SELECT(dim2, ddim2), POLYBENCH_C99_SELECT(dim3, ddim3), POLYBENCH_C99_SELECT(dim4, ddim4), type);
> +#  define POLYBENCH_5D_ARRAY_DECL(var, type, dim1, dim2, dim3, dim4, dim5, ddim1, ddim2, ddim3, ddim4, ddim5) \
> +  type POLYBENCH_5D(POLYBENCH_DECL_VAR(var), dim1, dim2, dim3, dim4, dim5, ddim1, ddim2, ddim3, ddim4, ddim5); \
> +  var = POLYBENCH_ALLOC_5D_ARRAY(POLYBENCH_C99_SELECT(dim1, ddim1), POLYBENCH_C99_SELECT(dim2, ddim2), POLYBENCH_C99_SELECT(dim3, ddim3), POLYBENCH_C99_SELECT(dim4, ddim4), POLYBENCH_C99_SELECT(dim5, ddim5), type);
> +# else
> +#  define POLYBENCH_1D_ARRAY_DECL(var, type, dim1, ddim1)		\
> +  type POLYBENCH_1D(POLYBENCH_DECL_VAR(var), dim1, ddim1);
> +#  define POLYBENCH_2D_ARRAY_DECL(var, type, dim1, dim2, ddim1, ddim2)	\
> +  type POLYBENCH_2D(POLYBENCH_DECL_VAR(var), dim1, dim2, ddim1, ddim2);
> +#  define POLYBENCH_3D_ARRAY_DECL(var, type, dim1, dim2, dim3, ddim1, ddim2, ddim3) \
> +  type POLYBENCH_3D(POLYBENCH_DECL_VAR(var), dim1, dim2, dim3, ddim1, ddim2, ddim3);
> +#  define POLYBENCH_4D_ARRAY_DECL(var, type, dim1, dim2, dim3, dim4, ddim1, ddim2, ddim3, ddim4) \
> +  type POLYBENCH_4D(POLYBENCH_DECL_VAR(var), dim1, dim2, dim3, dim4, ddim1, ddim2, ddim3, ddim4);
> +#  define POLYBENCH_5D_ARRAY_DECL(var, type, dim1, dim2, dim3, dim4, dim5, ddim1, ddim2, ddim3, ddim4, ddim5) \
> +  type POLYBENCH_5D(POLYBENCH_DECL_VAR(var), dim1, dim2, dim3, dim4, dim5, ddim1, ddim2, ddim3, ddim4, ddim5);
> +# endif
> +
> +
> +/* Dead-code elimination macros. Use argc/argv for the run-time check. */
> +# ifndef POLYBENCH_DUMP_ARRAYS
> +#  define POLYBENCH_DCE_ONLY_CODE    if (argc > 42 && ! strcmp(argv[0], ""))
> +# else
> +#  define POLYBENCH_DCE_ONLY_CODE
> +# endif
> +
> +# define polybench_prevent_dce(func)		\
> +  POLYBENCH_DCE_ONLY_CODE			\
> +  func
> +
> +
> +/* Performance-related instrumentation. See polybench.c */
> +# define polybench_start_instruments
> +# define polybench_stop_instruments
> +# define polybench_print_instruments
> +
> +
> +/* PAPI support. */
> +# ifdef POLYBENCH_PAPI
> +extern const unsigned int polybench_papi_eventlist[];
> +#  undef polybench_start_instruments
> +#  undef polybench_stop_instruments
> +#  undef polybench_print_instruments
> +#  define polybench_set_papi_thread_report(x)	\
> +   polybench_papi_counters_threadid = x;
> +#  define polybench_start_instruments				\
> +  polybench_prepare_instruments();				\
> +  polybench_papi_init();					\
> +  int evid;							\
> +  for (evid = 0; polybench_papi_eventlist[evid] != 0; evid++)	\
> +    {								\
> +      if (polybench_papi_start_counter(evid))			\
> +	continue;						\
> +
> +#  define polybench_stop_instruments		\
> +      polybench_papi_stop_counter(evid);	\
> +    }						\
> +  polybench_papi_close();			\
> +
> +#  define polybench_print_instruments polybench_papi_print();
> +# endif
> +
> +
> +/* Timing support. */
> +# if defined(POLYBENCH_TIME) || defined(POLYBENCH_GFLOPS)
> +#  undef polybench_start_instruments
> +#  undef polybench_stop_instruments
> +#  undef polybench_print_instruments
> +#  define polybench_start_instruments polybench_timer_start();
> +#  define polybench_stop_instruments polybench_timer_stop();
> +#  define polybench_print_instruments polybench_timer_print();
> +extern double polybench_program_total_flops;
> +extern void polybench_timer_start();
> +extern void polybench_timer_stop();
> +extern void polybench_timer_print();
> +# endif
> +
> +/* Function declaration. */
> +# ifdef POLYBENCH_TIME
> +extern void polybench_timer_start();
> +extern void polybench_timer_stop();
> +extern void polybench_timer_print();
> +# endif
> +
> +# ifdef POLYBENCH_PAPI
> +extern void polybench_prepare_instruments();
> +extern int polybench_papi_start_counter(int evid);
> +extern void polybench_papi_stop_counter(int evid);
> +extern void polybench_papi_init();
> +extern void polybench_papi_close();
> +extern void polybench_papi_print();
> +# endif
> +
> +/* Function prototypes. */
> +extern void* polybench_alloc_data(unsigned long long int n, int elt_size);
> +
> +/*
> + LLVM: I'm appending the content of the file polybench.c here. It'll avoid us
> +       to have to copy it to the folder being compiled in the LLVM test suite.
> + */
> +
> +/**
> + * polybench.c: This file is part of the PolyBench/C 3.2 test suite.
> + *
> + *
> + * Contact: Louis-Noel Pouchet <pouchet at cse.ohio-state.edu>
> + * Web address: http://polybench.sourceforge.net
> + */
> +#include <stdio.h>
> +#include <string.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>
> +#ifdef _OPENMP
> +# include <omp.h>
> +#endif
> +
> +/* By default, collect PAPI counters on thread 0. */
> +#ifndef POLYBENCH_THREAD_MONITOR
> +# define POLYBENCH_THREAD_MONITOR 0
> +#endif
> +
> +/* Total LLC cache size. By default 32+MB.. */
> +#ifndef POLYBENCH_CACHE_SIZE_KB
> +# define POLYBENCH_CACHE_SIZE_KB 32770
> +#endif
> +
> +
> +int polybench_papi_counters_threadid = POLYBENCH_THREAD_MONITOR;
> +double polybench_program_total_flops = 0;
> +
> +#ifdef POLYBENCH_PAPI
> +# include <papi.h>
> +# define POLYBENCH_MAX_NB_PAPI_COUNTERS 96
> +char* _polybench_papi_eventlist[] = {
> +#include "papi_counters.list"
> +  NULL
> +};
> +int polybench_papi_eventset;
> +int polybench_papi_eventlist[POLYBENCH_MAX_NB_PAPI_COUNTERS];
> +long_long polybench_papi_values[POLYBENCH_MAX_NB_PAPI_COUNTERS];
> +
> +#endif
> +
> +
> +/* Timer code (gettimeofday). */
> +double polybench_t_start, polybench_t_end;
> +/* Timer code (RDTSC). */
> +unsigned long long int polybench_c_start, polybench_c_end;
> +
> +static
> +double rtclock()
> +{
> +#ifdef POLYBENCH_TIME
> +  struct timeval Tp;
> +  int stat;
> +  stat = gettimeofday (&Tp, NULL);
> +  if (stat != 0)
> +    printf ("Error return from gettimeofday: %d", stat);
> +  return (Tp.tv_sec + Tp.tv_usec * 1.0e-6);
> +#else
> +  return 0;
> +#endif
> +}
> +
> +
> +#ifdef POLYBENCH_CYCLE_ACCURATE_TIMER
> +static
> +unsigned long long int rdtsc()
> +{
> +  unsigned long long int ret = 0;
> +  unsigned int cycles_lo;
> +  unsigned int cycles_hi;
> +  __asm__ volatile ("RDTSC" : "=a" (cycles_lo), "=d" (cycles_hi));
> +  ret = (unsigned long long int)cycles_hi << 32 | cycles_lo;
> +  
> +  return ret;
> +}
> +#endif
> +
> +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;
> +#ifdef _OPENMP
> +#pragma omp parallel for
> +#endif
> +  for (i = 0; i < cs; i++)
> +    tmp += flush[i];
> +  assert (tmp <= 10.0);
> +  free (flush);
> +}
> +
> +
> +#ifdef POLYBENCH_LINUX_FIFO_SCHEDULER
> +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);
> +}
> +
> +
> +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
> +
> +#ifdef POLYBENCH_PAPI
> +
> +static
> +void test_fail(char *file, int line, char *call, int retval)
> +{
> +  char buf[128];
> +  
> +  memset(buf, '\0', sizeof(buf));
> +  if (retval != 0)
> +    fprintf (stdout,"%-40s FAILED\nLine # %d\n", file, line);
> +  else
> +  {
> +    fprintf (stdout,"%-40s SKIPPED\n", file);
> +    fprintf (stdout,"Line # %d\n", line);
> +  }
> +  if (retval == PAPI_ESYS)
> +  {
> +    sprintf (buf, "System error in %s", call);
> +    perror (buf);
> +  }
> +  else if (retval > 0)
> +    fprintf (stdout,"Error: %s\n", call);
> +  else if (retval == 0)
> +    fprintf (stdout,"Error: %s\n", call);
> +  else
> +  {
> +    char errstring[PAPI_MAX_STR_LEN];
> +    PAPI_perror (retval, errstring, PAPI_MAX_STR_LEN);
> +    fprintf (stdout,"Error in %s: %s\n", call, errstring);
> +  }
> +  fprintf (stdout,"\n");
> +  if (PAPI_is_initialized ())
> +    PAPI_shutdown ();
> +  exit (1);
> +}
> +
> +
> +void polybench_papi_init()
> +{
> +# ifdef _OPENMP
> +#pragma omp parallel
> +  {
> +#pragma omp master
> +    {
> +      if (omp_get_max_threads () < polybench_papi_counters_threadid)
> +        polybench_papi_counters_threadid = omp_get_max_threads () - 1;
> +    }
> +#pragma omp barrier
> +    
> +    if (omp_get_thread_num () == polybench_papi_counters_threadid)
> +    {
> +# endif
> +      int retval;
> +      polybench_papi_eventset = PAPI_NULL;
> +      if ((retval = PAPI_library_init (PAPI_VER_CURRENT)) != PAPI_VER_CURRENT)
> +        test_fail (__FILE__, __LINE__, "PAPI_library_init", retval);
> +      if ((retval = PAPI_create_eventset (&polybench_papi_eventset))
> +          != PAPI_OK)
> +        test_fail (__FILE__, __LINE__, "PAPI_create_eventset", retval);
> +      int k;
> +      for (k = 0; _polybench_papi_eventlist[k]; ++k)
> +      {
> +        if ((retval =
> +             PAPI_event_name_to_code (_polybench_papi_eventlist[k],
> +                                      &(polybench_papi_eventlist[k])))
> +            != PAPI_OK)
> +          test_fail (__FILE__, __LINE__, "PAPI_event_name_to_code", retval);
> +      }
> +      polybench_papi_eventlist[k] = 0;
> +      
> +      
> +# ifdef _OPENMP
> +    }
> +  }
> +#pragma omp barrier
> +# endif
> +}
> +
> +
> +void polybench_papi_close()
> +{
> +# ifdef _OPENMP
> +#pragma omp parallel
> +  {
> +    if (omp_get_thread_num () == polybench_papi_counters_threadid)
> +    {
> +# endif
> +      int retval;
> +      if ((retval = PAPI_destroy_eventset (&polybench_papi_eventset))
> +          != PAPI_OK)
> +        test_fail (__FILE__, __LINE__, "PAPI_destroy_eventset", retval);
> +      if (PAPI_is_initialized ())
> +        PAPI_shutdown ();
> +# ifdef _OPENMP
> +    }
> +  }
> +#pragma omp barrier
> +# endif
> +}
> +
> +int polybench_papi_start_counter(int evid)
> +{
> +# ifndef POLYBENCH_NO_FLUSH_CACHE
> +  polybench_flush_cache();
> +# endif
> +  
> +# ifdef _OPENMP
> +# pragma omp parallel
> +  {
> +    if (omp_get_thread_num () == polybench_papi_counters_threadid)
> +    {
> +# endif
> +      
> +      int retval = 1;
> +      char descr[PAPI_MAX_STR_LEN];
> +      PAPI_event_info_t evinfo;
> +      PAPI_event_code_to_name (polybench_papi_eventlist[evid], descr);
> +      if (PAPI_add_event (polybench_papi_eventset,
> +                          polybench_papi_eventlist[evid]) != PAPI_OK)
> +        test_fail (__FILE__, __LINE__, "PAPI_add_event", 1);
> +      if (PAPI_get_event_info (polybench_papi_eventlist[evid], &evinfo)
> +          != PAPI_OK)
> +        test_fail (__FILE__, __LINE__, "PAPI_get_event_info", retval);
> +      if ((retval = PAPI_start (polybench_papi_eventset)) != PAPI_OK)
> +        test_fail (__FILE__, __LINE__, "PAPI_start", retval);
> +# ifdef _OPENMP
> +    }
> +  }
> +#pragma omp barrier
> +# endif
> +  return 0;
> +}
> +
> +
> +void polybench_papi_stop_counter(int evid)
> +{
> +# ifdef _OPENMP
> +# pragma omp parallel
> +  {
> +    if (omp_get_thread_num () == polybench_papi_counters_threadid)
> +    {
> +# endif
> +      int retval;
> +      long_long values[1];
> +      values[0] = 0;
> +      if ((retval = PAPI_read (polybench_papi_eventset, &values[0]))
> +          != PAPI_OK)
> +        test_fail (__FILE__, __LINE__, "PAPI_read", retval);
> +      
> +      if ((retval = PAPI_stop (polybench_papi_eventset, NULL)) != PAPI_OK)
> +        test_fail (__FILE__, __LINE__, "PAPI_stop", retval);
> +      
> +      polybench_papi_values[evid] = values[0];
> +      
> +      if ((retval = PAPI_remove_event
> +           (polybench_papi_eventset,
> +            polybench_papi_eventlist[evid])) != PAPI_OK)
> +        test_fail (__FILE__, __LINE__, "PAPI_remove_event", retval);
> +# ifdef _OPENMP
> +    }
> +  }
> +#pragma omp barrier
> +# endif
> +}
> +
> +
> +void polybench_papi_print()
> +{
> +  int verbose = 0;
> +# ifdef _OPENMP
> +# pragma omp parallel
> +  {
> +    if (omp_get_thread_num() == polybench_papi_counters_threadid)
> +    {
> +#ifdef POLYBENCH_PAPI_VERBOSE
> +      verbose = 1;
> +#endif
> +      if (verbose)
> +        printf ("On thread %d:\n", polybench_papi_counters_threadid);
> +#endif
> +      int evid;
> +      for (evid = 0; polybench_papi_eventlist[evid] != 0; ++evid)
> +      {
> +        if (verbose)
> +          printf ("%s=", _polybench_papi_eventlist[evid]);
> +        printf ("%llu ", polybench_papi_values[evid]);
> +        if (verbose)
> +          printf ("\n");
> +      }
> +      printf ("\n");
> +# ifdef _OPENMP
> +    }
> +  }
> +#pragma omp barrier
> +# endif
> +}
> +
> +#endif
> +/* ! POLYBENCH_PAPI */
> +
> +void polybench_prepare_instruments()
> +{
> +#ifndef POLYBENCH_NO_FLUSH_CACHE
> +  polybench_flush_cache ();
> +#endif
> +#ifdef POLYBENCH_LINUX_FIFO_SCHEDULER
> +  polybench_linux_fifo_scheduler ();
> +#endif
> +}
> +
> +
> +void polybench_timer_start()
> +{
> +  polybench_prepare_instruments ();
> +#ifndef POLYBENCH_CYCLE_ACCURATE_TIMER
> +  polybench_t_start = rtclock ();
> +#else
> +  polybench_c_start = rdtsc ();
> +#endif
> +}
> +
> +
> +void polybench_timer_stop()
> +{
> +#ifndef POLYBENCH_CYCLE_ACCURATE_TIMER
> +  polybench_t_end = rtclock ();
> +#else
> +  polybench_c_end = rdtsc ();
> +#endif
> +#ifdef POLYBENCH_LINUX_FIFO_SCHEDULER
> +  polybench_linux_standard_scheduler ();
> +#endif
> +}
> +
> +
> +void polybench_timer_print()
> +{
> +#ifdef POLYBENCH_GFLOPS
> +  if  (__polybench_program_total_flops == 0)
> +	{
> +	  printf ("[PolyBench][WARNING] Program flops not defined, use polybench_set_program_flops(value)\n");
> +	  printf ("%0.6lf\n", polybench_t_end - polybench_t_start);
> +	}
> +  else
> +    printf ("%0.2lf\n",
> +            (__polybench_program_total_flops /
> +             (double)(polybench_t_end - polybench_t_start)) / 1000000000);
> +#else
> +# ifndef POLYBENCH_CYCLE_ACCURATE_TIMER
> +  printf ("%0.6f\n", polybench_t_end - polybench_t_start);
> +# else
> +  printf ("%Ld\n", polybench_c_end - polybench_c_start);
> +# endif
> +#endif
> +}
> +
> +
> +
> +static
> +void *
> +xmalloc (size_t num)
> +{
> +  void* new = NULL;
> +  int ret = posix_memalign (&new, 32, num);
> +  if (! new || ret)
> +  {
> +    fprintf (stderr, "[PolyBench] posix_memalign: cannot allocate memory");
> +    exit (1);
> +  }
> +  return new;
> +}
> +
> +
> +void* polybench_alloc_data(unsigned long long int n, int elt_size)
> +{
> +  /// FIXME: detect overflow!
> +  size_t val = n;
> +  val *= elt_size;
> +  void* ret = xmalloc (val);
> +  
> +  return ret;
> +}
> +
> +
> +
> +#endif /* !POLYBENCH_H */
> 
> Propchange: test-suite/trunk/SingleSource/Benchmarks/Polybench/utilities/polybench.h
> ------------------------------------------------------------------------------
>    svn:executable = *
> 
> Added: test-suite/trunk/SingleSource/Benchmarks/Polybench/utilities/template-for-new-benchmark.c
> URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/Benchmarks/Polybench/utilities/template-for-new-benchmark.c?rev=159553&view=auto
> ==============================================================================
> --- test-suite/trunk/SingleSource/Benchmarks/Polybench/utilities/template-for-new-benchmark.c (added)
> +++ test-suite/trunk/SingleSource/Benchmarks/Polybench/utilities/template-for-new-benchmark.c Mon Jul  2 14:27:28 2012
> @@ -0,0 +1,94 @@
> +/**
> + * template.c: This file is part of the PolyBench/C 3.2 test suite.
> + *
> + *
> + * Contact: Louis-Noel Pouchet <pouchet at cse.ohio-state.edu>
> + * Web address: http://polybench.sourceforge.net
> + */
> +#include <stdio.h>
> +#include <unistd.h>
> +#include <string.h>
> +#include <math.h>
> +
> +/* Include polybench common header. */
> +#include <polybench.h>
> +
> +/* Include benchmark-specific header. */
> +/* Default data type is double, default size is N=1024. */
> +#include "template-for-new-benchmark.h"
> +
> +
> +/* Array initialization. */
> +static
> +void init_array(int n, DATA_TYPE POLYBENCH_2D(C,N,N,n,n))
> +{
> +  int i, j;
> +
> +  for (i = 0; i < n; i++)
> +    for (j = 0; j < n; j++)
> +      C[i][j] = 42;
> +}
> +
> +
> +/* DCE code. Must scan the entire live-out data.
> +   Can be used also to check the correctness of the output. */
> +static
> +void print_array(int n, DATA_TYPE POLYBENCH_2D(C,N,N,n,n))
> +{
> +  int i, j;
> +
> +  for (i = 0; i < n; i++)
> +    for (j = 0; j < n; j++) {
> +	fprintf (stderr, DATA_PRINTF_MODIFIER, C[i][j]);
> +	if (i % 20 == 0) fprintf (stderr, "\n");
> +    }
> +  fprintf (stderr, "\n");
> +}
> +
> +
> +/* Main computational kernel. The whole function will be timed,
> +   including the call and return. */
> +static
> +void kernel_template(int n, DATA_TYPE POLYBENCH_2D(C,N,N,n,n))
> +{
> +  int i, j;
> +
> +#pragma scop
> +  for (i = 0; i < _PB_N; i++)
> +    for (j = 0; j < _PB_N; j++)
> +      C[i][j] += 42;
> +#pragma endscop
> +
> +}
> +
> +
> +int main(int argc, char** argv)
> +{
> +  /* Retrieve problem size. */
> +  int n = N;
> +
> +  /* Variable declaration/allocation. */
> +  POLYBENCH_2D_ARRAY_DECL(C,DATA_TYPE,N,N,n,n);
> +
> +  /* Initialize array(s). */
> +  init_array (n, POLYBENCH_ARRAY(C));
> +
> +  /* Start timer. */
> +  polybench_start_instruments;
> +
> +  /* Run kernel. */
> +  kernel_template (n, POLYBENCH_ARRAY(C));
> +
> +  /* Stop and print timer. */
> +  polybench_stop_instruments;
> +  polybench_print_instruments;
> +
> +  /* Prevent dead-code elimination. All live-out data must be printed
> +     by the function call in argument. */
> +  polybench_prevent_dce(print_array(n,  POLYBENCH_ARRAY(C)));
> +
> +  /* Be clean. */
> +  POLYBENCH_FREE_ARRAY(C);
> +
> +  return 0;
> +}
> 
> Propchange: test-suite/trunk/SingleSource/Benchmarks/Polybench/utilities/template-for-new-benchmark.c
> ------------------------------------------------------------------------------
>    svn:executable = *
> 
> Added: test-suite/trunk/SingleSource/Benchmarks/Polybench/utilities/template-for-new-benchmark.h
> URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/Benchmarks/Polybench/utilities/template-for-new-benchmark.h?rev=159553&view=auto
> ==============================================================================
> --- test-suite/trunk/SingleSource/Benchmarks/Polybench/utilities/template-for-new-benchmark.h (added)
> +++ test-suite/trunk/SingleSource/Benchmarks/Polybench/utilities/template-for-new-benchmark.h Mon Jul  2 14:27:28 2012
> @@ -0,0 +1,48 @@
> +/**
> + * template.h: This file is part of the PolyBench/C 3.2 test suite.
> + *
> + *
> + * Contact: Louis-Noel Pouchet <pouchet at cse.ohio-state.edu>
> + * Web address: http://polybench.sourceforge.net
> + */
> +#ifndef TEMPLATE_H
> +# define TEMPLATE_H
> +
> +/* Default to STANDARD_DATASET. */
> +# if !defined(MINI_DATASET) && !defined(SMALL_DATASET) && !defined(LARGE_DATASET) && !defined(EXTRALARGE_DATASET)
> +#  define STANDARD_DATASET
> +# endif
> +
> +/* Do not define anything if the user manually defines the size. */
> +# if !defined(N)
> +/* Define the possible dataset sizes. */
> +#  ifdef MINI_DATASET
> +#   define N 32
> +#  endif
> +
> +#  ifdef SMALL_DATASET
> +#   define N 128
> +#  endif
> +
> +#  ifdef STANDARD_DATASET /* Default if unspecified. */
> +#   define N 1024
> +#  endif
> +
> +#  ifdef LARGE_DATASET
> +#   define N 2000
> +#  endif
> +
> +#  ifdef EXTRALARGE_DATASET
> +#   define N 4000
> +#  endif
> +# endif /* !N */
> +
> +# define _PB_N POLYBENCH_LOOP_BOUND(N,n)
> +
> +# ifndef DATA_TYPE
> +#  define DATA_TYPE double
> +#  define DATA_PRINTF_MODIFIER "%0.2lf "
> +# endif
> +
> +
> +#endif /* !TEMPLATE */
> 
> Propchange: test-suite/trunk/SingleSource/Benchmarks/Polybench/utilities/template-for-new-benchmark.h
> ------------------------------------------------------------------------------
>    svn:executable = *
> 
> Added: test-suite/trunk/SingleSource/Benchmarks/Polybench/utilities/time_benchmark.sh
> URL: http://llvm.org/viewvc/llvm-project/test-suite/trunk/SingleSource/Benchmarks/Polybench/utilities/time_benchmark.sh?rev=159553&view=auto
> ==============================================================================
> --- test-suite/trunk/SingleSource/Benchmarks/Polybench/utilities/time_benchmark.sh (added)
> +++ test-suite/trunk/SingleSource/Benchmarks/Polybench/utilities/time_benchmark.sh Mon Jul  2 14:27:28 2012
> @@ -0,0 +1,78 @@
> +#!/bin/sh
> +## time_benchmark.sh for  in /Users/pouchet
> +##
> +## Made by Louis-Noel Pouchet
> +## Contact: <pouchet at cse.ohio-state.edu>
> +##
> +## Started on  Sat Oct 29 00:03:48 2011 Louis-Noel Pouchet
> +## Last update Sat Oct 29 01:16:34 2011 Louis-Noel Pouchet
> +##
> +
> +## Maximal variance accepted between the 3 median runs for performance results.
> +## Here 5%
> +VARIANCE_ACCEPTED=5;
> +
> +if [ $# -ne 1 ]; then
> +    echo "Usage: ./time_benchmarh.sh <binary_name>";
> +    echo "Example: ./time_benchmarh.sh \"./a.out\"";
> +    echo "Note: the file must be a Polybench program compiled with -DPOLYBENCH_TIME";
> +    exit 1;
> +fi;
> +
> +
> +compute_mean_exec_time()
> +{
> +    file="$1";
> +    benchcomputed="$2";
> +    cat "$file" | grep "[0-9]\+" | sort -n | head -n 4 | tail -n 3 > avg.out;
> +    expr="(0";
> +    while read n; do
> +	expr="$expr+$n";
> +    done < avg.out;
> +    time=`echo "scale=8;$expr)/3" | bc`;
> +    tmp=`echo "$time" | cut -d '.' -f 1`;
> +    if [ -z "$tmp" ]; then
> +	time="0$time";
> +    fi;
> +    val1=`cat avg.out | head -n 1`;
> +    val2=`cat avg.out | head -n 2 | tail -n 1`;
> +    val3=`cat avg.out | head -n 3 | tail -n 1`;
> +    val11=`echo "a=$val1 - $time;if(0>a)a*=-1;a" | bc 2>&1`;
> +    test_err=`echo "$val11" | grep error`;
> +    if ! [ -z "$test_err" ]; then
> +	echo "[ERROR] Program output does not match expected single-line with time.";
> +	echo "[ERROR] The program must be a PolyBench, compiled with -DPOLYBENCH_TIME";
> +	exit 1;
> +    fi;
> +    val12=`echo "a=$val2 - $time;if(0>a)a*=-1;a" | bc`;
> +    val13=`echo "a=$val3 - $time;if(0>a)a*=-1;a" | bc`;
> +    myvar=`echo "$val11 $val12 $val13" | awk '{ if ($1 > $2) { if ($1 > $3) print $1; else print $3; } else { if ($2 > $3) print $2; else print $3; } }'`;
> +    variance=`echo "scale=5;($myvar/$time)*100" | bc`;
> +    tmp=`echo "$variance" | cut -d '.' -f 1`;
> +    if [ -z "$tmp" ]; then
> +	variance="0$variance";
> +    fi;
> +    compvar=`echo "$variance $VARIANCE_ACCEPTED" | awk '{ if ($1 < $2) print "ok"; else print "error"; }'`;
> +    if [ "$compvar" = "error" ]; then
> +	$ECHO_CMD "\033[31m[WARNING]\033[0m Variance is above thresold, unsafe performance measurement";
> +	$ECHO_CMD "        => max deviation=$variance%, tolerance=$VARIANCE_ACCEPTED%";
> +	WARNING_VARIANCE="$WARNING_VARIANCE\n$benchcomputed: max deviation=$variance%, tolerance=$VARIANCE_ACCEPTED%";
> +    else
> +	echo "[INFO] Maximal deviation from arithmetic mean of 3 average runs: $variance%";
> +    fi;
> +    PROCESSED_TIME="$time";
> +    rm -f avg.out;
> +}
> +
> +echo "[INFO] Running 5 times $1..."
> +echo "[INFO] Maximal variance authorized on 3 average runs: $VARIANCE_ACCEPTED%)...";
> +
> +$1 > ____tempfile.data.polybench;
> +$1 >> ____tempfile.data.polybench;
> +$1 >> ____tempfile.data.polybench;
> +$1 >> ____tempfile.data.polybench;
> +$1 >> ____tempfile.data.polybench;
> +
> +compute_mean_exec_time "____tempfile.data.polybench" "$1";
> +echo "[INFO] Normalized time: $PROCESSED_TIME";
> +rm -f ____tempfile.data.polybench;
> 
> Propchange: test-suite/trunk/SingleSource/Benchmarks/Polybench/utilities/time_benchmark.sh
> ------------------------------------------------------------------------------
>    svn:executable = *
> 
> 
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits




More information about the llvm-commits mailing list