From patchwork Sat Nov 12 01:44:58 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Martin Jambor X-Patchwork-Id: 19067 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp1061520wru; Fri, 11 Nov 2022 17:46:09 -0800 (PST) X-Google-Smtp-Source: AA0mqf5xyrA74P6r8V2cm3dqfSmv2uAueVhGpWTc2kq7IRlPXiPuatFkHYMjcGPjvsdIfFW/uV0j X-Received: by 2002:a05:6402:2906:b0:461:c7bd:7da3 with SMTP id ee6-20020a056402290600b00461c7bd7da3mr3870701edb.218.1668217568894; Fri, 11 Nov 2022 17:46:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668217568; cv=none; d=google.com; s=arc-20160816; b=NfYRk59/pTe/0Hi0IxOHomnW4u50nO969ZbO8r81k78jnRJphHvebW0mgG3s2eG7Gu RkQJzUcEMs02xsdgTMLr+I88qQd2CEdzXTSlgjQsQHmnJ4g0+s15zzb/WZsDTg4rov1C KRAgBHhfEtvY0sYaHUCgDSBADyx1TZeMXp7A65CqBDD9La9K5Uf98h2WCSlR4NQw5MCj /igXd0THtsmBQWvdzWofRD5Ve/gJ2baf4J69aAtNIO3v/P65x98R8j+FDefUsT1DhWUU Veqxxal2Ktd2pjAx/taWkkDLc+kEf0C7JpDKTP4Hunti/jqjf+OM8aIIQoVC1w0BPqIH g8sw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:mime-version:message-id:date :user-agent:subject:cc:to:from:dkim-signature:dkim-signature :dmarc-filter:delivered-to; bh=f+AMXUZu0LSwpdChPA2uh8bqC5Pzw0FQQ5zFXWdPnXI=; b=f8Ht30dJxPuCyNFVP58ngFOneubcv8qsN4TMQk4hg6g7d3IMJWvfpQutRh+e/z4f3z HYkzLXD1ejXZ/kJVso1YL3gZE4iVMEDVN0Nq+dCz0s0GoatlCWlc4ZStGg3E03avFGW/ pVAL2bRxcAW8Cxz80fU1xTnXxvz16dWodm5aQsgubHZE8UTRlSQtYE880BL761jzt+/Y /9N88X/zYW0Hxm6OGHGrgO3nYr8mMHU2Mm6X/biAbm4ELjcnekTr6zQxydgV0prAA6qU XbYb1XDlPZFzIlwWDUgnuwArUVaGC+H3pEAz146ZqAg77sEZ8OQl5xcNFxFfZ5XMqV0a ZDXQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=kTBrj2yY; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519 header.b=zIC0SsRP; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id sg40-20020a170907a42800b007ae814af68dsi3622484ejc.355.2022.11.11.17.46.08 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Nov 2022 17:46:08 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=kTBrj2yY; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519 header.b=zIC0SsRP; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 514D43885503 for ; Sat, 12 Nov 2022 01:45:28 +0000 (GMT) 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 [IPv6:2001:67c:2178:6::1d]) by sourceware.org (Postfix) with ESMTPS id 06DE438438E2 for ; Sat, 12 Nov 2022 01:45:01 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 06DE438438E2 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=suse.cz Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=suse.cz 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 279C91F45F; Sat, 12 Nov 2022 01:44:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1668217499; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type; bh=f+AMXUZu0LSwpdChPA2uh8bqC5Pzw0FQQ5zFXWdPnXI=; b=kTBrj2yYt3A4aPTJy8f7GkOvI0vGcJRY+Rir3duGKlrKY/BljjAiNwrfmjR+KC0bMnTj0U lhvwYGPsawm/25iFNg1XZ8qA2Hx2K/xqZ2/hG/r7O6L/PKWUCrGnTNPMfN2WlIA12k7rpC CeLn1/cJI4rskT92AYMafAaFZW97flc= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1668217499; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type; bh=f+AMXUZu0LSwpdChPA2uh8bqC5Pzw0FQQ5zFXWdPnXI=; b=zIC0SsRPeRNIKzyZ5cSWJV9z02rlP6mO4t2/19Tk5aDc4gjBTqJlXsT3aN09FH3hRToZLa Gergk2Thd4dMqnBA== 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 19B0413273; Sat, 12 Nov 2022 01:44:59 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id 5es9Bpv6bmNeYwAAMHmgww (envelope-from ); Sat, 12 Nov 2022 01:44:59 +0000 From: Martin Jambor To: GCC Patches Cc: Jan Hubicka , Jan Hubicka Subject: [PATCH 01/12] ipa: IPA-SRA split detection simplification User-Agent: Notmuch/0.37 (https://notmuchmail.org) Emacs/28.1 (x86_64-suse-linux-gnu) Date: Sat, 12 Nov 2022 02:44:58 +0100 Message-ID: MIME-Version: 1.0 X-Spam-Status: No, score=-11.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_NONE, SPF_SOFTFAIL, TXREP 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: , Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749252905482614140?= X-GMAIL-MSGID: =?utf-8?q?1749252905482614140?= Hi, I have noticed that the flag m_split_modifications_p of ipa_param_body_adjustments is not really necessary as it has to correspond to whether m_replacements is non-empty so this patch removes it. This also simplifies a bit some patches I work on. Bootstrapped and tested on x86_64-linux. OK for master? Thanks, Martin gcc/ChangeLog: 2022-11-10 Martin Jambor * ipa-param-manipulation.cc (ipa_param_body_adjustments::common_initialization): Do not set m_split_modifications_p. (ipa_param_body_adjustments::ipa_param_body_adjustments): Remove initializations of m_split_modifications_p. (ipa_param_body_adjustments::modify_call_stmt): Check that m_replacements is empty instead of m_split_modifications_p. --- gcc/ipa-param-manipulation.cc | 29 +++++++++++++---------------- gcc/ipa-param-manipulation.h | 4 ---- 2 files changed, 13 insertions(+), 20 deletions(-) diff --git a/gcc/ipa-param-manipulation.cc b/gcc/ipa-param-manipulation.cc index 23a8cb84d48..cee0e23f946 100644 --- a/gcc/ipa-param-manipulation.cc +++ b/gcc/ipa-param-manipulation.cc @@ -1378,7 +1378,6 @@ ipa_param_body_adjustments::common_initialization (tree old_fndecl, if (apm->op == IPA_PARAM_OP_SPLIT) { - m_split_modifications_p = true; split[prev_index] = true; register_replacement (apm, new_parm); } @@ -1472,10 +1471,10 @@ ipa_param_body_adjustments ::ipa_param_body_adjustments (vec *adj_params, tree fndecl) : m_adj_params (adj_params), m_adjustments (NULL), m_reset_debug_decls (), - m_split_modifications_p (false), m_dead_stmts (), m_dead_ssas (), - m_dead_ssa_debug_equiv (), m_dead_stmt_debug_equiv (), m_fndecl (fndecl), - m_id (NULL), m_oparms (), m_new_decls (), m_new_types (), m_replacements (), - m_removed_decls (), m_removed_map (), m_method2func (false) + m_dead_stmts (), m_dead_ssas (), m_dead_ssa_debug_equiv (), + m_dead_stmt_debug_equiv (), m_fndecl (fndecl), m_id (NULL), m_oparms (), + m_new_decls (), m_new_types (), m_replacements (), m_removed_decls (), + m_removed_map (), m_method2func (false) { common_initialization (fndecl, NULL, NULL); } @@ -1489,11 +1488,10 @@ ipa_param_body_adjustments ::ipa_param_body_adjustments (ipa_param_adjustments *adjustments, tree fndecl) : m_adj_params (adjustments->m_adj_params), m_adjustments (adjustments), - m_reset_debug_decls (), m_split_modifications_p (false), m_dead_stmts (), - m_dead_ssas (), m_dead_ssa_debug_equiv (), m_dead_stmt_debug_equiv (), - m_fndecl (fndecl), m_id (NULL), m_oparms (), m_new_decls (), - m_new_types (), m_replacements (), m_removed_decls (), m_removed_map (), - m_method2func (false) + m_reset_debug_decls (), m_dead_stmts (), m_dead_ssas (), + m_dead_ssa_debug_equiv (), m_dead_stmt_debug_equiv (), m_fndecl (fndecl), + m_id (NULL), m_oparms (), m_new_decls (), m_new_types (), m_replacements (), + m_removed_decls (), m_removed_map (), m_method2func (false) { common_initialization (fndecl, NULL, NULL); } @@ -1513,11 +1511,10 @@ ipa_param_body_adjustments copy_body_data *id, tree *vars, vec *tree_map) : m_adj_params (adjustments->m_adj_params), m_adjustments (adjustments), - m_reset_debug_decls (), m_split_modifications_p (false), m_dead_stmts (), - m_dead_ssas (), m_dead_ssa_debug_equiv (), m_dead_stmt_debug_equiv (), - m_fndecl (fndecl), m_id (id), m_oparms (), m_new_decls (), m_new_types (), - m_replacements (), m_removed_decls (), m_removed_map (), - m_method2func (false) + m_reset_debug_decls (), m_dead_stmts (), m_dead_ssas (), + m_dead_ssa_debug_equiv (), m_dead_stmt_debug_equiv (), m_fndecl (fndecl), + m_id (id), m_oparms (), m_new_decls (), m_new_types (), m_replacements (), + m_removed_decls (), m_removed_map (), m_method2func (false) { common_initialization (old_fndecl, vars, tree_map); } @@ -1979,7 +1976,7 @@ ipa_param_body_adjustments::modify_call_stmt (gcall **stmt_p, && m_dead_ssas.contains (t)) recreate = true; - if (!m_split_modifications_p) + if (m_replacements.is_empty ()) continue; tree base; diff --git a/gcc/ipa-param-manipulation.h b/gcc/ipa-param-manipulation.h index a9ad2b216be..e5654f4ff70 100644 --- a/gcc/ipa-param-manipulation.h +++ b/gcc/ipa-param-manipulation.h @@ -350,10 +350,6 @@ public: auto_vec m_reset_debug_decls; - /* Set to true if there are any IPA_PARAM_OP_SPLIT adjustments among stored - adjustments. */ - bool m_split_modifications_p; - /* Sets of statements and SSA_NAMEs that only manipulate data from parameters removed because they are not necessary. */ hash_set m_dead_stmts;