Commit d82f8c85 by Sebastian Pop Committed by Sebastian Pop

add testsuite automatic dg-options and dg-do action for isl-ast-gen-* and fuse-* files

        * gcc.dg/graphite/fuse-1.c: Adjust pattern.  Remove dg-do.
        * gcc.dg/graphite/fuse-2.c: Same.
        * gcc.dg/graphite/graphite.exp (opt_files): Add fuse-*.c and
        isl-ast-gen-*.c files.
        * gcc.dg/graphite/isl-ast-gen-blocks-1.c: Remove dg-do and dg-options.
        * gcc.dg/graphite/isl-ast-gen-blocks-2.c: Same.
        * gcc.dg/graphite/isl-ast-gen-blocks-3.c: Same.
        * gcc.dg/graphite/isl-ast-gen-blocks-4.c: Same.
        * gcc.dg/graphite/isl-ast-gen-if-1.c: Same.
        * gcc.dg/graphite/isl-ast-gen-if-2.c: Same.
        * gcc.dg/graphite/isl-ast-gen-single-loop-1.c: Same.
        * gcc.dg/graphite/isl-ast-gen-single-loop-2.c: Same.
        * gcc.dg/graphite/isl-ast-gen-single-loop-3.c: Same.
        * gcc.dg/graphite/isl-ast-gen-user-1.c: Same.
        * gcc.dg/graphite/isl-codegen-loop-dumping.c: Remove.

From-SVN: r230190
parent a6f4d493
2015-11-11 Sebastian Pop <s.pop@samsung.com>
* gcc.dg/graphite/fuse-1.c: Adjust pattern. Remove dg-do.
* gcc.dg/graphite/fuse-2.c: Same.
* gcc.dg/graphite/graphite.exp (opt_files): Add fuse-*.c and
isl-ast-gen-*.c files.
* gcc.dg/graphite/isl-ast-gen-blocks-1.c: Remove dg-do and dg-options.
* gcc.dg/graphite/isl-ast-gen-blocks-2.c: Same.
* gcc.dg/graphite/isl-ast-gen-blocks-3.c: Same.
* gcc.dg/graphite/isl-ast-gen-blocks-4.c: Same.
* gcc.dg/graphite/isl-ast-gen-if-1.c: Same.
* gcc.dg/graphite/isl-ast-gen-if-2.c: Same.
* gcc.dg/graphite/isl-ast-gen-single-loop-1.c: Same.
* gcc.dg/graphite/isl-ast-gen-single-loop-2.c: Same.
* gcc.dg/graphite/isl-ast-gen-single-loop-3.c: Same.
* gcc.dg/graphite/isl-ast-gen-user-1.c: Same.
* gcc.dg/graphite/isl-codegen-loop-dumping.c: Remove.
2015-11-11 Marek Polacek <polacek@redhat.com> 2015-11-11 Marek Polacek <polacek@redhat.com>
PR c/68107 PR c/68107
......
/* Check that the two loops are fused and that we manage to fold the two xor /* Check that the two loops are fused and that we manage to fold the two xor
operations. */ operations. */
/* { dg-options "-O2 -floop-nest-optimize -fdump-tree-forwprop-all" } */ /* { dg-options "-O2 -floop-nest-optimize -fdump-tree-forwprop-all -fdump-tree-graphite-all" } */
/* { dg-do run } */
/* Make sure we fuse the loops like this: /* Make sure we fuse the loops like this:
ISL AST generated by ISL: ISL AST generated by ISL:
...@@ -9,15 +8,12 @@ for (int c0 = 0; c0 <= 99; c0 += 1) { ...@@ -9,15 +8,12 @@ for (int c0 = 0; c0 <= 99; c0 += 1) {
S_3(c0); S_3(c0);
S_6(c0); S_6(c0);
S_9(c0); S_9(c0);
} } */
*/ /* { dg-final { scan-tree-dump-times "ISL AST generated by ISL:.*for \\(int c0 = 0; c0 <= 99; c0 \\+= 1\\) \\{.*S_.*\\(c0\\);.*S_.*\\(c0\\);.*S_.*\\(c0\\);.*\\}" 1 "graphite" } } */
/* { dg-final { scan-tree-dump-times "ISL AST generated by ISL:.*for (int c0 = 0; c0 <= 99; c0 += 1) \{.*S_.*(c0);.*S_.*(c0);.*S_.*(c0);.*\}" 1 "graphite" } } */
/* Check that after fusing the loops, the scalar computation is also fused. */ /* Check that after fusing the loops, the scalar computation is also fused. */
/* { dg-final { scan-tree-dump-times "gimple_simplified to\[^\\n\]*\\^ 12" 1 "forwprop4" } } */ /* { dg-final { scan-tree-dump-times "gimple_simplified to\[^\\n\]*\\^ 12" 1 "forwprop4" } } */
#define MAX 100 #define MAX 100
int A[MAX]; int A[MAX];
......
/* Check that the three loops are fused. */ /* Check that the three loops are fused. */
/* { dg-options "-O2 -floop-nest-optimize" } */
/* { dg-do run } */
/* Make sure we fuse the loops like this: /* Make sure we fuse the loops like this:
ISL AST generated by ISL: ISL AST generated by ISL:
...@@ -11,7 +9,7 @@ for (int c0 = 0; c0 <= 99; c0 += 1) { ...@@ -11,7 +9,7 @@ for (int c0 = 0; c0 <= 99; c0 += 1) {
} }
*/ */
/* { dg-final { scan-tree-dump-times "ISL AST generated by ISL:.*for (int c0 = 0; c0 <= 99; c0 += 1) \{.*S_.*(c0);.*S_.*(c0);.*S_.*(c0);.*\}" 1 "graphite" } } */ /* { dg-final { scan-tree-dump-times "ISL AST generated by ISL:.*for \\(int c0 = 0; c0 <= 99; c0 \\+= 1\\) \\{.*S_.*\\(c0\\);.*S_.*\\(c0\\);.*S_.*\\(c0\\);.*\\}" 1 "graphite" } } */
#define MAX 100 #define MAX 100
int A[MAX], B[MAX], C[MAX]; int A[MAX], B[MAX], C[MAX];
......
...@@ -43,6 +43,8 @@ set id_files [lsort [glob -nocomplain $srcdir/$subdir/id-*.c ] ] ...@@ -43,6 +43,8 @@ set id_files [lsort [glob -nocomplain $srcdir/$subdir/id-*.c ] ]
set run_id_files [lsort [glob -nocomplain $srcdir/$subdir/run-id-*.c ] ] set run_id_files [lsort [glob -nocomplain $srcdir/$subdir/run-id-*.c ] ]
set opt_files [lsort [glob -nocomplain $srcdir/$subdir/interchange-*.c \ set opt_files [lsort [glob -nocomplain $srcdir/$subdir/interchange-*.c \
$srcdir/$subdir/uns-interchange-*.c \ $srcdir/$subdir/uns-interchange-*.c \
$srcdir/$subdir/isl-ast-gen-*.c \
$srcdir/$subdir/fuse-*.c \
$srcdir/$subdir/block-*.c \ $srcdir/$subdir/block-*.c \
$srcdir/$subdir/uns-block-*.c ] ] $srcdir/$subdir/uns-block-*.c ] ]
set vect_files [lsort [glob -nocomplain $srcdir/$subdir/vect-*.c ] ] set vect_files [lsort [glob -nocomplain $srcdir/$subdir/vect-*.c ] ]
......
/* { dg-do run } */
/* { dg-options "-O2 -fgraphite-identity" } */
int n = 50; int n = 50;
static int __attribute__((noinline)) static int __attribute__((noinline))
foo () foo ()
......
/* { dg-do run } */
/* { dg-options "-O2 -fgraphite-identity" } */
int k = 50; int k = 50;
static int __attribute__((noinline)) static int __attribute__((noinline))
foo () foo ()
......
/* { dg-do run } */
/* { dg-options "-O2 -fgraphite-identity" } */
/* We use a global variable 'k' to avoid ipa-cp. */ /* We use a global variable 'k' to avoid ipa-cp. */
int k = 50; int k = 50;
static int __attribute__((noinline)) static int __attribute__((noinline))
......
/* { dg-do run } */
/* { dg-options "-O2 -fgraphite-identity" } */
static int __attribute__((noinline)) static int __attribute__((noinline))
foo (int k, int n1, int n2, int n3) foo (int k, int n1, int n2, int n3)
{ {
......
/* { dg-do run } */
/* { dg-options "-O2 -fgraphite-identity" } */
int st = 1; int st = 1;
static void __attribute__((noinline)) static void __attribute__((noinline))
foo (int a[], int n) foo (int a[], int n)
......
/* { dg-do run } */
/* { dg-options "-O2 -fgraphite-identity" } */
/* This test case tests reduction, where the pbbs are duplicated. */ /* This test case tests reduction, where the pbbs are duplicated. */
static int __attribute__((noinline)) static int __attribute__((noinline))
......
/* { dg-do run } */
/* { dg-options "-O2 -fgraphite-identity" } */
int int
foo () foo ()
{ {
......
/* { dg-do run } */
/* { dg-options "-O2 -fgraphite-identity" } */
int n = 50; int n = 50;
void void
......
/* { dg-do run } */
/* { dg-options "-O2 -fgraphite-identity" } */
int n = 50; int n = 50;
void void
......
/* { dg-do compile } */
/* { dg-options "-O2 -fgraphite-identity" } */
#include <stdio.h>
#include <stdlib.h>
static const int N = 12; static const int N = 12;
int nSlip;
void Crystal_Cholesky (int nSlip, int a[N][N]) int main ()
{ {
int i, j, k, fdot = 0; int i, j, k, fdot = 0;
int a[N][N];
for ( i = 1; i < nSlip; i++) for ( i = 1; i < nSlip; i++)
{ {
...@@ -19,6 +15,8 @@ void Crystal_Cholesky (int nSlip, int a[N][N]) ...@@ -19,6 +15,8 @@ void Crystal_Cholesky (int nSlip, int a[N][N])
a[i][j] = a[i][j] - fdot; a[i][j] = a[i][j] - fdot;
} }
} }
return 0;
} }
......
/* { dg-options "-O2 -fgraphite-identity -fdump-tree-graphite-all" } */
int
main (int n, int *a)
{
int i, j;
for (i = 0; i < n - 1; i++)
for (j = 0; j < n; j++)
a[j] = i + n;
return 0;
}
/* { dg-final { scan-tree-dump-times "ISL AST generated by ISL: \n\\{\n S_2\\();\n if \\(P_19 >= 1\\)\n
for \\(int c1 = 0; c1 < n - 1; c1 \\+= 1\\) \\{ \n for \\(int c3 = 0; c3 < n; c3 \\+= 1\\)\n
S_4\\(c1, c3\\); \n S_6\\(c1\\);\n \\} \n\\}" 1 "graphite"} } */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment