From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-out2.suse.de (smtp-out2.suse.de [IPv6:2001:67c:2178:6::1d]) by sourceware.org (Postfix) with ESMTPS id E92633858D35 for ; Fri, 17 Nov 2023 20:16:28 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org E92633858D35 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=suse.cz Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=suse.cz ARC-Filter: OpenARC Filter v1.0.0 sourceware.org E92633858D35 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2001:67c:2178:6::1d ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1700252191; cv=none; b=GMTzoqQnzAZGH2yMZLdaLWBVB+i1Hlbu1n/VsmqlFSiroq+NaQ5JpCeucNuELz8puHwOBOBc5zqcoVhZEhj0sflLjpEjAe+6U5ih1QvfGXmzR1V7izHnEar4/TtSCu4jsJkSrn7+/NE56OKyX8iB3p9IURL46ybPvhqQ9nb93Xo= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1700252191; c=relaxed/simple; bh=KESXDjKCqzE9CmZSU41eLSi4pGDVqxzPxS1cDO9W7Ns=; h=DKIM-Signature:DKIM-Signature:Date:From:To:Subject:Message-ID: MIME-Version; b=pRj6+e3sgXS+zmJ/3pyMRDD5bS2hvnw2ia++y4qBGfa3gFHOgR6+r4H5fUirLKzXgDsOefcH/SbZQjxTZ9er/WGhcM1mxArUpeajYklG6Dn4uvndV/mEbue+EhN3BQ6nq2BcEv5VeMrIebKJusLu+RnzvkJLhjnol6sqxHdeBj4= ARC-Authentication-Results: i=1; server2.sourceware.org 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 E37001F388; Fri, 17 Nov 2023 20:16:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1700252187; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type; bh=KESXDjKCqzE9CmZSU41eLSi4pGDVqxzPxS1cDO9W7Ns=; b=mGTTpLkdZ+Tb7gBLKnqJ203AQvcVXwnxCnY0J4PWemDY7kXUn+OGyZI5500BYmZ7L/gnSB 3Z87CWO4AtXGal2lBOwnwSCqGlJW4v3cfBTnRb4dqUN57LHdX6fI0qs7/yw9Zd6G1FVp12 TsocBiJGo0gCiFHt1d8Tvm/ZArGWV+0= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1700252187; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type; bh=KESXDjKCqzE9CmZSU41eLSi4pGDVqxzPxS1cDO9W7Ns=; b=os3mlMgFqh6Fys/MVccyJzDKFfG/DUnm6uj99aq6J/lIbhQ8cWoTRXdoOBcOfyTzwvVpLC 1PkJ1udLUwIX00Dg== 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 C73B51341F; Fri, 17 Nov 2023 20:16:27 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id O+T0LhvKV2XaGQAAMHmgww (envelope-from ); Fri, 17 Nov 2023 20:16:27 +0000 Date: Fri, 17 Nov 2023 21:16:26 +0100 From: Michal Jires To: gcc-patches@gcc.gnu.org Cc: hubicka@ucw.cz Subject: [PATCH 0/7] lto: Incremental LTO. Message-ID: <18cc1c3980551ac1881eea6e78811a629c7baa82.1700222403.git.mjires@suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Authentication-Results: smtp-out2.suse.de; none X-Spam-Level: X-Spam-Score: -0.32 X-Spamd-Result: default: False [-0.32 / 50.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; DKIM_SIGNED(0.00)[suse.cz:s=susede2_rsa,suse.cz:s=susede2_ed25519]; NEURAL_HAM_SHORT(-0.20)[-0.999]; RCPT_COUNT_TWO(0.00)[2]; MID_CONTAINS_FROM(1.00)[]; FUZZY_BLOCKED(0.00)[rspamd.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_COUNT_TWO(0.00)[2]; RCVD_TLS_ALL(0.00)[]; BAYES_HAM(-0.02)[52.70%] X-Spam-Status: No, score=-4.6 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_SOFTFAIL,TXREP,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Hi, these patches implement Incremental LTO, specifically by caching results of ltrans phase. Secondarily these patches contain changes to reduce divergence of ltrans partitions so that they can be cached. The aim is to reduce compile times for quick edit-compile cycles while using LTO. Even with these minimal changes to the rest of GCC it works surprisingly well. Currently testing by self compiling cc1, with individual commits used as incremental changes, on average only ~1/3 of partitions need to be recompiled with `-O2 -g0` and ~1/2 with `-O2 -g`. Which directly reduces time spent in ltrans phase of LTO. Unfortunately larger gains are a bit fragile. You may remember that during my Cauldron talk I claimed reduction to ~1/6 and ~1/3 recompilations. That was achieved with branch from March. Since then there were at least two commits which introduced new divergence of partitions, though they seem fixable in future.