diff options
author | dorit <dorit@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-04-18 17:43:27 +0000 |
---|---|---|
committer | dorit <dorit@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-04-18 17:43:27 +0000 |
commit | 33bbe7303b072eef79bc93480923ef8813e24157 (patch) | |
tree | 6e88f8b28f57302e8c1060fd3ef416ac38dc45f3 /gcc | |
parent | 631853108e7b47afa8dbb33434a812ab13771d77 (diff) | |
download | gcc-33bbe7303b072eef79bc93480923ef8813e24157.tar.gz |
* tree-vectorizer.c (destroy_loop_vec_info): Set loop->aux to NULL.
* tree-vect-analyze.c (vect_analyze_loop_form): Set loop->aux.
* tree-vectorizer.h (NITERS_KNOWN_P): New.
* tree-vect-analyze.c (vect_analyze_loop_form): Call NITERS_KNOWN_P
instead of LOOP_VINFO_INT_NITERS to avoid having to geneate loop_info.
* tree-vect-analyze.c (vect_determine_vectorization_factor): Add
dump print.
(vect_analyze_operations): Fix indenetation. Fix a comment. Fix a
print message.
(vect_analyze_scalar_cycles): Fix indentation.
(vect_enhance_data_refs_alignment): Fix check in case of peeling.
(vect_mark_relevant): Include phis in relevance analysis.
* tree-vect-transform.c (vect_transform_loop): Add an assert.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@123955 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 19 | ||||
-rw-r--r-- | gcc/tree-vect-analyze.c | 19 | ||||
-rw-r--r-- | gcc/tree-vect-transform.c | 1 | ||||
-rw-r--r-- | gcc/tree-vectorizer.c | 1 | ||||
-rw-r--r-- | gcc/tree-vectorizer.h | 7 |
5 files changed, 37 insertions, 10 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 97b91e83cfb..b1671cf1359 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,22 @@ +2007-04-18 Dorit Nuzman <dorit@il.ibm.com> + + * tree-vectorizer.c (destroy_loop_vec_info): Set loop->aux to NULL. + * tree-vect-analyze.c (vect_analyze_loop_form): Set loop->aux. + + * tree-vectorizer.h (NITERS_KNOWN_P): New. + * tree-vect-analyze.c (vect_analyze_loop_form): Call NITERS_KNOWN_P + instead of LOOP_VINFO_INT_NITERS to avoid having to geneate loop_info. + + * tree-vect-analyze.c (vect_determine_vectorization_factor): Add + dump print. + (vect_analyze_operations): Fix indenetation. Fix a comment. Fix a + print message. + (vect_analyze_scalar_cycles): Fix indentation. + (vect_enhance_data_refs_alignment): Fix check in case of peeling. + (vect_mark_relevant): Include phis in relevance analysis. + + * tree-vect-transform.c (vect_transform_loop): Add an assert. + 2007-04-18 Anatoly Sokolov <aesok@post.ru> * config/avr/avr.c (ptrreg_to_str): Replace error() with diff --git a/gcc/tree-vect-analyze.c b/gcc/tree-vect-analyze.c index ea28a2c145f..c195c7ab323 100644 --- a/gcc/tree-vect-analyze.c +++ b/gcc/tree-vect-analyze.c @@ -262,7 +262,8 @@ vect_determine_vectorization_factor (loop_vec_info loop_vinfo) } /* TODO: Analyze cost. Decide if worth while to vectorize. */ - + if (vect_print_dump_info (REPORT_DETAILS)) + fprintf (vect_dump, "vectorization factor = %d", vectorization_factor); if (vectorization_factor <= 1) { if (vect_print_dump_info (REPORT_UNVECTORIZED_LOOPS)) @@ -1434,6 +1435,7 @@ static bool vect_enhance_data_refs_alignment (loop_vec_info loop_vinfo) { VEC (data_reference_p, heap) *datarefs = LOOP_VINFO_DATAREFS (loop_vinfo); + struct loop *loop = LOOP_VINFO_LOOP (loop_vinfo); enum dr_alignment_support supportable_dr_alignment; struct data_reference *dr0 = NULL; struct data_reference *dr; @@ -1531,7 +1533,8 @@ vect_enhance_data_refs_alignment (loop_vec_info loop_vinfo) /* Often peeling for alignment will require peeling for loop-bound, which in turn requires that we know how to adjust the loop ivs after the loop. */ - if (!vect_can_advance_ivs_p (loop_vinfo)) + if (!vect_can_advance_ivs_p (loop_vinfo) + || !slpeel_can_duplicate_loop_p (loop, single_exit (loop))) do_peeling = false; if (do_peeling) @@ -2641,10 +2644,7 @@ vect_analyze_loop_form (struct loop *loop) return false; } - loop_vinfo = new_loop_vec_info (loop); - LOOP_VINFO_NITERS (loop_vinfo) = number_of_iterations; - - if (!LOOP_VINFO_NITERS_KNOWN_P (loop_vinfo)) + if (!NITERS_KNOWN_P (number_of_iterations)) { if (vect_print_dump_info (REPORT_DETAILS)) { @@ -2652,16 +2652,19 @@ vect_analyze_loop_form (struct loop *loop) print_generic_expr (vect_dump, number_of_iterations, TDF_DETAILS); } } - else - if (LOOP_VINFO_INT_NITERS (loop_vinfo) == 0) + else if (TREE_INT_CST_LOW (number_of_iterations) == 0) { if (vect_print_dump_info (REPORT_UNVECTORIZED_LOOPS)) fprintf (vect_dump, "not vectorized: number of iterations = 0."); return NULL; } + loop_vinfo = new_loop_vec_info (loop); + LOOP_VINFO_NITERS (loop_vinfo) = number_of_iterations; LOOP_VINFO_EXIT_COND (loop_vinfo) = loop_cond; + gcc_assert (!loop->aux); + loop->aux = loop_vinfo; return loop_vinfo; } diff --git a/gcc/tree-vect-transform.c b/gcc/tree-vect-transform.c index b2c17899d05..895e709289c 100644 --- a/gcc/tree-vect-transform.c +++ b/gcc/tree-vect-transform.c @@ -5258,6 +5258,7 @@ vect_transform_loop (loop_vec_info loop_vinfo) continue; } + gcc_assert (STMT_VINFO_VECTYPE (stmt_info)); if ((TYPE_VECTOR_SUBPARTS (STMT_VINFO_VECTYPE (stmt_info)) != (unsigned HOST_WIDE_INT) vectorization_factor) && vect_print_dump_info (REPORT_DETAILS)) diff --git a/gcc/tree-vectorizer.c b/gcc/tree-vectorizer.c index 212b584991f..6b44c0b0610 100644 --- a/gcc/tree-vectorizer.c +++ b/gcc/tree-vectorizer.c @@ -1511,6 +1511,7 @@ destroy_loop_vec_info (loop_vec_info loop_vinfo) VEC_free (tree, heap, LOOP_VINFO_MAY_MISALIGN_STMTS (loop_vinfo)); free (loop_vinfo); + loop->aux = NULL; } diff --git a/gcc/tree-vectorizer.h b/gcc/tree-vectorizer.h index 3d418a92304..8d80aeb2ba7 100644 --- a/gcc/tree-vectorizer.h +++ b/gcc/tree-vectorizer.h @@ -151,9 +151,12 @@ typedef struct _loop_vec_info { #define LOOP_VINFO_MAY_MISALIGN_STMTS(L) (L)->may_misalign_stmts #define LOOP_VINFO_LOC(L) (L)->loop_line_number +#define NITERS_KNOWN_P(n) \ +(host_integerp ((n),0) \ +&& TREE_INT_CST_LOW ((n)) > 0) + #define LOOP_VINFO_NITERS_KNOWN_P(L) \ -(host_integerp ((L)->num_iters,0) \ -&& TREE_INT_CST_LOW ((L)->num_iters) > 0) +NITERS_KNOWN_P((L)->num_iters) /*-----------------------------------------------------------------*/ /* Info on vectorized defs. */ |