diff options
author | dorit <dorit@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-08-17 16:17:14 +0000 |
---|---|---|
committer | dorit <dorit@138bc75d-0d04-0410-961f-82ee72b054a4> | 2004-08-17 16:17:14 +0000 |
commit | c91e822398d80d51e7b0e0884fa3e8c7c32d6ae7 (patch) | |
tree | 49effbb8670b04dbfb66de531c733c3e4389a525 /gcc/tree-ssa-loop.c | |
parent | 867fd9060f9bdfef84dbea3354f5747c94d60a13 (diff) | |
download | gcc-c91e822398d80d51e7b0e0884fa3e8c7c32d6ae7.tar.gz |
* tree-vectorizer.c: New File: loop vectorization on SSAed GIMPLE trees.
* tree-vectorizer.h: New File: Same.
* Makefile.in (tree-vectorizer.c, tree-vectorizer.h): Add new files.
* common.opt (ftree-vectorize): New flag to enable vectorization.
* timevar.def (TV_TREE_VECTORIZATION): New dump file for vectorization
pass.
* tree-data-ref.h (init_data_ref): Additional argument.
(array_base_name_differ_p): Moved to tree-data-ref.c.
* tree-data-ref.c (array_base_name_differ_p): Revised.
(initialize_data_dependence_relation): Call array_base_name_differ_p
with an extra argument.
(analyze_all_data_dependences): Same.
(init_data_ref): Additional argument is_read to set DR_IS_READ.
* tree-ssa-phiopt.c (empty_block_p): Expose for usage out of this file.
* tree-flow.h (vectorize_loops, empty_block_p): Add declaration.
* tree-optimize.c (pass_vectorize): Schedule the vectorization pass.
* tree-pass.h (tree_opt_pass pass_vectorize): Declare the new
vectorization pass.
* tree-ssa-loop.c (tree_ssa_loop_init): Call scev_initialize.
(tree_ssa_loop_done): Call scev_finalize.
(tree_vectorize): Define the new vectorization pass.
* defaults.h (UNITS_PER_SIMD_WORD): Allow targets to specify the size of
the vector they support (until support for multiple vector sizes is
added to the vectorizer).
* config/i386/i386.h (UNITS_PER_SIMD_WORD): Define.
* config/rs6000/rs6000.h (UNITS_PER_SIMD_WORD): Define.
* invoke.texi (fdump-tree-vect, ftree-vectorize): Add
documentation.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@86131 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-ssa-loop.c')
-rw-r--r-- | gcc/tree-ssa-loop.c | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/gcc/tree-ssa-loop.c b/gcc/tree-ssa-loop.c index a1e6494712a..99dbc71aefd 100644 --- a/gcc/tree-ssa-loop.c +++ b/gcc/tree-ssa-loop.c @@ -37,6 +37,7 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA #include "cfgloop.h" #include "flags.h" #include "tree-inline.h" +#include "tree-scalar-evolution.h" /* The loop tree currently optimized. */ @@ -98,6 +99,9 @@ static void tree_ssa_loop_init (void) { current_loops = tree_loop_optimizer_init (dump_file); + if (!current_loops) + return; + scev_initialize (current_loops); } struct tree_opt_pass pass_loop_init = @@ -149,6 +153,40 @@ struct tree_opt_pass pass_lim = TODO_dump_func /* todo_flags_finish */ }; +/* Loop autovectorization. */ + +static void +tree_vectorize (void) +{ + if (!current_loops) + return; + + bitmap_clear (vars_to_rename); + vectorize_loops (current_loops); +} + +static bool +gate_tree_vectorize (void) +{ + return flag_tree_vectorize != 0; +} + +struct tree_opt_pass pass_vectorize = +{ + "vect", /* name */ + gate_tree_vectorize, /* gate */ + tree_vectorize, /* execute */ + NULL, /* sub */ + NULL, /* next */ + 0, /* static_pass_number */ + TV_TREE_VECTORIZATION, /* tv_id */ + PROP_cfg | PROP_ssa, /* properties_required */ + 0, /* properties_provided */ + 0, /* properties_destroyed */ + 0, /* todo_flags_start */ + TODO_dump_func /* todo_flags_finish */ +}; + /* Loop optimizer finalization. */ static void @@ -157,6 +195,8 @@ tree_ssa_loop_done (void) if (!current_loops) return; + scev_finalize (); + #ifdef ENABLE_CHECKING verify_loop_closed_ssa (); #endif |