From patchwork Tue Jun 28 11:12:43 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Biener X-Patchwork-Id: 55483 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 4F6F439024D8 for ; Tue, 28 Jun 2022 14:27:25 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 4F6F439024D8 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1656426445; bh=teVvka9cWqNPzmx8Ayrviiz3cdYmDR2lZNqCDMcDgLI=; h=Date:To:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=ne46RQWyxdltK/Gu6Z3oE3DkzjUHC02cDNfAINqE+49PIfLmC3pOG0F/klJzmR0bh VSKURVO/G9ipJ0yMzYFVXOJxDwrKvAMG+VHVFyczgyqA73W6vDfJeKlwMcvIUrjw50 jFXAHVWyAjf1KgE1E5GbT1NUa0NAU1dHqhsOyz9g= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by sourceware.org (Postfix) with ESMTPS id E7F2C383575A for ; Tue, 28 Jun 2022 11:12:44 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org E7F2C383575A Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out2.suse.de (Postfix) with ESMTP id 7EBCA1F964 for ; Tue, 28 Jun 2022 11:12:43 +0000 (UTC) Received: from wotan.suse.de (wotan.suse.de [10.160.0.1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by relay2.suse.de (Postfix) with ESMTPS id 79BFE2C141 for ; Tue, 28 Jun 2022 11:12:43 +0000 (UTC) Date: Tue, 28 Jun 2022 11:12:43 +0000 (UTC) To: gcc-patches@gcc.gnu.org Subject: [PATCH] Use mark_block_for_update properly in insert_updated_phi_nodes_for User-Agent: Alpine 2.22 (LSU 394 2020-01-19) MIME-Version: 1.0 X-Spam-Status: No, score=-10.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, MISSING_MID, 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-Patchwork-Original-From: Richard Biener via Gcc-patches From: Richard Biener Reply-To: Richard Biener Errors-To: gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org Sender: "Gcc-patches" Message-Id: <20220628142725.4F6F439024D8@sourceware.org> This makes sure to use mark_block_for_update when adding a block for rewriting in insert_updated_phi_nodes_for as otherwise stmt flags are not initialized. Bootstrapped and tested on x86_64-unknown-linux-gnu, pushed. 2022-06-28 Richard Biener * tree-into-ssa.cc (insert_updated_phi_nodes_for): Use mark_block_for_update. (update_ssa): Adjust. --- gcc/tree-into-ssa.cc | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/gcc/tree-into-ssa.cc b/gcc/tree-into-ssa.cc index 9631d8c6556..f9655ce1a28 100644 --- a/gcc/tree-into-ssa.cc +++ b/gcc/tree-into-ssa.cc @@ -3109,7 +3109,7 @@ release_ssa_name_after_update_ssa (tree name) /* Insert new PHI nodes to replace VAR. DFS contains dominance - frontier information. BLOCKS is the set of blocks to be updated. + frontier information. This is slightly different than the regular PHI insertion algorithm. The value of UPDATE_FLAGS controls how PHI nodes for @@ -3132,8 +3132,8 @@ release_ssa_name_after_update_ssa (tree name) names is not pruned. PHI nodes are inserted at every IDF block. */ static void -insert_updated_phi_nodes_for (tree var, bitmap_head *dfs, bitmap blocks, - unsigned update_flags) +insert_updated_phi_nodes_for (tree var, bitmap_head *dfs, + unsigned update_flags) { basic_block entry; def_blocks *db; @@ -3197,16 +3197,16 @@ insert_updated_phi_nodes_for (tree var, bitmap_head *dfs, bitmap blocks, /* FIXME, this is not needed if we are updating symbols. We are already starting at the ENTRY block anyway. */ - bitmap_ior_into (blocks, pruned_idf); EXECUTE_IF_SET_IN_BITMAP (pruned_idf, 0, i, bi) { edge e; edge_iterator ei; basic_block bb = BASIC_BLOCK_FOR_FN (cfun, i); + mark_block_for_update (bb); FOR_EACH_EDGE (e, ei, bb->preds) if (e->src->index >= 0) - bitmap_set_bit (blocks, e->src->index); + mark_block_for_update (e->src); } insert_phi_nodes_for (var, pruned_idf, true); @@ -3475,14 +3475,12 @@ update_ssa (unsigned update_flags) auto_sbitmap tmp (SBITMAP_SIZE (old_ssa_names)); bitmap_copy (tmp, old_ssa_names); EXECUTE_IF_SET_IN_BITMAP (tmp, 0, i, sbi) - insert_updated_phi_nodes_for (ssa_name (i), dfs, blocks_to_update, - update_flags); + insert_updated_phi_nodes_for (ssa_name (i), dfs, update_flags); } symbols_to_rename.qsort (insert_updated_phi_nodes_compare_uids); FOR_EACH_VEC_ELT (symbols_to_rename, i, sym) - insert_updated_phi_nodes_for (sym, dfs, blocks_to_update, - update_flags); + insert_updated_phi_nodes_for (sym, dfs, update_flags); FOR_EACH_BB_FN (bb, cfun) bitmap_clear (&dfs[bb->index]);