public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r9-9815] vect: Don't update inits for simd_lane_access DRs [PR102789]
@ 2021-11-08  5:31 Kewen Lin
  0 siblings, 0 replies; only message in thread
From: Kewen Lin @ 2021-11-08  5:31 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:6cce26752d8431a1ef6d3f9a97fa0ee2e9f96816

commit r9-9815-g6cce26752d8431a1ef6d3f9a97fa0ee2e9f96816
Author: Kewen Lin <linkw@linux.ibm.com>
Date:   Mon Oct 25 21:05:02 2021 -0500

    vect: Don't update inits for simd_lane_access DRs [PR102789]
    
    As PR102789 shows, when vectorizer does some peelings for alignment
    in prologues, function vect_update_inits_of_drs would update the
    inits of some drs.  But as the failed case, we shouldn't update the
    dr for simd_lane_access, it has the fixed-length storage mainly for
    the main loop, the update can make the access out of bound and access
    the unexpected element.
    
    gcc/ChangeLog:
    
            PR tree-optimization/102789
            * tree-vect-loop-manip.c (vect_update_inits_of_drs): Do not
            update inits of simd_lane_access.
    
    (cherry picked from commit f3dbd3f36d55178d0a9e4431043cbc950524969a)

Diff:
---
 gcc/tree-vect-loop-manip.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/gcc/tree-vect-loop-manip.c b/gcc/tree-vect-loop-manip.c
index 030effcd79d..4951e1d505f 100644
--- a/gcc/tree-vect-loop-manip.c
+++ b/gcc/tree-vect-loop-manip.c
@@ -1774,7 +1774,8 @@ vect_update_inits_of_drs (loop_vec_info loop_vinfo, tree niters,
   FOR_EACH_VEC_ELT (datarefs, i, dr)
     {
       dr_vec_info *dr_info = loop_vinfo->lookup_dr (dr);
-      if (!STMT_VINFO_GATHER_SCATTER_P (dr_info->stmt))
+      if (!STMT_VINFO_GATHER_SCATTER_P (dr_info->stmt)
+	  && !STMT_VINFO_SIMD_LANE_ACCESS_P (dr_info->stmt))
 	vect_update_init_of_dr (dr, niters, code);
     }
 }


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-11-08  5:31 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-08  5:31 [gcc r9-9815] vect: Don't update inits for simd_lane_access DRs [PR102789] Kewen Lin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).