From patchwork Wed Nov 6 13:01:34 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Jires X-Patchwork-Id: 2007534 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=suse.cz header.i=@suse.cz header.a=rsa-sha256 header.s=susede2_rsa header.b=HWGY5nsu; dkim=pass header.d=suse.cz header.i=@suse.cz header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=a66YWDeP; dkim=pass (1024-bit key) header.d=suse.cz header.i=@suse.cz header.a=rsa-sha256 header.s=susede2_rsa header.b=HWGY5nsu; dkim=neutral header.d=suse.cz header.i=@suse.cz header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=a66YWDeP; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=8.43.85.97; helo=server2.sourceware.org; envelope-from=gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=patchwork.ozlabs.org) Received: from server2.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 ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Xk52R6lNQz1xxf for ; Thu, 7 Nov 2024 00:02:06 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 29C0A3858424 for ; Wed, 6 Nov 2024 13:02:03 +0000 (GMT) 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.223.130]) by sourceware.org (Postfix) with ESMTPS id 68E453858C32 for ; Wed, 6 Nov 2024 13:01:40 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 68E453858C32 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=suse.cz Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.cz ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 68E453858C32 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=195.135.223.130 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1730898103; cv=none; b=Jnzz2+A180EUVpLCjD1rrDifZoXbnEj6qfpUNPwAlFkcxS2ui98YjaopeLSRN4oG4CBM81tYsOb49qMCPNwd8lJ/Jh2NzMDgi7M7zax/kdcwUa3/IhXhz5SCri3t3UFNV2SfuUTfo2eU3jUqSWQ4CJr1v2QCQyc2ecgr1wWqr2Q= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1730898103; c=relaxed/simple; bh=i8+BGHnqIsv8i/K9T3aM8OzG79S/Ms156CoIDBgpJhc=; h=DKIM-Signature:DKIM-Signature:DKIM-Signature:DKIM-Signature:Date: From:To:Subject:Message-ID:MIME-Version; b=GcJJjaPhDp2ec7q9WwY1RVHqdz7uY1rbCuYcliQSLpTpYDAIL9B++/9CJtcn61D0ppK+hwTVpELimfeKDKf4ZgwlLxECK7q1UrrpaoI055MCBgB1Jk/3rZRjs3MpksluvA9JDTZV4+M1Ooc3obF0vLWUbb9feA9lQQCjxyMiI/k= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64: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 smtp-out1.suse.de (Postfix) with ESMTPS id 5CBE021B48; Wed, 6 Nov 2024 13:01:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1730898099; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=gV4dNpA7cDnjQ1fA7EpDHCAJ4OZFYR7AU2OUEQHV2oI=; b=HWGY5nsuaypbSitzlhQVACMbvT1iBWZY5gweIhgGjg5hR5cN4IsG4NKKbkPNSIyaMjPVX9 AR22HtSo86qDsQCsWZowWZ4urCPxsmEoKRruVc/MqPSIzvFIbU61rX1hRXhF9PqO2aRV2P edkWAYPc7tHNt4wQm+2DNj63WHOXu34= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1730898099; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=gV4dNpA7cDnjQ1fA7EpDHCAJ4OZFYR7AU2OUEQHV2oI=; b=a66YWDePhg0yof1O7P8le3bWpeL1bQE0Upt08mlgyR8yPjgxAGiTlHsTUUFaBb0iHrEFzi T5+azmWPdfkKWKBg== Authentication-Results: smtp-out1.suse.de; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=HWGY5nsu; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b=a66YWDeP DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1730898099; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=gV4dNpA7cDnjQ1fA7EpDHCAJ4OZFYR7AU2OUEQHV2oI=; b=HWGY5nsuaypbSitzlhQVACMbvT1iBWZY5gweIhgGjg5hR5cN4IsG4NKKbkPNSIyaMjPVX9 AR22HtSo86qDsQCsWZowWZ4urCPxsmEoKRruVc/MqPSIzvFIbU61rX1hRXhF9PqO2aRV2P edkWAYPc7tHNt4wQm+2DNj63WHOXu34= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1730898099; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=gV4dNpA7cDnjQ1fA7EpDHCAJ4OZFYR7AU2OUEQHV2oI=; b=a66YWDePhg0yof1O7P8le3bWpeL1bQE0Upt08mlgyR8yPjgxAGiTlHsTUUFaBb0iHrEFzi T5+azmWPdfkKWKBg== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (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 imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 4385613736; Wed, 6 Nov 2024 13:01:39 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id eLJED7NoK2euGgAAD6G6ig (envelope-from ); Wed, 06 Nov 2024 13:01:39 +0000 Date: Wed, 6 Nov 2024 14:01:34 +0100 From: Michal Jires To: gcc-patches@gcc.gnu.org Cc: hubicka@ucw.cz Subject: [PATCH 1/3] ipa-strub: Replace cgraph_node order with uid. Message-ID: <6dcee2c850f0fbcf836593fe3274527063cef665.1730885483.git.mjires@suse.cz> References: <62832e7f7915de005159c5ae60872e087ef7ae05.1730885483.git.mjires@suse.cz> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <62832e7f7915de005159c5ae60872e087ef7ae05.1730885483.git.mjires@suse.cz> X-Rspamd-Queue-Id: 5CBE021B48 X-Rspamd-Action: no action X-Spamd-Result: default: False [-3.51 / 50.00]; BAYES_HAM(-3.00)[99.99%]; MID_CONTAINS_FROM(1.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; R_DKIM_ALLOW(-0.20)[suse.cz:s=susede2_rsa,suse.cz:s=susede2_ed25519]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain]; MX_GOOD(-0.01)[]; RBL_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:104:10:150:64:97:from]; RECEIVED_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:106:10:150:64:167:received]; RCVD_VIA_SMTP_AUTH(0.00)[]; MISSING_XM_UA(0.00)[]; ARC_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_ALL(0.00)[]; RCPT_COUNT_TWO(0.00)[2]; SPAMHAUS_XBL(0.00)[2a07:de40:b281:104:10:150:64:97:from]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; FUZZY_BLOCKED(0.00)[rspamd.com]; RCVD_COUNT_TWO(0.00)[2]; TO_MATCH_ENVRCPT_ALL(0.00)[]; TO_DN_NONE(0.00)[]; DKIM_SIGNED(0.00)[suse.cz:s=susede2_rsa,suse.cz:s=susede2_ed25519]; DKIM_TRACE(0.00)[suse.cz:+] X-Rspamd-Server: rspamd1.dmz-prg2.suse.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org ipa_strub_set_mode_for_new_functions uses node order as unique ever increasing identifier. This is better satisfied with uid. Order loses uniqueness with following patches. gcc/ChangeLog: * ipa-strub.cc (ipa_strub_set_mode_for_new_functions): Replace order with uid. (pass_ipa_strub_mode::execute): Likewise. --- gcc/ipa-strub.cc | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/gcc/ipa-strub.cc b/gcc/ipa-strub.cc index 8fa7bdf5300..9c0b15c88b1 100644 --- a/gcc/ipa-strub.cc +++ b/gcc/ipa-strub.cc @@ -2254,16 +2254,16 @@ remove_named_attribute_unsharing (const char *name, tree *attrs) } } -/* Record the order of the last cgraph entry whose mode we've already set, so +/* Record the uid of the last cgraph entry whose mode we've already set, so that we can perform mode setting incrementally without duplication. */ -static int last_cgraph_order; +static int last_cgraph_uid; /* Set strub modes for functions introduced since the last call. */ static void ipa_strub_set_mode_for_new_functions () { - if (symtab->order == last_cgraph_order) + if (symtab->cgraph_max_uid == last_cgraph_uid) return; cgraph_node *node; @@ -2278,13 +2278,13 @@ ipa_strub_set_mode_for_new_functions () continue; /* Already done. */ - if (node->order < last_cgraph_order) + if (node->get_uid () < last_cgraph_uid) continue; set_strub_mode (node); } - last_cgraph_order = symtab->order; + last_cgraph_uid = symtab->cgraph_max_uid; } /* Return FALSE if NODE is a strub context, and TRUE otherwise. */ @@ -2660,7 +2660,7 @@ pass_ipa_strub::adjust_at_calls_calls (cgraph_node *node) unsigned int pass_ipa_strub_mode::execute (function *) { - last_cgraph_order = 0; + last_cgraph_uid = 0; ipa_strub_set_mode_for_new_functions (); /* Verify before any inlining or other transformations. */ From patchwork Wed Nov 6 13:02:01 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Jires X-Patchwork-Id: 2007536 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=suse.cz header.i=@suse.cz header.a=rsa-sha256 header.s=susede2_rsa header.b=2z+bDcIK; dkim=pass header.d=suse.cz header.i=@suse.cz header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=L2B75RqT; dkim=pass (1024-bit key) header.d=suse.cz header.i=@suse.cz header.a=rsa-sha256 header.s=susede2_rsa header.b=2z+bDcIK; dkim=neutral header.d=suse.cz header.i=@suse.cz header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=L2B75RqT; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=8.43.85.97; helo=server2.sourceware.org; envelope-from=gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=patchwork.ozlabs.org) Received: from server2.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 ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Xk53Y625mz1xxf for ; Thu, 7 Nov 2024 00:03:05 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 0ED593858C52 for ; Wed, 6 Nov 2024 13:03:04 +0000 (GMT) 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.223.130]) by sourceware.org (Postfix) with ESMTPS id A46C33858420 for ; Wed, 6 Nov 2024 13:02:03 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org A46C33858420 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=suse.cz Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.cz ARC-Filter: OpenARC Filter v1.0.0 sourceware.org A46C33858420 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=195.135.223.130 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1730898134; cv=none; b=vy2p4pHw13A1S48dV23v6hhSW5aH97bl0I8r894QNwJ6LD2BiQdjN/BLA8LDVBaDFg25e3TZ2qEb3w2ND4GUSVMciO+C4Zm5gB0azWbWlrgTk5fJG4qVGMW1cYZZNzR/IXyCshpK1D6Wqnv5lH2iSm/hcUsPE7/cLE2L5HD9fSs= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1730898134; c=relaxed/simple; bh=xVrzyCdUf0Zz6fzl7CTN7zH144B/efdF6G6XzqaicWQ=; h=DKIM-Signature:DKIM-Signature:DKIM-Signature:DKIM-Signature:Date: From:To:Subject:Message-ID:MIME-Version; b=kBEmQe4qi73NLKigR8sCdDt9gHraUvlsxKfQGUDg9t7UZTam82jxhEhmAd8X8KhWoPCF/Q3JoM98ow7G9Ep40DRtmOK9hbnoRSL9koO1tNx9qazqXpjKdkvSDk9ei8UorMFLh56abHiCHLlzTyHkkZphYhnQ0SKAsTrbu1pfv+U= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from imap1.dmz-prg2.suse.org (unknown [10.150.64.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 smtp-out1.suse.de (Postfix) with ESMTPS id 9974321B48; Wed, 6 Nov 2024 13:02:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1730898122; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=PL8mu73U726x9Arx42fU2+Nep/XcxmAJBUMWtDN4p6s=; b=2z+bDcIKfkruVzEgm9d5j46FTTqowQ7uvCZILUX0ZULrL5cB0udDlldwFbyNjLRxK+sDSb rQAlTOIkFYTVTE8s6vIvwZrz7KC9I5t1OPtYhOQsek7Hk2P7QXsn67Nt2zCJC/Jtw7raFJ RLDZUU0LJOtHZmlhmkdGtDfTCbCZVnE= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1730898122; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=PL8mu73U726x9Arx42fU2+Nep/XcxmAJBUMWtDN4p6s=; b=L2B75RqTI1N6IFTv774W4feEDHXUiHb8Hl8y3zPYK6puNjcwrFIqarvH6c8rPeJYKF6Fhl yZ5VXdRo9rSi+3Dg== Authentication-Results: smtp-out1.suse.de; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1730898122; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=PL8mu73U726x9Arx42fU2+Nep/XcxmAJBUMWtDN4p6s=; b=2z+bDcIKfkruVzEgm9d5j46FTTqowQ7uvCZILUX0ZULrL5cB0udDlldwFbyNjLRxK+sDSb rQAlTOIkFYTVTE8s6vIvwZrz7KC9I5t1OPtYhOQsek7Hk2P7QXsn67Nt2zCJC/Jtw7raFJ RLDZUU0LJOtHZmlhmkdGtDfTCbCZVnE= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1730898122; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=PL8mu73U726x9Arx42fU2+Nep/XcxmAJBUMWtDN4p6s=; b=L2B75RqTI1N6IFTv774W4feEDHXUiHb8Hl8y3zPYK6puNjcwrFIqarvH6c8rPeJYKF6Fhl yZ5VXdRo9rSi+3Dg== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (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 imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 7668513736; Wed, 6 Nov 2024 13:02:02 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id Qza9G8poK2fJGgAAD6G6ig (envelope-from ); Wed, 06 Nov 2024 13:02:02 +0000 Date: Wed, 6 Nov 2024 14:02:01 +0100 From: Michal Jires To: gcc-patches@gcc.gnu.org Cc: hubicka@ucw.cz Subject: [PATCH 2/3] Node clones share order. Message-ID: References: <62832e7f7915de005159c5ae60872e087ef7ae05.1730885483.git.mjires@suse.cz> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <62832e7f7915de005159c5ae60872e087ef7ae05.1730885483.git.mjires@suse.cz> X-Spamd-Result: default: False [-3.30 / 50.00]; BAYES_HAM(-3.00)[99.99%]; MID_CONTAINS_FROM(1.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain]; TO_MATCH_ENVRCPT_ALL(0.00)[]; FUZZY_BLOCKED(0.00)[rspamd.com]; RCPT_COUNT_TWO(0.00)[2]; DKIM_SIGNED(0.00)[suse.cz:s=susede2_rsa,suse.cz:s=susede2_ed25519]; RCVD_TLS_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; MISSING_XM_UA(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; ARC_NA(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_NONE(0.00)[]; MIME_TRACE(0.00)[0:+] X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org Symbol order corresponds to the order in source code. For clones their order is currently arbitrarily chosen as max order++ But it would be more consistent with original purpose to choose clones order to be shared with the original node order. This stabilizes clone order for Incremental LTO. Order is thus no longer unique, but this property is not used outside of previous patch, where we can use uid. If total order would be needed, sorting by order and then uid suffices. gcc/ChangeLog: * cgraph.h (symbol_table::register_symbol): Order can be already set. * cgraphclones.cc (cgraph_node::create_clone): Reuse order for clones. --- gcc/cgraph.h | 5 +++-- gcc/cgraphclones.cc | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/gcc/cgraph.h b/gcc/cgraph.h index a8c3224802c..508788b062b 100644 --- a/gcc/cgraph.h +++ b/gcc/cgraph.h @@ -121,7 +121,7 @@ public: used_from_other_partition (false), in_other_partition (false), address_taken (false), in_init_priority_hash (false), need_lto_streaming (false), offloadable (false), ifunc_resolver (false), - order (false), next_sharing_asm_name (NULL), + order (-1), next_sharing_asm_name (NULL), previous_sharing_asm_name (NULL), same_comdat_group (NULL), ref_list (), alias_target (NULL), lto_file_data (NULL), aux (NULL), x_comdat_group (NULL_TREE), x_section (NULL) @@ -2815,7 +2815,8 @@ symbol_table::register_symbol (symtab_node *node) nodes->previous = node; nodes = node; - node->order = order++; + if (node->order == -1) + node->order = order++; } /* Register a top-level asm statement ASM_STR. */ diff --git a/gcc/cgraphclones.cc b/gcc/cgraphclones.cc index 4fff6873a36..fc0f9046d99 100644 --- a/gcc/cgraphclones.cc +++ b/gcc/cgraphclones.cc @@ -401,6 +401,7 @@ cgraph_node::create_clone (tree new_decl, profile_count prof_count, count = count.combine_with_ipa_count (count.ipa () - prof_count.ipa ()); } new_node->decl = new_decl; + new_node->order = order; new_node->register_symbol (); new_node->lto_file_data = lto_file_data; new_node->analyzed = analyzed; From patchwork Wed Nov 6 13:02:09 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Jires X-Patchwork-Id: 2007535 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=suse.cz header.i=@suse.cz header.a=rsa-sha256 header.s=susede2_rsa header.b=gaPmcLwT; dkim=pass header.d=suse.cz header.i=@suse.cz header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=P87JkFyc; dkim=pass (1024-bit key) header.d=suse.cz header.i=@suse.cz header.a=rsa-sha256 header.s=susede2_rsa header.b=gaPmcLwT; dkim=neutral header.d=suse.cz header.i=@suse.cz header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=P87JkFyc; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=server2.sourceware.org; envelope-from=gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=patchwork.ozlabs.org) Received: from server2.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 ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Xk53F6NClz1xxf for ; Thu, 7 Nov 2024 00:02:49 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 1DCEA3858289 for ; Wed, 6 Nov 2024 13:02:48 +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.223.131]) by sourceware.org (Postfix) with ESMTPS id 40E6B3858429 for ; Wed, 6 Nov 2024 13:02:16 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 40E6B3858429 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=suse.cz Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.cz ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 40E6B3858429 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=195.135.223.131 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1730898141; cv=none; b=Zb/tyl45TXwkkTI7a6T9mCGZ3wELZI1PPRFzWY8BNL1kQZO2N1+KrsrpSpEF/I/D6oOaNhmWNNtboy/PuC0R3IxiGD6wYch2uOp7vo7K6EZdcMNkoE1v8cSeonU2RY1vLuUvq0ZZNVe2NKsAcE2l3uDlvwVNbmdJufYJ1ZzyZUE= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1730898141; c=relaxed/simple; bh=/d7JciqN8mYErp7+rko6DoZcBwHLRQF7RFsQWLR98gw=; h=DKIM-Signature:DKIM-Signature:DKIM-Signature:DKIM-Signature:Date: From:To:Subject:Message-ID:MIME-Version; b=Tc54EkFHZPA9fspdf1ZTFNMrJtmWXP+Smmz5hWTXT2j4jSd/8LMmcQ3ISmo8ga/YVvPTjLjN+QsBL/PFkdKt0a2nvLOM5nv42GsqPpYm50OoQ/RNN0uqDuuQyP5QtpSYRfKjcRcj4Pk5J6dCekq87JwCtw+ZCOGIWLsF1TC7iAM= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from imap1.dmz-prg2.suse.org (unknown [10.150.64.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 smtp-out2.suse.de (Postfix) with ESMTPS id 312B61FBBC; Wed, 6 Nov 2024 13:02:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1730898135; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=vok1wK96KnWvJr3Tr1CxGB1SZxmI6CfM1BO3doLgsy0=; b=gaPmcLwTbO+oeIEqqO1dSlN76h+f/Khp5GQxEfXZpa5ksJl67acn9eNDmkDvHaU5UJ2C0I 1IkLoHbwS9dZt+WnRddjGxX24DdJWd2TQBohSDynXoAZwDfsmi8CjemsItOSXJ2QEGVE9s bihvJeGT3Tj7XLQsJMj5pkiqkzIyal8= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1730898135; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=vok1wK96KnWvJr3Tr1CxGB1SZxmI6CfM1BO3doLgsy0=; b=P87JkFycWGrAYOKf9rAgJbmmtWqOUwI3YkcET4IW6/OmPLQtHynsF0lv2IPpOxdpY15whP mzgSV5QSFUJxDWBg== Authentication-Results: smtp-out2.suse.de; none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1730898135; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=vok1wK96KnWvJr3Tr1CxGB1SZxmI6CfM1BO3doLgsy0=; b=gaPmcLwTbO+oeIEqqO1dSlN76h+f/Khp5GQxEfXZpa5ksJl67acn9eNDmkDvHaU5UJ2C0I 1IkLoHbwS9dZt+WnRddjGxX24DdJWd2TQBohSDynXoAZwDfsmi8CjemsItOSXJ2QEGVE9s bihvJeGT3Tj7XLQsJMj5pkiqkzIyal8= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1730898135; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=vok1wK96KnWvJr3Tr1CxGB1SZxmI6CfM1BO3doLgsy0=; b=P87JkFycWGrAYOKf9rAgJbmmtWqOUwI3YkcET4IW6/OmPLQtHynsF0lv2IPpOxdpY15whP mzgSV5QSFUJxDWBg== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (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 imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 1887113736; Wed, 6 Nov 2024 13:02:15 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id MUvKBNdoK2fWGgAAD6G6ig (envelope-from ); Wed, 06 Nov 2024 13:02:15 +0000 Date: Wed, 6 Nov 2024 14:02:09 +0100 From: Michal Jires To: gcc-patches@gcc.gnu.org Cc: hubicka@ucw.cz Subject: [PATCH 3/3] incremental lto: Remap node order for stability. Message-ID: References: <62832e7f7915de005159c5ae60872e087ef7ae05.1730885483.git.mjires@suse.cz> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <62832e7f7915de005159c5ae60872e087ef7ae05.1730885483.git.mjires@suse.cz> X-Spamd-Result: default: False [-3.30 / 50.00]; BAYES_HAM(-3.00)[100.00%]; MID_CONTAINS_FROM(1.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain]; RCPT_COUNT_TWO(0.00)[2]; RCVD_VIA_SMTP_AUTH(0.00)[]; MISSING_XM_UA(0.00)[]; ARC_NA(0.00)[]; RCVD_TLS_ALL(0.00)[]; FUZZY_BLOCKED(0.00)[rspamd.com]; TO_MATCH_ENVRCPT_ALL(0.00)[]; FROM_HAS_DN(0.00)[]; DKIM_SIGNED(0.00)[suse.cz:s=susede2_rsa,suse.cz:s=susede2_ed25519]; FROM_EQ_ENVFROM(0.00)[]; TO_DN_NONE(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; MIME_TRACE(0.00)[0:+] X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org This patch adds remapping of node order for each lto partition. Resulting order conserves relative order inside partition, but is independent of outside symbols. So if lto partition contains identical set of symbols, their remapped order will be stable between compilations. gcc/ChangeLog: * ipa-devirt.cc (ipa_odr_summary_write): Add unused argument. * ipa-fnsummary.cc (ipa_fn_summary_write): Likewise. * ipa-icf.cc (sem_item_optimizer::write_summary): Likewise. * ipa-modref.cc (modref_write): Likewise. * ipa-prop.cc (ipa_prop_write_jump_functions): Likewise. (ipcp_write_transformation_summaries): Likewise. * ipa-sra.cc (ipa_sra_write_summary): Likewise. * lto-cgraph.cc (lto_symtab_encoder_delete): Delete remap. (lto_output_node): Remap order. (lto_output_varpool_node): Likewise. (output_cgraph_opt_summary): Add unused argument. * lto-streamer-out.cc (produce_asm): Use remapped order. (output_function): Propagate remapped order. (output_constructor): Likewise. (copy_function_or_variable): Likewise. (cmp_int): New. (create_order_remap): New. (lto_output): Create remap. Remap order. * lto-streamer.h (struct lto_symtab_encoder_d): Remap hash_map. (produce_asm): Add order argument. --- gcc/ipa-devirt.cc | 2 +- gcc/ipa-fnsummary.cc | 2 +- gcc/ipa-icf.cc | 2 +- gcc/ipa-modref.cc | 4 +- gcc/ipa-prop.cc | 4 +- gcc/ipa-sra.cc | 2 +- gcc/lto-cgraph.cc | 10 +++-- gcc/lto-streamer-out.cc | 84 +++++++++++++++++++++++++++++++++++------ gcc/lto-streamer.h | 5 ++- 9 files changed, 91 insertions(+), 24 deletions(-) diff --git a/gcc/ipa-devirt.cc b/gcc/ipa-devirt.cc index c406e5138db..098798281b7 100644 --- a/gcc/ipa-devirt.cc +++ b/gcc/ipa-devirt.cc @@ -4131,7 +4131,7 @@ ipa_odr_summary_write (void) odr_enum_map = NULL; } - produce_asm (ob, NULL); + produce_asm (ob, NULL, -1); destroy_output_block (ob); } diff --git a/gcc/ipa-fnsummary.cc b/gcc/ipa-fnsummary.cc index b3824783406..badc5e703b2 100644 --- a/gcc/ipa-fnsummary.cc +++ b/gcc/ipa-fnsummary.cc @@ -4911,7 +4911,7 @@ ipa_fn_summary_write (void) } } streamer_write_char_stream (ob->main_stream, 0); - produce_asm (ob, NULL); + produce_asm (ob, NULL, -1); destroy_output_block (ob); ipa_prop_write_jump_functions (); diff --git a/gcc/ipa-icf.cc b/gcc/ipa-icf.cc index b10a6baf109..d9cd7d0c1c0 100644 --- a/gcc/ipa-icf.cc +++ b/gcc/ipa-icf.cc @@ -2216,7 +2216,7 @@ sem_item_optimizer::write_summary (void) } streamer_write_char_stream (ob->main_stream, 0); - produce_asm (ob, NULL); + produce_asm (ob, NULL, -1); destroy_output_block (ob); } diff --git a/gcc/ipa-modref.cc b/gcc/ipa-modref.cc index 19359662f8f..7f36fab3db2 100644 --- a/gcc/ipa-modref.cc +++ b/gcc/ipa-modref.cc @@ -3739,7 +3739,7 @@ modref_write () { streamer_write_uhwi (ob, 0); streamer_write_char_stream (ob->main_stream, 0); - produce_asm (ob, NULL); + produce_asm (ob, NULL, -1); destroy_output_block (ob); return; } @@ -3814,7 +3814,7 @@ modref_write () } } streamer_write_char_stream (ob->main_stream, 0); - produce_asm (ob, NULL); + produce_asm (ob, NULL, -1); destroy_output_block (ob); } diff --git a/gcc/ipa-prop.cc b/gcc/ipa-prop.cc index 78d1fb7086d..032358fde22 100644 --- a/gcc/ipa-prop.cc +++ b/gcc/ipa-prop.cc @@ -5297,7 +5297,7 @@ ipa_prop_write_jump_functions (void) ipa_write_node_info (ob, node); } streamer_write_char_stream (ob->main_stream, 0); - produce_asm (ob, NULL); + produce_asm (ob, NULL, -1); destroy_output_block (ob); } @@ -5489,7 +5489,7 @@ ipcp_write_transformation_summaries (void) write_ipcp_transformation_info (ob, cnode, ts); } streamer_write_char_stream (ob->main_stream, 0); - produce_asm (ob, NULL); + produce_asm (ob, NULL, -1); destroy_output_block (ob); } diff --git a/gcc/ipa-sra.cc b/gcc/ipa-sra.cc index 04920f2aa8e..630f4d6c14f 100644 --- a/gcc/ipa-sra.cc +++ b/gcc/ipa-sra.cc @@ -2898,7 +2898,7 @@ ipa_sra_write_summary (void) isra_write_node_summary (ob, node); } streamer_write_char_stream (ob->main_stream, 0); - produce_asm (ob, NULL); + produce_asm (ob, NULL, -1); destroy_output_block (ob); } diff --git a/gcc/lto-cgraph.cc b/gcc/lto-cgraph.cc index 1d4311a8832..53cc965bdfd 100644 --- a/gcc/lto-cgraph.cc +++ b/gcc/lto-cgraph.cc @@ -96,6 +96,8 @@ lto_symtab_encoder_delete (lto_symtab_encoder_t encoder) encoder->nodes.release (); if (encoder->map) delete encoder->map; + if (encoder->order_remap) + delete encoder->order_remap; free (encoder); } @@ -406,7 +408,8 @@ lto_output_node (struct lto_simple_output_block *ob, struct cgraph_node *node, streamer_write_enum (ob->main_stream, LTO_symtab_tags, LTO_symtab_last_tag, tag); - streamer_write_hwi_stream (ob->main_stream, node->order); + int output_order = *encoder->order_remap->get (node->order); + streamer_write_hwi_stream (ob->main_stream, output_order); /* In WPA mode, we only output part of the call-graph. Also, we fake cgraph node attributes. There are two cases that we care. @@ -603,7 +606,8 @@ lto_output_varpool_node (struct lto_simple_output_block *ob, varpool_node *node, streamer_write_enum (ob->main_stream, LTO_symtab_tags, LTO_symtab_last_tag, LTO_symtab_variable); - streamer_write_hwi_stream (ob->main_stream, node->order); + int output_order = *encoder->order_remap->get (node->order); + streamer_write_hwi_stream (ob->main_stream, output_order); lto_output_var_decl_ref (ob->decl_state, ob->main_stream, node->decl); bp = bitpack_create (ob->main_stream); bp_pack_value (&bp, node->externally_visible, 1); @@ -2097,7 +2101,7 @@ output_cgraph_opt_summary (void) output_node_opt_summary (ob, cnode, encoder); } } - produce_asm (ob, NULL); + produce_asm (ob, NULL, -1); destroy_output_block (ob); } diff --git a/gcc/lto-streamer-out.cc b/gcc/lto-streamer-out.cc index a464c2d5ddf..2b6b11ecf8b 100644 --- a/gcc/lto-streamer-out.cc +++ b/gcc/lto-streamer-out.cc @@ -2207,7 +2207,7 @@ output_cfg (struct output_block *ob, struct function *fn) a function, set FN to the decl for that function. */ void -produce_asm (struct output_block *ob, tree fn) +produce_asm (struct output_block *ob, tree fn, int output_order) { enum lto_section_type section_type = ob->section_type; struct lto_function_header header; @@ -2217,8 +2217,7 @@ produce_asm (struct output_block *ob, tree fn) { const char *name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (fn)); section_name = lto_get_section_name (section_type, name, - symtab_node::get (fn)->order, - NULL); + output_order, NULL); } else section_name = lto_get_section_name (section_type, NULL, 0, NULL); @@ -2402,7 +2401,7 @@ streamer_write_chain (struct output_block *ob, tree t, bool ref_p) /* Output the body of function NODE->DECL. */ static void -output_function (struct cgraph_node *node) +output_function (struct cgraph_node *node, int output_order) { tree function; struct function *fn; @@ -2479,7 +2478,7 @@ output_function (struct cgraph_node *node) streamer_write_uhwi (ob, 0); /* Create a section to hold the pickled output of this function. */ - produce_asm (ob, function); + produce_asm (ob, function, output_order); destroy_output_block (ob); if (streamer_dump_file) @@ -2490,7 +2489,7 @@ output_function (struct cgraph_node *node) /* Output the body of function NODE->DECL. */ static void -output_constructor (struct varpool_node *node) +output_constructor (struct varpool_node *node, int output_order) { tree var = node->decl; struct output_block *ob; @@ -2512,7 +2511,7 @@ output_constructor (struct varpool_node *node) stream_write_tree (ob, DECL_INITIAL (var), true); /* Create a section to hold the pickled output of this function. */ - produce_asm (ob, var); + produce_asm (ob, var, output_order); destroy_output_block (ob); if (streamer_dump_file) @@ -2573,7 +2572,7 @@ lto_output_toplevel_asms (void) /* Copy the function body or variable constructor of NODE without deserializing. */ static void -copy_function_or_variable (struct symtab_node *node) +copy_function_or_variable (struct symtab_node *node, int output_order) { tree function = node->decl; struct lto_file_decl_data *file_data = node->lto_file_data; @@ -2581,7 +2580,7 @@ copy_function_or_variable (struct symtab_node *node) size_t len; const char *name = IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (function)); char *section_name = - lto_get_section_name (LTO_section_function_body, name, node->order, NULL); + lto_get_section_name (LTO_section_function_body, name, output_order, NULL); size_t i, j; struct lto_in_decl_state *in_state; struct lto_out_decl_state *out_state = lto_get_out_decl_state (); @@ -2726,6 +2725,63 @@ cmp_symbol_files (const void *pn1, const void *pn2, void *id_map_) return n1->order - n2->order; } +/* Compare ints, callback for qsort. */ + +static int +cmp_int (const void *a, const void *b) +{ + int ia = *(int const*) a; + int ib = *(int const*) b; + return ia - ib; +} + +/* Create order mapping independent on symbols outside of the partition. + Results in stable order values for incremental LTO. + + Remapping is not done in place, because symbols can be used + by multiple partitions. */ + +static void +create_order_remap (lto_symtab_encoder_t encoder) +{ + auto_vec orders; + unsigned i; + struct asm_node* anode; + encoder->order_remap = new hash_map, int>; + unsigned n_nodes = lto_symtab_encoder_size (encoder); + + for (i = 0; i < n_nodes; i++) + orders.safe_push (lto_symtab_encoder_deref (encoder, i)->order); + + if (!asm_nodes_output) + { + for (anode = symtab->first_asm_symbol (); anode; anode = anode->next) + orders.safe_push (anode->order); + } + + orders.qsort (cmp_int); + int ord = 0; + int last_order = -1; + for (i = 0; i < orders.length (); i++) + { + int order = orders[i]; + if (order != last_order) + { + last_order = order; + encoder->order_remap->put (order, ord); + ord++; + } + } + + /* Asm nodes are currently always output only into first partition. + We can remap already here. */ + if (!asm_nodes_output) + { + for (anode = symtab->first_asm_symbol (); anode; anode = anode->next) + anode->order = *encoder->order_remap->get (anode->order); + } +} + /* Main entry point from the pass manager. */ void @@ -2738,6 +2794,8 @@ lto_output (void) lto_symtab_encoder_t encoder = lto_get_out_decl_state ()->symtab_node_encoder; auto_vec symbols_to_copy; + create_order_remap (encoder); + prune_offload_funcs (); if (flag_checking) @@ -2800,6 +2858,8 @@ lto_output (void) cgraph_node *cnode; varpool_node *vnode; + int output_order = *encoder->order_remap->get (snode->order); + if (flag_checking) gcc_assert (bitmap_set_bit (output, DECL_UID (snode->decl))); @@ -2814,14 +2874,14 @@ lto_output (void) at WPA time. */ || DECL_ARGUMENTS (cnode->decl) || cnode->declare_variant_alt)) - output_function (cnode); + output_function (cnode, output_order); else if ((vnode = dyn_cast (snode)) && (DECL_INITIAL (vnode->decl) != error_mark_node || (!flag_wpa && flag_incremental_link != INCREMENTAL_LINK_LTO))) - output_constructor (vnode); + output_constructor (vnode, output_order); else - copy_function_or_variable (snode); + copy_function_or_variable (snode, output_order); gcc_assert (lto_get_out_decl_state () == decl_state); lto_pop_out_decl_state (); lto_record_function_out_decl_state (snode->decl, decl_state); diff --git a/gcc/lto-streamer.h b/gcc/lto-streamer.h index 4da1a3efe03..397f5fc8d68 100644 --- a/gcc/lto-streamer.h +++ b/gcc/lto-streamer.h @@ -461,6 +461,9 @@ struct lto_symtab_encoder_d { vec nodes; hash_map *map; + + /* Mapping of input order of nodes onto output order. */ + hash_map, int> *order_remap; }; typedef struct lto_symtab_encoder_d *lto_symtab_encoder_t; @@ -887,7 +890,7 @@ extern void lto_output_fn_decl_ref (struct lto_out_decl_state *, extern tree lto_input_var_decl_ref (lto_input_block *, lto_file_decl_data *); extern tree lto_input_fn_decl_ref (lto_input_block *, lto_file_decl_data *); extern void lto_output_toplevel_asms (void); -extern void produce_asm (struct output_block *ob, tree fn); +extern void produce_asm (struct output_block *ob, tree fn, int output_order); extern void lto_output (); extern void produce_asm_for_decls (); void lto_output_decl_state_streams (struct output_block *,