From patchwork Sat Oct 26 22:44:41 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jan Hubicka X-Patchwork-Id: 1184905 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-511839-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=ucw.cz Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="NA8BaJtx"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 470wzR6TkBz9sPL for ; Sun, 27 Oct 2019 09:45:06 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:subject:message-id:mime-version:content-type; q=dns; s= default; b=p0kDL8DSthp2gR1uEv5tvp7U8Ltw/kEbFzfgZGSsaY5YlfNC7MrSA UQKCKxlE8DUKMUgD3JIuWpiXQbzTJlaEEJrtRnboa15xlg4ykXOj+whKm6Uof2uZ YlS0R4yvrgaFSDW2i3K3YilvH3LCbjLFaA2ykwhgBkOjQsV0efEu8g= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:subject:message-id:mime-version:content-type; s= default; bh=qhnfCXdN07+2JkY95dDu1W2Kiok=; b=NA8BaJtxf6EaMqP5aMqr hRKZwWEkbN8QHVQfkrrfsJK6IRkpWHVdZfUNuqP6eQGi8vuCOVNG1I9nBxY6GTNB fmqKO/c4uWuR61MQWjTBV8Pu8+YKcxAjwRjeDx0/1zYZp41DESbkm5A2H7F+mqDB yxW6nG8+TfVF7UnbcvHQPJw= Received: (qmail 45188 invoked by alias); 26 Oct 2019 22:44:57 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 45141 invoked by uid 89); 26 Oct 2019 22:44:48 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-9.8 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_2, GIT_PATCH_3, KAM_ASCII_DIVIDERS autolearn=ham version=3.3.1 spammy= X-HELO: nikam.ms.mff.cuni.cz Received: from nikam.ms.mff.cuni.cz (HELO nikam.ms.mff.cuni.cz) (195.113.20.16) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sat, 26 Oct 2019 22:44:43 +0000 Received: by nikam.ms.mff.cuni.cz (Postfix, from userid 16202) id 68E50280821; Sun, 27 Oct 2019 00:44:41 +0200 (CEST) Date: Sun, 27 Oct 2019 00:44:41 +0200 From: Jan Hubicka To: gcc-patches@gcc.gnu.org Subject: Fix summaries after ipa-icf alias/wrapper creation Message-ID: <20191026224441.5s426abjlcfb3rhq@kam.mff.cuni.cz> MIME-Version: 1.0 Content-Disposition: inline User-Agent: NeoMutt/20170113 (1.7.2) Hi, when ipa-icf produces wrapper/alias it needs to also update summaries to represent the new function body. W/o this propagation across new wrappers does not work. Bootstrapped/regtested x86_64-linux, will commit it shortly. * ipa-icf.c (sem_function::merge): Update function summaries. * ipa-prop.h (ipa_get_param): Do not sanity check for WPA. Index: ipa-icf.c =================================================================== --- ipa-icf.c (revision 277474) +++ ipa-icf.c (working copy) @@ -1266,6 +1266,7 @@ sem_function::merge (sem_item *alias_ite /* Remove the function's body. */ ipa_merge_profiles (original, alias); + symtab->call_cgraph_removal_hooks (alias); alias->release_body (true); alias->reset (); /* Notice global symbol possibly produced RTL. */ @@ -1287,11 +1288,13 @@ sem_function::merge (sem_item *alias_ite { gcc_assert (!create_alias); alias->icf_merged = true; + symtab->call_cgraph_removal_hooks (alias); local_original->icf_merged = true; /* FIXME update local_original counts. */ ipa_merge_profiles (original, alias, true); alias->create_wrapper (local_original); + symtab->call_cgraph_insertion_hooks (alias); if (dump_enabled_p ()) dump_printf (MSG_OPTIMIZED_LOCATIONS, Index: ipa-prop.h =================================================================== --- ipa-prop.h (revision 277474) +++ ipa-prop.h (working copy) @@ -457,7 +457,6 @@ static inline tree ipa_get_param (class ipa_node_params *info, int i) { gcc_checking_assert (info->descriptors); - gcc_checking_assert (!flag_wpa); tree t = (*info->descriptors)[i].decl_or_type; gcc_checking_assert (TREE_CODE (t) == PARM_DECL); return t;