diff options
author | Richard Biener <rguenther@suse.de> | 2021-09-30 13:05:45 +0200 |
---|---|---|
committer | Richard Biener <rguenther@suse.de> | 2021-09-30 13:08:16 +0200 |
commit | 09f032c22053f178c802d83a1dea49a0d47c7cc4 (patch) | |
tree | 98bf64d034599586da5e535e9a4cdb2193240dbf /gcc/tree-vect-data-refs.c | |
parent | c2dc29c4a54b8d80c4fbd753d65b75f4313ffec3 (diff) | |
download | gcc-09f032c22053f178c802d83a1dea49a0d47c7cc4.zip gcc-09f032c22053f178c802d83a1dea49a0d47c7cc4.tar.gz gcc-09f032c22053f178c802d83a1dea49a0d47c7cc4.tar.bz2 |
Refine alingment peeling fix
This refines the previous fix further by reverting to the original
code since the API is a bit of a mess. It also fixes the vector type
used to query the misalignment - that was what triggered the original
bogus change.
2021-09-30 Richard Biener <rguenther@suse.de>
* tree-vect-data-refs.c (vect_update_misalignment_for_peel):
Restore and fix condition under which we apply npeel to
the DRs misalignment value.
Diffstat (limited to 'gcc/tree-vect-data-refs.c')
-rw-r--r-- | gcc/tree-vect-data-refs.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/gcc/tree-vect-data-refs.c b/gcc/tree-vect-data-refs.c index bece58d..07b5ba1 100644 --- a/gcc/tree-vect-data-refs.c +++ b/gcc/tree-vect-data-refs.c @@ -1262,10 +1262,11 @@ vect_update_misalignment_for_peel (dr_vec_info *dr_info, } unsigned HOST_WIDE_INT alignment; - tree vectype = STMT_VINFO_VECTYPE (dr_info->stmt); if (DR_TARGET_ALIGNMENT (dr_info).is_constant (&alignment) - && known_alignment_for_access_p (dr_info, vectype) - && npeel != 0) + && known_alignment_for_access_p (dr_info, + STMT_VINFO_VECTYPE (dr_info->stmt)) + && known_alignment_for_access_p (dr_peel_info, + STMT_VINFO_VECTYPE (dr_peel_info->stmt))) { int misal = dr_info->misalignment; misal += npeel * TREE_INT_CST_LOW (DR_STEP (dr_info->dr)); @@ -1515,7 +1516,8 @@ vect_peeling_hash_get_most_frequent (_vect_peel_info **slot, /* Get the costs of peeling NPEEL iterations for LOOP_VINFO, checking data access costs for all data refs. If UNKNOWN_MISALIGNMENT is true, - we assume DR0_INFO's misalignment will be zero after peeling. */ + npeel is computed at runtime but DR0_INFO's misalignment will be zero + after peeling. */ static void vect_get_peeling_costs_all_drs (loop_vec_info loop_vinfo, |