From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf1-x434.google.com (mail-pf1-x434.google.com [IPv6:2607:f8b0:4864:20::434]) by sourceware.org (Postfix) with ESMTPS id EB1B33858D37 for ; Wed, 28 Dec 2022 05:48:59 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org EB1B33858D37 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pf1-x434.google.com with SMTP id x26so3863853pfq.10 for ; Tue, 27 Dec 2022 21:48:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=Y3d+Fs9fOaixttlZxehS3bg+5m1691FOR/K/7ni5pjA=; b=lXEfkapT9z+uEQhuXZpip5/PLx6y4DFklkxZOfI60LWMfmj28wmnSJYON+545AtXGd YOZpiw0394+fYpYkURQOLliik7wzbtp8ccKmqP1DSfj9dGkDHmFn5rCm3SvxsCTWNSHu bjIA+TtlGAdwYAzRATiYdBvux2Std6WBrAtvKbJvojCwDIGiRTunVWssFutuH4Q4l7sb 7+/hWS//qPgi9lu+EKtc92nePSj9jc1Rz+qKh4uQ+IWjfadObX/Hre1rpDEhPGvTc6ZK wdh5fQ2kIVMmqm/1Z3kDqdFl+WJlcSY0OdMJwafcr27BjS+AKk2E6odxuWlb/Qn/W+bD xkXQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=Y3d+Fs9fOaixttlZxehS3bg+5m1691FOR/K/7ni5pjA=; b=IRdFGuTJLKJeolcKyTyq6yZUWqCleaTMO/M4i1AAHGLQ7GCYwcmKqykz0fSzHIpNkd xa2H6INgywTSgg8RyRv5gjdOVahMyQBxhqhCSBxYZlcMmjShptTvW0zFgyOSNn3McUhi mC9UReN9+ZP5PNCCDHzq5FmOiS31znmgPWyAp3ng2yKgWbRg8G3hywCqxRGNOYZdFUl9 Tt40GqHa5YcPlRVBEW4k84DODFQ0ozgbJMUa7JRRClV+hItTPnDffNjxbiTm4MTgxUAT KNi/NPGpQaX/zEHy4FDgrRobZV9VFHddCwnkK/DnmOFPo/vl9OSfge+giGdwtA9LEXex K5CQ== X-Gm-Message-State: AFqh2kqQwi/lBCsGcA/f76zIgzY+g9cX3NDYiwFG/x3piVHs1K+TglOr OUP/YC1o4r7vuD573PK3rsh07OO9HABAucE5b84= X-Google-Smtp-Source: AMrXdXv5LZi9dR0eWWd67a7Nd6yPm2St+CvDX6JPsm5eipis4yURtmkU/KiNc6rxJYAG/uaQsnItHso+aq4OTHEQti4= X-Received: by 2002:a63:db11:0:b0:478:d4ce:5d3f with SMTP id e17-20020a63db11000000b00478d4ce5d3fmr1472705pgg.277.1672206538875; Tue, 27 Dec 2022 21:48:58 -0800 (PST) MIME-Version: 1.0 References: <387a052a-60f2-3d03-38d4-dcff21aaaa03@tut.by> In-Reply-To: <387a052a-60f2-3d03-38d4-dcff21aaaa03@tut.by> From: Andrew Pinski Date: Tue, 27 Dec 2022 21:48:47 -0800 Message-ID: Subject: Re: Document how to build PGO-optimized GCC version To: Alexander Zaitsev Cc: gcc@gcc.gnu.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,KAM_SHORT,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On Tue, Dec 27, 2022 at 9:38 PM Alexander Zaitsev wrote: > > Hello. > > We are using GCC for our C++ projects. Our projects are huge, commit > rate is quite huge, so our CI workers are always busy (so as any other > CI workers, honestly). Since we want to increase build speed, one of the > option is to optimize the compiler itself. Sounds like a good case for PGO. > > Clang has the infrastructure for building the Clang itself with PGO: > https://llvm.org/docs/HowToBuildWithPGO.html . I have tried to find > something like that for GCC but with no success. > > My proposal is: > > * add support for building PGO-optimized GCC into the GCC build > infrastructure > * add documentation to the GCC site, how to build GCC with PGO > optimizations It is already there, see the last section of https://gcc.gnu.org/install/build.html (Building with profile feedback). It has been included in GCC and documented since June 2003. https://gcc.gnu.org/r0-50361-g8f231b5d874dcb . > * (if GCC community provides prebuilt gcc binaries) use PGO for the > prebuilt binaries. E.g. Clang and rustc already uses this approach. GCC community does not provide prebuilt gcc binaries for a few different reasons. But distros do provide more recent prebuilt binaries, you could ask them to build using PGO (some do already I think). Thanks, Andrew Pinski > > Any feedback is appreciated. > > Thanks in advance! > > -- > Best regards, > Alexander Zaitsev