" non-consecutive accesses\n");
return false;
}
+
+ unsigned HOST_WIDE_INT dr_size
+ = vect_get_scalar_dr_size (first_dr_info);
+ poly_int64 off = 0;
+ if (*memory_access_type == VMAT_CONTIGUOUS_REVERSE)
+ off = (TYPE_VECTOR_SUBPARTS (vectype) - 1) * -dr_size;
+
/* An overrun is fine if the trailing elements are smaller
than the alignment boundary B. Every vector access will
be a multiple of B and so we are guaranteed to access a
non-gap element in the same B-sized block. */
if (overrun_p
&& gap < (vect_known_alignment_in_bytes (first_dr_info,
- vectype)
- / vect_get_scalar_dr_size (first_dr_info)))
+ vectype, off) / dr_size))
overrun_p = false;
/* When we have a contiguous access across loop iterations
by simply loading half of the vector only. Usually
the construction with an upper zero half will be elided. */
dr_alignment_support alss;
- int misalign = dr_misalignment (first_dr_info, vectype);
+ int misalign = dr_misalignment (first_dr_info, vectype, off);
tree half_vtype;
poly_uint64 remain;
unsigned HOST_WIDE_INT tem, num;
tree ltype = vectype;
tree new_vtype = NULL_TREE;
unsigned HOST_WIDE_INT gap = DR_GROUP_GAP (first_stmt_info);
+ unsigned HOST_WIDE_INT dr_size
+ = vect_get_scalar_dr_size (first_dr_info);
+ poly_int64 off = 0;
+ if (memory_access_type == VMAT_CONTIGUOUS_REVERSE)
+ off = (TYPE_VECTOR_SUBPARTS (vectype) - 1) * -dr_size;
unsigned int vect_align
- = vect_known_alignment_in_bytes (first_dr_info, vectype);
+ = vect_known_alignment_in_bytes (first_dr_info, vectype,
+ off);
/* Try to use a single smaller load when we are about
to load excess elements compared to the unrolled
scalar loop. */
scalar loop. */
;
else if (known_gt (vect_align,
- ((nunits - remain)
- * vect_get_scalar_dr_size
- (first_dr_info))))
+ ((nunits - remain) * dr_size)))
/* Aligned access to the gap area when there's
at least one element in it is OK. */
;
of DR_INFO is guaranteed to have. */
inline unsigned int
-vect_known_alignment_in_bytes (dr_vec_info *dr_info, tree vectype)
+vect_known_alignment_in_bytes (dr_vec_info *dr_info, tree vectype,
+ poly_int64 offset = 0)
{
- int misalignment = dr_misalignment (dr_info, vectype);
+ int misalignment = dr_misalignment (dr_info, vectype, offset);
if (misalignment == DR_MISALIGNMENT_UNKNOWN)
return TYPE_ALIGN_UNIT (TREE_TYPE (DR_REF (dr_info->dr)));
else if (misalignment == 0)