+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
}
/* 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))
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;
/* 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)
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))
{
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;
}
#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. */