summaryrefslogtreecommitdiff
path: root/gcc/tree-vect-analyze.c
diff options
context:
space:
mode:
authordorit <dorit@138bc75d-0d04-0410-961f-82ee72b054a4>2007-04-18 17:43:27 +0000
committerdorit <dorit@138bc75d-0d04-0410-961f-82ee72b054a4>2007-04-18 17:43:27 +0000
commit33bbe7303b072eef79bc93480923ef8813e24157 (patch)
tree6e88f8b28f57302e8c1060fd3ef416ac38dc45f3 /gcc/tree-vect-analyze.c
parent631853108e7b47afa8dbb33434a812ab13771d77 (diff)
downloadgcc-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/tree-vect-analyze.c')
-rw-r--r--gcc/tree-vect-analyze.c19
1 files changed, 11 insertions, 8 deletions
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;
}