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
This commit is contained in:
Dorit Nuzman 2007-04-18 17:43:27 +00:00 committed by Dorit Nuzman
parent f9d6deca5b
commit 28e44f4fe6
5 changed files with 37 additions and 10 deletions

View File

@ -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

View File

@ -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;
}

View File

@ -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))

View File

@ -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;
}

View File

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