--- /dev/null
+// { dg-do compile }
+// { dg-require-effective-target vect_int }
+
+void foo (int *p)
+{
+ for (int i = 0; i < 1024; ++i)
+ {
+ int a0 = p[2*i + 0];
+ int a1 = p[2*i + 1];
+ p[2*i + 4] = a0;
+ p[2*i + 5] = a1;
+ }
+}
+
+/* { dg-final { scan-tree-dump "loop vectorized using 16 byte vectors" "vect" { target { vect128 && vect_hw_misalign } } } } */
*/
opt_result
-vect_analyze_data_refs (vec_info *vinfo, poly_uint64 *min_vf, bool *fatal)
+vect_analyze_data_refs (vec_info *vinfo, bool *fatal)
{
class loop *loop = NULL;
unsigned int i;
FOR_EACH_VEC_ELT (datarefs, i, dr)
{
enum { SG_NONE, GATHER, SCATTER } gatherscatter = SG_NONE;
- poly_uint64 vf;
gcc_assert (DR_REF (dr));
stmt_vec_info stmt_info = vinfo->lookup_stmt (DR_STMT (dr));
stmt_info->stmt, vectype);
}
- /* Adjust the minimal vectorization factor according to the
- vector type. */
- vf = TYPE_VECTOR_SUBPARTS (vectype);
- *min_vf = upper_bound (*min_vf, vf);
-
/* Leave the BB vectorizer to pick the vector type later, based on
the final dataref group size and SLP node size. */
if (is_a <loop_vec_info> (vinfo))
opt_result ok = opt_result::success ();
int res;
unsigned int max_vf = MAX_VECTORIZATION_FACTOR;
- poly_uint64 min_vf = 2;
loop_vec_info orig_loop_vinfo = NULL;
/* If we are dealing with an epilogue then orig_loop_vinfo points to the
/* Analyze the data references and also adjust the minimal
vectorization factor according to the loads and stores. */
- ok = vect_analyze_data_refs (loop_vinfo, &min_vf, &fatal);
+ ok = vect_analyze_data_refs (loop_vinfo, &fatal);
if (!ok)
{
if (dump_enabled_p ())
"bad data dependence.\n");
return ok;
}
- if (max_vf != MAX_VECTORIZATION_FACTOR
- && maybe_lt (max_vf, min_vf))
- return opt_result::failure_at (vect_location, "bad data dependence.\n");
LOOP_VINFO_MAX_VECT_FACTOR (loop_vinfo) = max_vf;
ok = vect_set_stmts_vectype (loop_vinfo);
slp_instance instance;
int i;
- poly_uint64 min_vf = 2;
/* The first group of checks is independent of the vector size. */
fatal = true;
/* Analyze the data references. */
- if (!vect_analyze_data_refs (bb_vinfo, &min_vf, NULL))
+ if (!vect_analyze_data_refs (bb_vinfo, NULL))
{
if (dump_enabled_p ())
dump_printf_loc (MSG_MISSED_OPTIMIZATION, vect_location,
extern opt_result vect_find_stmt_data_reference (loop_p, gimple *,
vec<data_reference_p> *,
vec<int> *, int);
-extern opt_result vect_analyze_data_refs (vec_info *, poly_uint64 *, bool *);
+extern opt_result vect_analyze_data_refs (vec_info *, bool *);
extern void vect_record_base_alignments (vec_info *);
extern tree vect_create_data_ref_ptr (vec_info *,
stmt_vec_info, tree, class loop *, tree,