From patchwork Fri Nov 17 20:16:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Jires X-Patchwork-Id: 16718 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9910:0:b0:403:3b70:6f57 with SMTP id i16csp788845vqn; Fri, 17 Nov 2023 12:16:56 -0800 (PST) X-Google-Smtp-Source: AGHT+IEtrTkaS7eM3jJTusLvH03dL8WC15IvwyctwA7WUUBNDkRB9QXUvz5wfvoNfj1cEsxv7kXM X-Received: by 2002:a05:6214:1c8e:b0:66d:59a3:f9e with SMTP id ib14-20020a0562141c8e00b0066d59a30f9emr126896qvb.63.1700252216221; Fri, 17 Nov 2023 12:16:56 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1700252216; cv=pass; d=google.com; s=arc-20160816; b=nZrCldmzvoYAtQRSKXlrnMeG+Ee4wmj8TpoxlQ1W5jP8RRPLHKoeueYBUcBGGODLfA cTsMw7QqpjfNyQXE6cTBOwXXGWaPd9Kr8cb4HMZoBT3ZAtvt17jit1uELsCHxyVo48RF VcOp1sC6wHowCRfi3bV3f6727llcv990l+6AGHdh83dXlmBtAXYOU4Vr9+LZJFqPzMEQ wHGXxAcsuNfdJx+P4WVhiXRDkaP3UqH2xwYokE4xN/FfaS/eyreAMBbn40Uv3TNlgZU1 2KKkxqhTdmznEW83YMLnJXlUiprY88u6ZZIUqcZ79MujuXjcSjEamNhlGL5SoXBwYGpd 2cPg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-disposition :mime-version:message-id:subject:cc:to:from:date:dkim-signature :dkim-signature:arc-filter:dmarc-filter:delivered-to; bh=KESXDjKCqzE9CmZSU41eLSi4pGDVqxzPxS1cDO9W7Ns=; fh=BYjcaNCYGJOL4+GLz83yzrka98SZX7mVbmKdSR/R2Vk=; b=r/56YQMwvgclGZRN7SdU3uc99g0CcsIAEyR0EVwCdCrp/zIMnkPSQR2ylPYgk60F37 W66nL8zhlByhL4F7rhhlX+I7CpwfvJMcB3uBvHggX01DEymfA5eqCWU9DifMDszF/Fi0 vYZhrTTaBcr94i4J4Jx7Ypja6VsChr81+yV3AymwHJmwQT4uAC/UaCHDyd69D6S40FQg 2zpRv94v2h/brhVn4dJGMhHZY/eA5Z4R54HYH6u8bXsuVkadHcPe1i68hhCI3g0kijlE ljXCRDAOnILd9d7CL7YEFkWG8RRhLoGf6E5yIC1TRGuDA5xg9rFsb07cVUY3tR491o1Y FTIA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=mGTTpLkd; dkim=neutral (no key) header.i=@suse.cz; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org" Received: from server2.sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id p16-20020a0cf690000000b0066cffff776dsi2383760qvn.172.2023.11.17.12.16.56 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Nov 2023 12:16:56 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b=mGTTpLkd; dkim=neutral (no key) header.i=@suse.cz; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 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 E116C385828F for ; Fri, 17 Nov 2023 20:16:53 +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 [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-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 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+ouuuleilei=gmail.com@gcc.gnu.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1782843667539656195 X-GMAIL-MSGID: 1782843667539656195 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.