From 25e3c2e84712f5e71dc9a9a8a5bee33faa0871c6 Mon Sep 17 00:00:00 2001 From: irar Date: Tue, 6 Sep 2005 10:59:58 +0000 Subject: * common.opt: Add option ftree-vect-loop-version. * params.def: Add --param vect-max-version-checks. * doc/invoke.texi: Document ftree-vect-loop-version and --param vect-max-version-checks. * tree-vectorizer.h (_loop_vec_info): Add ptr_mask and may_misalign_stmts and defines for accessors. * tree-vectorizer.c : (new_loop_vec_info): VEC_alloc for LOOP_VINFO_MAY_MISALIGN_STMTS. (destroy_loop_vec_info): VEC_free for LOOP_VINFO_MAY_MISALIGN_STMTS. * tree-vect-analyze.c (vect_compute_data_ref_alignment): Update documentation. (vect_update_misalignment_for_peel): New. (vect_enhance_data_refs_alignment): Update to choose loop peeling or loop versioning if appropriate for the (potentially) unaligned data references in the loop. (vect_analyze_data_refs_alignment): Remove call to vect_enhance_data_refs_alignment so the checks can be done earlier. (vect_analyze_loop): Add call to vect_enhance_data_refs_alignment and move up call to vect_analyze_data_refs_alignment. * tree-vect-transform.c (vect_create_cond_for_align_checks): New. (vect_transform_loop): Add call to loop_version. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@103941 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/tree-vectorizer.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'gcc/tree-vectorizer.c') diff --git a/gcc/tree-vectorizer.c b/gcc/tree-vectorizer.c index 84ed5a90c3b..1e415cb9dd9 100644 --- a/gcc/tree-vectorizer.c +++ b/gcc/tree-vectorizer.c @@ -137,6 +137,7 @@ Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA #include "cfglayout.h" #include "expr.h" #include "optabs.h" +#include "params.h" #include "toplev.h" #include "tree-chrec.h" #include "tree-data-ref.h" @@ -1420,6 +1421,8 @@ new_loop_vec_info (struct loop *loop) VARRAY_GENERIC_PTR_INIT (LOOP_VINFO_DATAREFS (res), 20, "loop_datarefs"); VARRAY_GENERIC_PTR_INIT (LOOP_VINFO_DDRS (res), 20, "loop_ddrs"); LOOP_VINFO_UNALIGNED_DR (res) = NULL; + LOOP_VINFO_MAY_MISALIGN_STMTS (res) + = VEC_alloc (tree, heap, PARAM_VALUE (PARAM_VECT_MAX_VERSION_CHECKS)); return res; } @@ -1480,6 +1483,7 @@ destroy_loop_vec_info (loop_vec_info loop_vinfo) free (LOOP_VINFO_BBS (loop_vinfo)); varray_clear (LOOP_VINFO_DATAREFS (loop_vinfo)); varray_clear (LOOP_VINFO_DDRS (loop_vinfo)); + VEC_free (tree, heap, LOOP_VINFO_MAY_MISALIGN_STMTS (loop_vinfo)); free (loop_vinfo); } @@ -2049,7 +2053,7 @@ vectorize_loops (struct loops *loops) if (!loop_vinfo || !LOOP_VINFO_VECTORIZABLE_P (loop_vinfo)) continue; - vect_transform_loop (loop_vinfo, loops); + vect_transform_loop (loop_vinfo, loops); num_vectorized_loops++; } -- cgit v1.2.3