Message ID | ri6fsepkkou.fsf@suse.cz |
---|---|
State | Accepted |
Headers |
Return-Path: <gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp1063199wru; Fri, 11 Nov 2022 17:52:19 -0800 (PST) X-Google-Smtp-Source: AA0mqf4jVyW7KO3Ci77145o4BX05lyU0n7LAslpl0fvcNzN6kuRff88uDg2Jp/GPWc+Bq+0UZcgi X-Received: by 2002:a17:906:4a8b:b0:7ad:ba48:7e7c with SMTP id x11-20020a1709064a8b00b007adba487e7cmr3919884eju.443.1668217939798; Fri, 11 Nov 2022 17:52:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668217939; cv=none; d=google.com; s=arc-20160816; b=HNOpLFsQ0cJQOaQ/fdGp3OOqZw93RGhAtlX3qfQNiX8VRokmarzpTCbF6TA0sK3lbo XbJnDWgvueoQkUEcaI6eEgz52sQaVM3GSbZxTVOp2kYp888oX6mmxfmWs1ftwspSO2ok 0A967/0ybeohicxnjHtHDpg7XAlQE1JNtybFgGhnyB117rxq5y2oJjvovDYkALc3B6Iq KHLVexfuIXEcueRQdYQ5LGPZzJMVwe7Knlq27QZiv9OD8KBSIxESvVWdUihLPopImLxx IsL8lL5GNd8Y1H2e+JFHrl67x10foPvnt6wEvummsIwWYZvi7XNGIBVFnbk6Glf2OFti apAw== 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=KMC5B7R3Qiis6dE5+HF1JMmwSrAZiXeTu1U7gEG6QNg=; b=DmIvSejdi3QUGU44jPotR5j9ZWbyzRCIJxq2ITsUyJgbdBzFtTC6U4+FXwUc2PaQbV 2DhZRwynT2PyS+Af5dNRNgbt5hfBvy6qfsmzuLgc+QEPNbRN0qnQ/JyMO9vp2z2c7jVO o3+DU/a1VxgaxzM6Qjx9nXEPY9fsZDyi8rBAI1677xMlbBvYj6hSt2+qUwmFy2wxQYsu zsSF5NSe1NavlX0M5DmPULD1nQjcL/eBO7xa1+/giOW9eMZqKNr402SEDwMZ+yZOItN5 wSMz/AV0AJp9kuzQ+hssokKcAyGsXnAep92yStCfMKE9SRb+zOyOef+gGrjo7cbfJZTi X6rw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=Lhg1aEnn; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from sourceware.org (server2.sourceware.org. [2620:52:3:1:0:246e:9693:128c]) by mx.google.com with ESMTPS id y15-20020a056402358f00b00457d514d460si4299283edc.370.2022.11.11.17.52.19 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Nov 2022 17:52:19 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c as permitted sender) client-ip=2620:52:3:1:0:246e:9693:128c; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=Lhg1aEnn; dkim=neutral (no key) header.i=@suse.cz header.s=susede2_ed25519; spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 2620:52:3:1:0:246e:9693:128c 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 2EAA138A90A7 for <ouuuleilei@gmail.com>; Sat, 12 Nov 2022 01:48:37 +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 [195.135.220.29]) by sourceware.org (Postfix) with ESMTPS id F0B02389EC5F for <gcc-patches@gcc.gnu.org>; Sat, 12 Nov 2022 01:47:46 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org F0B02389EC5F Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=suse.cz Authentication-Results: sourceware.org; spf=pass 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 29F7B1F91B; Sat, 12 Nov 2022 01:47:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1668217666; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type; bh=KMC5B7R3Qiis6dE5+HF1JMmwSrAZiXeTu1U7gEG6QNg=; b=Lhg1aEnntStdygEp7W3qb6yS5H2D+tCaadqRjOnZK3Vc5UQ8k+8TOQZlV1ULZtr8bIUxB6 62M/gXyUXL1ZXL+G5sv3kPBRR/Ukl1hnHRNd1YE3nUGBqZecq60vj18+cg34Cuz0XAv4Bd DpjwA7kGJdfvpk8IfhfophzgrTYUk1I= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1668217666; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type; bh=KMC5B7R3Qiis6dE5+HF1JMmwSrAZiXeTu1U7gEG6QNg=; b=qUEWNRh8YH128/dSi8ZHbNpoA99bQChrrq751I64Iwz0mMCnLAoSZ0Btbfb6SJUjG79TIX Mh5kkdoYfgjzMEAg== 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 1D2B213A08; Sat, 12 Nov 2022 01:47:46 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id BOYZB0L7bmPOZAAAMHmgww (envelope-from <mjambor@suse.cz>); Sat, 12 Nov 2022 01:47:46 +0000 From: Martin Jambor <mjambor@suse.cz> To: GCC Patches <gcc-patches@gcc.gnu.org> Cc: Jan Hubicka <jh@suse.cz>, Jan Hubicka <hubicka@ucw.cz> Subject: [PATCH 12/12] ipa: Avoid looking for IPA-SRA replacements where there are none User-Agent: Notmuch/0.37 (https://notmuchmail.org) Emacs/28.1 (x86_64-suse-linux-gnu) Date: Sat, 12 Nov 2022 02:47:45 +0100 Message-ID: <ri6fsepkkou.fsf@suse.cz> MIME-Version: 1.0 Content-Type: text/plain 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 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 <gcc-patches.gcc.gnu.org> List-Unsubscribe: <https://gcc.gnu.org/mailman/options/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=unsubscribe> List-Archive: <https://gcc.gnu.org/pipermail/gcc-patches/> List-Post: <mailto:gcc-patches@gcc.gnu.org> List-Help: <mailto:gcc-patches-request@gcc.gnu.org?subject=help> List-Subscribe: <https://gcc.gnu.org/mailman/listinfo/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=subscribe> Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" <gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org> X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749253294530637062?= X-GMAIL-MSGID: =?utf-8?q?1749253294530637062?= |
Series |
[01/12] ipa: IPA-SRA split detection simplification
|
|
Checks
Context | Check | Description |
---|---|---|
snail/gcc-patch-check | success | Github commit url |
Commit Message
Martin Jambor
Nov. 12, 2022, 1:47 a.m. UTC
Hi, while modifying the code, I realized that we do look into statements even when there are no replacements. This patch adds the necessary early bail-outs to avoid that. ipa_param_body_adjustments::modify_call_stmt cannot have the same at the very beginning because calls can still contain otherwise removed parameters that need to be removed from the statements too. Bootstrapped and tested on x86_64-linux. OK for master? Thanks, Martin gcc/ChangeLog: 2022-11-11 Martin Jambor <mjambor@suse.cz> * ipa-param-manipulation.cc (ipa_param_body_adjustments::modify_expression): Bail out early if there are no replacements. (ipa_param_body_adjustments::modify_assignment): Likewise. gcc/testsuite/ChangeLog: 2022-11-11 Martin Jambor <mjambor@suse.cz> PR ipa/103227 PR ipa/107640 * gcc.dg/ipa/pr107640-2.c: New test. --- gcc/ipa-param-manipulation.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/gcc/ipa-param-manipulation.cc b/gcc/ipa-param-manipulation.cc index e92cfc0b6d5..da19d64cbce 100644 --- a/gcc/ipa-param-manipulation.cc +++ b/gcc/ipa-param-manipulation.cc @@ -1762,6 +1762,8 @@ ipa_param_body_adjustments::modify_expression (tree *expr_p, bool convert) { tree expr = *expr_p; + if (m_replacements.is_empty ()) + return false; if (TREE_CODE (expr) == BIT_FIELD_REF || TREE_CODE (expr) == IMAGPART_EXPR || TREE_CODE (expr) == REALPART_EXPR) @@ -1809,7 +1811,7 @@ ipa_param_body_adjustments::modify_assignment (gimple *stmt, tree *lhs_p, *rhs_p; bool any; - if (!gimple_assign_single_p (stmt)) + if (m_replacements.is_empty () || !gimple_assign_single_p (stmt)) return false; rhs_p = gimple_assign_rhs1_ptr (stmt);