From patchwork Fri Jul 1 13:21:06 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Biener X-Patchwork-Id: 1651199 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.a=rsa-sha256 header.s=default header.b=DlfMX285; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Received: from sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4LZG7G3C6pz9s09 for ; Fri, 1 Jul 2022 23:21:30 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 0118E385C8B0 for ; Fri, 1 Jul 2022 13:21:28 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0118E385C8B0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1656681688; bh=R+oIIuLi2Hi/T05OnANmDya3EETmCthR3HeYY7IVW3U=; h=Date:To:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=DlfMX285qH9YoorXPoHjU069fXT+GN3WJBPEsvWW542+HkXEqW/N1jFeTUIb21Wa7 QbVWaUEvmn0BSluTcito9I/eHYhNCDjVdAgLySX9rXK+275Li+LB+nvnyBY94CAAer Cy9XZPBUwkrz3Ust08nwLbvaM6GHHkm0RiVGzjKE= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by sourceware.org (Postfix) with ESMTPS id 8A485385C8B2 for ; Fri, 1 Jul 2022 13:21:07 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 8A485385C8B2 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-out1.suse.de (Postfix) with ESMTPS id B1C0622017 for ; Fri, 1 Jul 2022 13:21:06 +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 9F7C313484 for ; Fri, 1 Jul 2022 13:21:06 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id mVvzJcL0vmJFRQAAMHmgww (envelope-from ) for ; Fri, 01 Jul 2022 13:21:06 +0000 Date: Fri, 1 Jul 2022 15:21:06 +0200 (CEST) To: gcc-patches@gcc.gnu.org Subject: [PATCH] Avoid unused sbitmap in update_ssa MIME-Version: 1.0 Message-Id: <20220701132106.9F7C313484@imap2.suse-dmz.suse.de> X-Spam-Status: No, score=-11.7 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-Patchwork-Original-From: Richard Biener via Gcc-patches From: Richard Biener Reply-To: Richard Biener Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org Sender: "Gcc-patches" The following avoids copying and using blocks_to_update to the interesting_blocks sbitmap when doing update_ssa as it is unused besides the redundant query in the domwalk. Bootstrapped and tested on x86_64-unknown-linux-gnu, pushed. * tree-into-ssa.cc (rewrite_update_dom_walker::before_dom_children): Do not look at interesting_blocks which is a copy of blocks_to_update. (update_ssa): Do not initialize it. (pass_build_ssa::execute): Set interesting_blocks to NULL after releasing it. --- gcc/tree-into-ssa.cc | 22 ++++++---------------- 1 file changed, 6 insertions(+), 16 deletions(-) diff --git a/gcc/tree-into-ssa.cc b/gcc/tree-into-ssa.cc index c4e40e8fb08..c90651c3a89 100644 --- a/gcc/tree-into-ssa.cc +++ b/gcc/tree-into-ssa.cc @@ -2214,15 +2214,11 @@ rewrite_update_dom_walker::before_dom_children (basic_block bb) } /* Step 2. Rewrite every variable used in each statement in the block. */ - if (bitmap_bit_p (interesting_blocks, bb->index)) - { - gcc_checking_assert (bitmap_bit_p (blocks_to_update, bb->index)); - for (gimple_stmt_iterator gsi = gsi_start_bb (bb); !gsi_end_p (gsi); ) - if (rewrite_update_stmt (gsi_stmt (gsi), gsi)) - gsi_remove (&gsi, true); - else - gsi_next (&gsi); - } + for (gimple_stmt_iterator gsi = gsi_start_bb (bb); !gsi_end_p (gsi); ) + if (rewrite_update_stmt (gsi_stmt (gsi), gsi)) + gsi_remove (&gsi, true); + else + gsi_next (&gsi); /* Step 3. Update PHI nodes. */ rewrite_update_phi_arguments (bb); @@ -2460,6 +2456,7 @@ pass_build_ssa::execute (function *fun) free (dfs); sbitmap_free (interesting_blocks); + interesting_blocks = NULL; fini_ssa_renamer (); @@ -3503,15 +3500,8 @@ update_ssa (unsigned update_flags) get_var_info (sym)->info.current_def = NULL_TREE; /* Now start the renaming process at START_BB. */ - interesting_blocks = sbitmap_alloc (last_basic_block_for_fn (cfun)); - bitmap_clear (interesting_blocks); - EXECUTE_IF_SET_IN_BITMAP (blocks_to_update, 0, i, bi) - bitmap_set_bit (interesting_blocks, i); - rewrite_blocks (start_bb, REWRITE_UPDATE); - sbitmap_free (interesting_blocks); - /* Debugging dumps. */ if (dump_file) {