From patchwork Fri Nov 26 13:01:20 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Hubicka X-Patchwork-Id: 1560140 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=M3hry2a4; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=8.43.85.97; helo=sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4J0vzS2J34z9t54 for ; Sat, 27 Nov 2021 00:02:27 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 74E123858020 for ; Fri, 26 Nov 2021 13:02:24 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 74E123858020 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1637931744; bh=8PAm8fClMcn2mqrhKwhb+TPhBuKmro4jZm/SoE+69WY=; h=Date:To:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=M3hry2a4l4eX55X1vdIZnNNkUPkAGAM1OmzV6xYTUrxvQqNAIIYBb2/6KXM8zs4Qg jX8bi2Q8AC6gDFYpNm9USTEsKqgVIuGsGZ9wWEFhvIt+aK9WNEEJ61PJ9qshZH3SCj lVae+4ffyChjcilS2kJj05GDm34ThskHLNnGayCY= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from nikam.ms.mff.cuni.cz (nikam.ms.mff.cuni.cz [195.113.20.16]) by sourceware.org (Postfix) with ESMTPS id 92DBB3857C60 for ; Fri, 26 Nov 2021 13:01:21 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 92DBB3857C60 Received: by nikam.ms.mff.cuni.cz (Postfix, from userid 16202) id A36D4280F28; Fri, 26 Nov 2021 14:01:20 +0100 (CET) Date: Fri, 26 Nov 2021 14:01:20 +0100 To: gcc-patches@gcc.gnu.org Subject: Minod modref tweeks Message-ID: <20211126130120.GJ71018@kam.mff.cuni.cz> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.10.1 (2018-07-13) X-Spam-Status: No, score=-11.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, GIT_PATCH_0, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) 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: Jan Hubicka via Gcc-patches From: Jan Hubicka Reply-To: Jan Hubicka Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org Sender: "Gcc-patches" Hi, while working on analyzing the previous miscomple I made dumps easier to read by dumping cgraph_node name rather then cfun name in function being analysed and I also fixed minor issue with ECF flags merging when updating inline summary. gcc/ChangeLog: 2021-11-26 Jan Hubicka * ipa-modref.c (analyze_function): Drop parameter F and dump cgraph node name rather than cfun name. (modref_generate): Update. (modref_summaries::insert):Update. (modref_summaries_lto::insert):Update. (pass_modref::execute):Update. (ipa_merge_modref_summary_after_inlining): Improve combining of ECF_FLAGS. diff --git a/gcc/ipa-modref.c b/gcc/ipa-modref.c index 2f52d41aa48..9e537b04196 100644 --- a/gcc/ipa-modref.c +++ b/gcc/ipa-modref.c @@ -2943,17 +2943,17 @@ analyze_parms (modref_summary *summary, modref_summary_lto *summary_lto, } } -/* Analyze function F. IPA indicates whether we're running in local mode +/* Analyze function. IPA indicates whether we're running in local mode (false) or the IPA mode (true). Return true if fixup cfg is needed after the pass. */ static bool -analyze_function (function *f, bool ipa) +analyze_function (bool ipa) { bool fixup_cfg = false; if (dump_file) - fprintf (dump_file, "modref analyzing '%s' (ipa=%i)%s%s\n", - function_name (f), ipa, + fprintf (dump_file, "\n\nmodref analyzing '%s' (ipa=%i)%s%s\n", + cgraph_node::get (current_function_decl)->dump_name (), ipa, TREE_READONLY (current_function_decl) ? " (const)" : "", DECL_PURE_P (current_function_decl) ? " (pure)" : ""); @@ -3224,7 +3224,7 @@ modref_generate (void) if (!f) continue; push_cfun (f); - analyze_function (f, true); + analyze_function (true); pop_cfun (); } } @@ -3257,7 +3257,7 @@ modref_summaries::insert (struct cgraph_node *node, modref_summary *) return; } push_cfun (DECL_STRUCT_FUNCTION (node->decl)); - analyze_function (DECL_STRUCT_FUNCTION (node->decl), true); + analyze_function (true); pop_cfun (); } @@ -3277,7 +3277,7 @@ modref_summaries_lto::insert (struct cgraph_node *node, modref_summary_lto *) return; } push_cfun (DECL_STRUCT_FUNCTION (node->decl)); - analyze_function (DECL_STRUCT_FUNCTION (node->decl), true); + analyze_function (true); pop_cfun (); } @@ -4032,9 +4032,9 @@ public: } -unsigned int pass_modref::execute (function *f) +unsigned int pass_modref::execute (function *) { - if (analyze_function (f, false)) + if (analyze_function (false)) return execute_fixup_cfg (); return 0; } @@ -5106,8 +5106,10 @@ ipa_merge_modref_summary_after_inlining (cgraph_edge *edge) = summaries_lto ? summaries_lto->get (edge->callee) : NULL; int flags = flags_from_decl_or_type (edge->callee->decl); /* Combine in outer flags. */ - for (cgraph_node *n = edge->caller; n->inlined_to; n = n->callers->caller) - flags |= flags_from_decl_or_type (edge->callee->decl); + cgraph_node *n; + for (n = edge->caller; n->inlined_to; n = n->callers->caller) + flags |= flags_from_decl_or_type (n->decl); + flags |= flags_from_decl_or_type (n->decl); bool ignore_stores = ignore_stores_p (edge->caller->decl, flags); if (!callee_info && to_info)