Commit 28e44f4f by Dorit Nuzman Committed by Dorit Nuzman

tree-vectorizer.c (destroy_loop_vec_info): Set loop->aux to NULL.

        * 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.

From-SVN: r123955
parent f9d6deca
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> 2007-04-18 Anatoly Sokolov <aesok@post.ru>
* config/avr/avr.c (ptrreg_to_str): Replace error() with * config/avr/avr.c (ptrreg_to_str): Replace error() with
......
...@@ -262,7 +262,8 @@ vect_determine_vectorization_factor (loop_vec_info loop_vinfo) ...@@ -262,7 +262,8 @@ vect_determine_vectorization_factor (loop_vec_info loop_vinfo)
} }
/* TODO: Analyze cost. Decide if worth while to vectorize. */ /* 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 (vectorization_factor <= 1)
{ {
if (vect_print_dump_info (REPORT_UNVECTORIZED_LOOPS)) if (vect_print_dump_info (REPORT_UNVECTORIZED_LOOPS))
...@@ -1434,6 +1435,7 @@ static bool ...@@ -1434,6 +1435,7 @@ static bool
vect_enhance_data_refs_alignment (loop_vec_info loop_vinfo) vect_enhance_data_refs_alignment (loop_vec_info loop_vinfo)
{ {
VEC (data_reference_p, heap) *datarefs = LOOP_VINFO_DATAREFS (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; enum dr_alignment_support supportable_dr_alignment;
struct data_reference *dr0 = NULL; struct data_reference *dr0 = NULL;
struct data_reference *dr; struct data_reference *dr;
...@@ -1531,7 +1533,8 @@ vect_enhance_data_refs_alignment (loop_vec_info loop_vinfo) ...@@ -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 /* 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. */ 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; do_peeling = false;
if (do_peeling) if (do_peeling)
...@@ -2641,10 +2644,7 @@ vect_analyze_loop_form (struct loop *loop) ...@@ -2641,10 +2644,7 @@ vect_analyze_loop_form (struct loop *loop)
return false; return false;
} }
loop_vinfo = new_loop_vec_info (loop); if (!NITERS_KNOWN_P (number_of_iterations))
LOOP_VINFO_NITERS (loop_vinfo) = number_of_iterations;
if (!LOOP_VINFO_NITERS_KNOWN_P (loop_vinfo))
{ {
if (vect_print_dump_info (REPORT_DETAILS)) if (vect_print_dump_info (REPORT_DETAILS))
{ {
...@@ -2652,16 +2652,19 @@ vect_analyze_loop_form (struct loop *loop) ...@@ -2652,16 +2652,19 @@ vect_analyze_loop_form (struct loop *loop)
print_generic_expr (vect_dump, number_of_iterations, TDF_DETAILS); print_generic_expr (vect_dump, number_of_iterations, TDF_DETAILS);
} }
} }
else else if (TREE_INT_CST_LOW (number_of_iterations) == 0)
if (LOOP_VINFO_INT_NITERS (loop_vinfo) == 0)
{ {
if (vect_print_dump_info (REPORT_UNVECTORIZED_LOOPS)) if (vect_print_dump_info (REPORT_UNVECTORIZED_LOOPS))
fprintf (vect_dump, "not vectorized: number of iterations = 0."); fprintf (vect_dump, "not vectorized: number of iterations = 0.");
return NULL; 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; LOOP_VINFO_EXIT_COND (loop_vinfo) = loop_cond;
gcc_assert (!loop->aux);
loop->aux = loop_vinfo;
return loop_vinfo; return loop_vinfo;
} }
......
...@@ -5258,6 +5258,7 @@ vect_transform_loop (loop_vec_info loop_vinfo) ...@@ -5258,6 +5258,7 @@ vect_transform_loop (loop_vec_info loop_vinfo)
continue; continue;
} }
gcc_assert (STMT_VINFO_VECTYPE (stmt_info));
if ((TYPE_VECTOR_SUBPARTS (STMT_VINFO_VECTYPE (stmt_info)) if ((TYPE_VECTOR_SUBPARTS (STMT_VINFO_VECTYPE (stmt_info))
!= (unsigned HOST_WIDE_INT) vectorization_factor) != (unsigned HOST_WIDE_INT) vectorization_factor)
&& vect_print_dump_info (REPORT_DETAILS)) && vect_print_dump_info (REPORT_DETAILS))
......
...@@ -1511,6 +1511,7 @@ destroy_loop_vec_info (loop_vec_info loop_vinfo) ...@@ -1511,6 +1511,7 @@ destroy_loop_vec_info (loop_vec_info loop_vinfo)
VEC_free (tree, heap, LOOP_VINFO_MAY_MISALIGN_STMTS (loop_vinfo)); VEC_free (tree, heap, LOOP_VINFO_MAY_MISALIGN_STMTS (loop_vinfo));
free (loop_vinfo); free (loop_vinfo);
loop->aux = NULL;
} }
......
...@@ -151,9 +151,12 @@ typedef struct _loop_vec_info { ...@@ -151,9 +151,12 @@ typedef struct _loop_vec_info {
#define LOOP_VINFO_MAY_MISALIGN_STMTS(L) (L)->may_misalign_stmts #define LOOP_VINFO_MAY_MISALIGN_STMTS(L) (L)->may_misalign_stmts
#define LOOP_VINFO_LOC(L) (L)->loop_line_number #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) \ #define LOOP_VINFO_NITERS_KNOWN_P(L) \
(host_integerp ((L)->num_iters,0) \ NITERS_KNOWN_P((L)->num_iters)
&& TREE_INT_CST_LOW ((L)->num_iters) > 0)
/*-----------------------------------------------------------------*/ /*-----------------------------------------------------------------*/
/* Info on vectorized defs. */ /* Info on vectorized defs. */
......
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