From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by sourceware.org (Postfix) with ESMTPS id 5C58A3858400 for ; Mon, 11 Jul 2022 07:25:56 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 5C58A3858400 Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 010611F8F1 for ; Mon, 11 Jul 2022 07:25:55 +0000 (UTC) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id E137113524 for ; Mon, 11 Jul 2022 07:25:54 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id 4jHONYLQy2LpCAAAMHmgww (envelope-from ) for ; Mon, 11 Jul 2022 07:25:54 +0000 Date: Mon, 11 Jul 2022 09:25:54 +0200 (CEST) From: Richard Biener To: gcc-patches@gcc.gnu.org Subject: [PATCH] tree-optimization/106228 - fix vect_setup_realignment virtual SSA handling MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Message-Id: <20220711072554.E137113524@imap2.suse-dmz.suse.de> X-Spam-Status: No, score=-11.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 11 Jul 2022 07:25:57 -0000 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. Bootstrapped on x86_64-unknown-linux-gnu, testing in progress. PR tree-optimization/106228 * tree-vect-data-refs.cc (vect_setup_realignment): Properly set a VUSE operand on the emitted load. --- 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); -- 2.35.3