From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2063) id BB87B3858401; Mon, 8 Nov 2021 05:34:16 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org BB87B3858401 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Kewen Lin To: gcc-cvs@gcc.gnu.org Subject: [gcc r11-9219] vect: Don't update inits for simd_lane_access DRs [PR102789] X-Act-Checkin: gcc X-Git-Author: Kewen Lin X-Git-Refname: refs/heads/releases/gcc-11 X-Git-Oldrev: 1245e713d2369520754332c7ecab61cce3a594c2 X-Git-Newrev: 7cb3b868f702e63e53ee1880c6b8a61676144395 Message-Id: <20211108053416.BB87B3858401@sourceware.org> Date: Mon, 8 Nov 2021 05:34:16 +0000 (GMT) X-BeenThere: gcc-cvs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Nov 2021 05:34:16 -0000 https://gcc.gnu.org/g:7cb3b868f702e63e53ee1880c6b8a61676144395 commit r11-9219-g7cb3b868f702e63e53ee1880c6b8a61676144395 Author: Kewen Lin 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 012f48bd487..d57108be578 100644 --- a/gcc/tree-vect-loop-manip.c +++ b/gcc/tree-vect-loop-manip.c @@ -1822,7 +1822,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_info, niters, code); } }