+2004-10-14 Dorit Naishlos <dorit@il.bim.com>
+
+ * tree-vectorizer.c (get_vectype_for_scalar_type): Added debug prinouts.
+ Added check that vectype is VECTOR_MODE_P, instead of check for BLKmode.
+ (vect_analyze_operations): Make sure the vectorization factor > 1. Add
+ gcc_assert under ENABLE_CHECKING.
+ (vectorizable_operation): Remove check for VECTOR_MODE_P (moved to
+ get_vectype_for_scalar_type).
+
+ (vect_get_vec_def_for_operand): Remove redundant variables.
+ (vect_transform_loop): Likewise.
+
2004-10-14 Richard Sandiford <rsandifo@redhat.com>
* config/arm/arm.h (CONDITIONAL_REGISTER_USAGE): Make r11 fixed and
nunits = UNITS_PER_SIMD_WORD / nbytes;
vectype = build_vector_type (scalar_type, nunits);
- if (TYPE_MODE (vectype) == BLKmode)
+ if (vect_debug_details (NULL))
+ {
+ fprintf (dump_file, "get vectype with %d units of type ", nunits);
+ print_generic_expr (dump_file, scalar_type, TDF_SLIM);
+ }
+
+ if (!vectype)
return NULL_TREE;
+
+ if (vect_debug_details (NULL))
+ {
+ fprintf (dump_file, "vectype: ");
+ print_generic_expr (dump_file, vectype, TDF_SLIM);
+ }
+
+ if (!VECTOR_MODE_P (TYPE_MODE (vectype)))
+ {
+ /* TODO: tree-complex.c sometimes can parallelize operations
+ on generic vectors. We can vectorize the loop in that case,
+ but then we should re-run the lowering pass. */
+ if (vect_debug_details (NULL))
+ fprintf (dump_file, "mode not supported by target.");
+ return NULL_TREE;
+ }
+
return vectype;
}
/* Create 'vect_cst_ = {cst,cst,...,cst}' */
tree vec_cst;
- stmt_vec_info stmt_vinfo = vinfo_for_stmt (stmt);
- tree vectype = STMT_VINFO_VECTYPE (stmt_vinfo);
- int nunits = GET_MODE_NUNITS (TYPE_MODE (vectype));
- tree t = NULL_TREE;
- int i;
/* Build a tree with vector elements. */
if (vect_debug_details (NULL))
return false;
}
vec_mode = TYPE_MODE (vectype);
- if (!VECTOR_MODE_P (vec_mode))
- {
- /* TODO: tree-complex.c sometimes can parallelize operations
- on generic vectors. We can vectorize the loop in that case,
- but then we should re-run the lowering pass. */
- if (vect_debug_details (NULL))
- fprintf (dump_file, "mode not supported by target.");
- return false;
- }
-
if (optab->handlers[(int) vec_mode].insn_code == CODE_FOR_nothing)
{
if (vect_debug_details (NULL))
tree stmt = bsi_stmt (si);
stmt_vec_info stmt_info;
bool is_store;
-#ifdef ENABLE_CHECKING
- tree vectype;
-#endif
if (vect_debug_details (NULL))
{
#ifdef ENABLE_CHECKING
/* FORNOW: Verify that all stmts operate on the same number of
units and no inner unrolling is necessary. */
- vectype = STMT_VINFO_VECTYPE (stmt_info);
- gcc_assert (GET_MODE_NUNITS (TYPE_MODE (vectype))
+ gcc_assert (GET_MODE_NUNITS (TYPE_MODE (STMT_VINFO_VECTYPE (stmt_info)))
== vectorization_factor);
#endif
/* -------- vectorize statement ------------ */
}
else
vectorization_factor = nunits;
+
+#ifdef ENABLE_CHECKING
+ gcc_assert (GET_MODE_SIZE (TYPE_MODE (scalar_type))
+ * vectorization_factor == UNITS_PER_SIMD_WORD);
+#endif
}
}
/* TODO: Analyze cost. Decide if worth while to vectorize. */
- if (!vectorization_factor)
+
+ if (vectorization_factor <= 1)
{
if (vect_debug_stats (loop) || vect_debug_details (loop))
fprintf (dump_file, "not vectorized: unsupported data-type");