From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1666) id B3C4F385829C; Mon, 11 Jul 2022 07:30:05 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B3C4F385829C MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Richard Biener To: gcc-cvs@gcc.gnu.org Subject: [gcc r13-1599] tree-optimization/106228 - fix vect_setup_realignment virtual SSA handling X-Act-Checkin: gcc X-Git-Author: Richard Biener X-Git-Refname: refs/heads/master X-Git-Oldrev: 0a7e721a6499a42f04361caf24772547afdeed57 X-Git-Newrev: 79f18ac6b7ab7744fcf8937ea4bc0c40f3efc629 Message-Id: <20220711073005.B3C4F385829C@sourceware.org> Date: Mon, 11 Jul 2022 07:30:05 +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, 11 Jul 2022 07:30:05 -0000 https://gcc.gnu.org/g:79f18ac6b7ab7744fcf8937ea4bc0c40f3efc629 commit r13-1599-g79f18ac6b7ab7744fcf8937ea4bc0c40f3efc629 Author: Richard Biener Date: Mon Jul 11 09:23:50 2022 +0200 tree-optimization/106228 - fix vect_setup_realignment virtual SSA handling The following adds missing assignment of a virtual use operand to a created load to vect_setup_realignment which shows as bootstrap failure on powerpc64-linux and extra testsuite fails for targets when misaligned loads are not supported or not optimal. PR tree-optimization/106228 * tree-vect-data-refs.cc (vect_setup_realignment): Properly set a VUSE operand on the emitted load. Diff: --- gcc/tree-vect-data-refs.cc | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/gcc/tree-vect-data-refs.cc b/gcc/tree-vect-data-refs.cc index d20a10a1524..53e52cb58cb 100644 --- a/gcc/tree-vect-data-refs.cc +++ b/gcc/tree-vect-data-refs.cc @@ -5780,6 +5780,13 @@ vect_setup_realignment (vec_info *vinfo, stmt_vec_info stmt_info, if (loop_for_initial_load) pe = loop_preheader_edge (loop_for_initial_load); + tree vuse; + gphi *vphi = get_virtual_phi (loop_for_initial_load->header); + if (vphi) + vuse = PHI_ARG_DEF_FROM_EDGE (vphi, pe); + else + vuse = gimple_vuse (gsi_stmt (*gsi)); + /* 3. For the case of the optimized realignment, create the first vector load at the loop preheader. */ @@ -5813,6 +5820,7 @@ vect_setup_realignment (vec_info *vinfo, stmt_vec_info stmt_info, new_stmt = gimple_build_assign (vec_dest, data_ref); new_temp = make_ssa_name (vec_dest, new_stmt); gimple_assign_set_lhs (new_stmt, new_temp); + gimple_set_vuse (new_stmt, vuse); if (pe) { new_bb = gsi_insert_on_edge_immediate (pe, new_stmt);