static void
vect_peeling_hash_insert (hash_table<peel_info_hasher> *peeling_htab,
loop_vec_info loop_vinfo, dr_vec_info *dr_info,
- int npeel)
+ int npeel, bool supportable_if_not_aligned)
{
struct _vect_peel_info elem, *slot;
_vect_peel_info **new_slot;
- tree vectype = STMT_VINFO_VECTYPE (dr_info->stmt);
- bool supportable_dr_alignment
- = (vect_supportable_dr_alignment (loop_vinfo, dr_info, vectype, true)
- != dr_unaligned_unsupported);
elem.npeel = npeel;
slot = peeling_htab->find (&elem);
*new_slot = slot;
}
- if (!supportable_dr_alignment
+ /* If this DR is not supported with unknown misalignment then bias
+ this slot when the cost model is disabled. */
+ if (!supportable_if_not_aligned
&& unlimited_cost_model (LOOP_VINFO_LOOP (loop_vinfo)))
slot->count += VECT_MAX_COST;
}
vect_update_misalignment_for_peel (dr_info, dr0_info, npeel);
tree vectype = STMT_VINFO_VECTYPE (dr_info->stmt);
supportable_dr_alignment
- = vect_supportable_dr_alignment (loop_vinfo, dr_info, vectype, false);
+ = vect_supportable_dr_alignment (loop_vinfo, dr_info, vectype);
SET_DR_MISALIGNMENT (dr_info, save_misalignment);
if (supportable_dr_alignment == dr_unaligned_unsupported)
vect_enhance_data_refs_alignment (loop_vec_info loop_vinfo)
{
class loop *loop = LOOP_VINFO_LOOP (loop_vinfo);
- enum dr_alignment_support supportable_dr_alignment;
dr_vec_info *first_store = NULL;
dr_vec_info *dr0_info = NULL;
struct data_reference *dr;
stmt_vec_info stmt_info = dr_info->stmt;
tree vectype = STMT_VINFO_VECTYPE (stmt_info);
- supportable_dr_alignment
- = vect_supportable_dr_alignment (loop_vinfo, dr_info, vectype, true);
do_peeling = vector_alignment_reachable_p (dr_info);
if (do_peeling)
{
}
/* Save info about DR in the hash table. Also include peeling
- amounts according to the explanation above. */
+ amounts according to the explanation above. Indicate
+ the alignment status when the ref is not aligned.
+ ??? Rather than using unknown alignment here we should
+ prune all entries from the peeling hashtable which cause
+ DRs to be not supported. */
+ bool supportable_if_not_aligned
+ = targetm.vectorize.support_vector_misalignment
+ (TYPE_MODE (vectype), TREE_TYPE (DR_REF (dr_info->dr)),
+ DR_MISALIGNMENT_UNKNOWN, false);
while (known_le (npeel_tmp, nscalars))
{
vect_peeling_hash_insert (&peeling_htab, loop_vinfo,
- dr_info, npeel_tmp);
+ dr_info, npeel_tmp,
+ supportable_if_not_aligned);
npeel_tmp += MAX (1, target_align / dr_size);
}
/* Check for data refs with unsupportable alignment that
can be peeled. */
+ enum dr_alignment_support supportable_dr_alignment
+ = vect_supportable_dr_alignment (loop_vinfo, dr_info, vectype);
if (supportable_dr_alignment == dr_unaligned_unsupported)
{
one_dr_unsupportable = true;
break;
}
- supportable_dr_alignment
- = vect_supportable_dr_alignment (loop_vinfo, dr_info, vectype,
- false);
+ enum dr_alignment_support supportable_dr_alignment
+ = vect_supportable_dr_alignment (loop_vinfo, dr_info, vectype);
if (supportable_dr_alignment == dr_unaligned_unsupported)
{
if (known_alignment_for_access_p (dr_info, vectype)
}
tree vectype = STMT_VINFO_VECTYPE (stmt_vinfo);
if (STMT_VINFO_VEC_STMTS (stmt_vinfo).exists ()
- && (vect_supportable_dr_alignment (vinfo, dr_info, vectype, false)
+ && (vect_supportable_dr_alignment (vinfo, dr_info, vectype)
== dr_explicit_realign_optimized))
{
/* We might access a full vector's worth. */
enum dr_alignment_support
vect_supportable_dr_alignment (vec_info *vinfo, dr_vec_info *dr_info,
- tree vectype, bool check_aligned_accesses)
+ tree vectype)
{
data_reference *dr = dr_info->dr;
stmt_vec_info stmt_info = dr_info->stmt;
class loop *vect_loop = NULL;
bool nested_in_vect_loop = false;
- if (aligned_access_p (dr_info, vectype) && !check_aligned_accesses)
+ if (aligned_access_p (dr_info, vectype))
return dr_aligned;
/* For now assume all conditional loads/stores support unaligned
dr_vec_info *dr_info = STMT_VINFO_DR_INFO (stmt_info);
tree vectype = STMT_VINFO_VECTYPE (stmt_info);
dr_alignment_support alignment_support_scheme
- = vect_supportable_dr_alignment (vinfo, dr_info, vectype, false);
+ = vect_supportable_dr_alignment (vinfo, dr_info, vectype);
switch (alignment_support_scheme)
{
dr_vec_info *dr_info = STMT_VINFO_DR_INFO (stmt_info);
tree vectype = STMT_VINFO_VECTYPE (stmt_info);
dr_alignment_support alignment_support_scheme
- = vect_supportable_dr_alignment (vinfo, dr_info, vectype, false);
+ = vect_supportable_dr_alignment (vinfo, dr_info, vectype);
switch (alignment_support_scheme)
{
}
alignment_support_scheme = vect_supportable_dr_alignment (vinfo, dr_info,
- vectype, false);
+ vectype);
if (alignment_support_scheme != dr_aligned
&& alignment_support_scheme != dr_unaligned_supported)
{
&& !masked_p
&& (((alignment_support_scheme
= vect_supportable_dr_alignment (vinfo, first_dr_info,
- vectype, false)))
+ vectype)))
== dr_aligned
|| alignment_support_scheme == dr_unaligned_supported)
&& known_eq (nunits, (group_size - gap) * 2)
*alignment_support_scheme = dr_unaligned_supported;
else
*alignment_support_scheme
- = vect_supportable_dr_alignment (vinfo, first_dr_info, vectype, false);
+ = vect_supportable_dr_alignment (vinfo, first_dr_info, vectype);
if (vls_type != VLS_LOAD && first_stmt_info == stmt_info)
{
*alignment_support_scheme
= vect_supportable_dr_alignment (vinfo,
STMT_VINFO_DR_INFO (stmt_info),
- vectype, false);
+ vectype);
}
}