diff options
author | spop <spop@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-08-11 20:24:47 +0000 |
---|---|---|
committer | spop <spop@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-08-11 20:24:47 +0000 |
commit | b90bb125e17e05b8dd6811cdd3109d788731730d (patch) | |
tree | 1e69f8e8919644c19f143000a8f70f834cd85fd5 | |
parent | 93206bb0e5225c5f809723bea99cef9504ba0898 (diff) | |
download | gcc-b90bb125e17e05b8dd6811cdd3109d788731730d.tar.gz |
Schedule a copy_prop pass before graphite.
2010-06-15 Sebastian Pop <sebastian.pop@amd.com>
* passes.c (init_optimization_passes): Add pass_graphite.
Schedule a pass_copy_prop before pass_graphite_transforms.
* timevar.def (TV_GRAPHITE): Declared.
* tree-pass.h (pass_graphite): Declared.
* tree-ssa-loop.c (pass_graphite): New.
* gcc.dg/graphite/id-20.c: New.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@163120 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | gcc/ChangeLog | 8 | ||||
-rw-r--r-- | gcc/ChangeLog.graphite | 10 | ||||
-rw-r--r-- | gcc/passes.c | 7 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/graphite/id-20.c | 26 | ||||
-rw-r--r-- | gcc/timevar.def | 1 | ||||
-rw-r--r-- | gcc/tree-pass.h | 1 | ||||
-rw-r--r-- | gcc/tree-ssa-loop.c | 19 |
8 files changed, 74 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index d6eb263232b..b475e5835ac 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,13 @@ 2010-08-02 Sebastian Pop <sebastian.pop@amd.com> + * passes.c (init_optimization_passes): Add pass_graphite. + Schedule a pass_copy_prop before pass_graphite_transforms. + * timevar.def (TV_GRAPHITE): Declared. + * tree-pass.h (pass_graphite): Declared. + * tree-ssa-loop.c (pass_graphite): New. + +2010-08-02 Sebastian Pop <sebastian.pop@amd.com> + * graphite-clast-to-gimple.c (gloog): Do not pass scops in parameter. Remove calls to rename_nb_iterations and rename_sese_parameters. * graphite-clast-to-gimple.h (gloog): Update declaration. diff --git a/gcc/ChangeLog.graphite b/gcc/ChangeLog.graphite index aac1c96c8a8..8b72f3e0a4d 100644 --- a/gcc/ChangeLog.graphite +++ b/gcc/ChangeLog.graphite @@ -1,3 +1,13 @@ +2010-06-15 Sebastian Pop <sebastian.pop@amd.com> + + * passes.c (init_optimization_passes): Add pass_graphite. + Schedule a pass_copy_prop before pass_graphite_transforms. + * timevar.def (TV_GRAPHITE): Declared. + * tree-pass.h (pass_graphite): Declared. + * tree-ssa-loop.c (pass_graphite): New. + + * gcc.dg/graphite/id-20.c: New. + 2010-06-12 Sebastian Pop <sebastian.pop@amd.com> * graphite-clast-to-gimple.c (gloog): Do not pass scops in parameter. diff --git a/gcc/passes.c b/gcc/passes.c index 5a4cdc83a6e..e2b9369824e 100644 --- a/gcc/passes.c +++ b/gcc/passes.c @@ -900,9 +900,12 @@ init_optimization_passes (void) NEXT_PASS (pass_check_data_deps); NEXT_PASS (pass_loop_distribution); NEXT_PASS (pass_linear_transform); - NEXT_PASS (pass_graphite_transforms); + NEXT_PASS (pass_copy_prop); + NEXT_PASS (pass_graphite); { - struct opt_pass **p = &pass_graphite_transforms.pass.sub; + struct opt_pass **p = &pass_graphite.pass.sub; + NEXT_PASS (pass_copy_prop); + NEXT_PASS (pass_graphite_transforms); NEXT_PASS (pass_copy_prop); NEXT_PASS (pass_dce_loop); NEXT_PASS (pass_lim); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 51fb4a7e5a9..a2ee19f003e 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2010-08-02 Sebastian Pop <sebastian.pop@amd.com> + + * gcc.dg/graphite/id-20.c: New. + 2010-08-11 Janus Weil <janus@gcc.gnu.org> Steve Kargl <kargl@gcc.gnu.org> diff --git a/gcc/testsuite/gcc.dg/graphite/id-20.c b/gcc/testsuite/gcc.dg/graphite/id-20.c new file mode 100644 index 00000000000..7e0cf6dda1b --- /dev/null +++ b/gcc/testsuite/gcc.dg/graphite/id-20.c @@ -0,0 +1,26 @@ +/* { dg-options "-O3 -fgraphite-identity -ffast-math" } */ + +typedef enum +{ + I_SLICE, +} SliceType; +typedef struct +{ + int type; +} ImageParameters; +extern ImageParameters *img; +int A[64], B[64], C[13][8][8], D[13][8][8]; + +void +foo (int q, int temp) +{ + int i, j, k; + for(k=0; k<13; k++) + for(j=0; j<8; j++) + for(i=0; i<8; i++) + { + if (img->type == I_SLICE) + C[k][j][i] = A[temp] << q; + D[k][j][i] = B[temp] << q; + } +} diff --git a/gcc/timevar.def b/gcc/timevar.def index a28d6baa3bf..86e29995ff2 100644 --- a/gcc/timevar.def +++ b/gcc/timevar.def @@ -146,6 +146,7 @@ DEFTIMEVAR (TV_COMPLETE_UNROLL , "complete unrolling") DEFTIMEVAR (TV_TREE_PARALLELIZE_LOOPS, "tree parallelize loops") DEFTIMEVAR (TV_TREE_VECTORIZATION , "tree vectorization") DEFTIMEVAR (TV_TREE_SLP_VECTORIZATION, "tree slp vectorization") +DEFTIMEVAR (TV_GRAPHITE , "Graphite") DEFTIMEVAR (TV_GRAPHITE_TRANSFORMS , "Graphite loop transforms") DEFTIMEVAR (TV_GRAPHITE_DATA_DEPS , "Graphite data dep analysis") DEFTIMEVAR (TV_GRAPHITE_CODE_GEN , "Graphite code generation") diff --git a/gcc/tree-pass.h b/gcc/tree-pass.h index 33c898ee240..84d4a885bd8 100644 --- a/gcc/tree-pass.h +++ b/gcc/tree-pass.h @@ -373,6 +373,7 @@ extern struct gimple_opt_pass pass_iv_canon; extern struct gimple_opt_pass pass_scev_cprop; extern struct gimple_opt_pass pass_empty_loop; extern struct gimple_opt_pass pass_record_bounds; +extern struct gimple_opt_pass pass_graphite; extern struct gimple_opt_pass pass_graphite_transforms; extern struct gimple_opt_pass pass_if_conversion; extern struct gimple_opt_pass pass_loop_distribution; diff --git a/gcc/tree-ssa-loop.c b/gcc/tree-ssa-loop.c index 7a60144d004..9523dab14dd 100644 --- a/gcc/tree-ssa-loop.c +++ b/gcc/tree-ssa-loop.c @@ -310,6 +310,25 @@ gate_graphite_transforms (void) return flag_graphite != 0; } +struct gimple_opt_pass pass_graphite = +{ + { + GIMPLE_PASS, + "graphite0", /* name */ + gate_graphite_transforms, /* gate */ + NULL, /* execute */ + NULL, /* sub */ + NULL, /* next */ + 0, /* static_pass_number */ + TV_GRAPHITE, /* tv_id */ + PROP_cfg | PROP_ssa, /* properties_required */ + 0, /* properties_provided */ + 0, /* properties_destroyed */ + 0, /* todo_flags_start */ + 0 /* todo_flags_finish */ + } +}; + struct gimple_opt_pass pass_graphite_transforms = { { |