From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-oa1-x2a.google.com (mail-oa1-x2a.google.com [IPv6:2001:4860:4864:20::2a]) by sourceware.org (Postfix) with ESMTPS id 806773858D37 for ; Wed, 28 Dec 2022 07:22:41 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 806773858D37 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-oa1-x2a.google.com with SMTP id 586e51a60fabf-1442977d77dso17814627fac.6 for ; Tue, 27 Dec 2022 23:22:41 -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=qJz/6YDAd7xqS5e+SCHCIN2rVdgJaLVHyPad9kP26y8=; b=BTI5jUrRarjML0JkpX+5neqCg8lwFTzk8inV8Y9XiXczycqb9T/vDE/ibA7McNwa0X LYdMmwS4aYuZsADgYJn1CTDgfcyn16TZY6uN3t5Wulzcp7pm7aHBjH9kVHDe+kR/8nJl FzpyMM65+4Jayu7I10Ry2ORmjcrZj/f721ZXbeO+oK1Q+wyFJ3rryIsuZOsRkv/VBx3C 8QrkRTdMmHg5yQqnloo2FevweZHqs/Gar5P6+oWaocIZCq2gI3h1Enmt2x0Hsg8l6AOH 3sbbKSy6yRkuOKB4f0vqO2CUrFEdxid73/epSgR8tOrKMD1ocnxxT6Gh4dcQguZTY8d7 nayg== 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=qJz/6YDAd7xqS5e+SCHCIN2rVdgJaLVHyPad9kP26y8=; b=ks16r3okAu7F+STza41y3sMxzfQDsiBjW5oOKBpr325nX6tfuTTUJU7zg5o9wRgNdb h0OqFcPEM7YoyU5a6K11MwAGkhYLossTejQTQetlL/95x5GDx+qsbjFE1azHplpaoKUx RsrmAn4D8c4v/BCxLNLzp/ubonkCo8nKWlEtCipdiKBr5JfUUnTLLQSrtBZxs9Fs/0xS N/HA7dm7lFObMcVi66g5DZvKKav8DbxOL+sfr0aNbOh6f2YSwm9PmQb+OeI82zhnk76B R8612jU8gDbTZpyNluftKNTvYY5yoG9IvrrFceaKBOBJdy2/E8ZNALZ1A+hCNhh2WVI5 Cb8g== X-Gm-Message-State: AFqh2kqPujcV9nMnbEZeOqlb3pElw++5YaIVFgr6iCR5z56bjkII6VdN 9aDrpsCaM1D1fEhRQUERJyS3/fAepoIhNA8R8NqfjZaW X-Google-Smtp-Source: AMrXdXtyE9vVz2QpMQQ/wTYl1SDqL63Xi3h6owK7u8acwqnnhdsF5fjOGT9FphLOR7b3VQBcmfdFA1enUsB+DvjILV4= X-Received: by 2002:a05:6870:578f:b0:14f:ac78:ac7f with SMTP id i15-20020a056870578f00b0014fac78ac7fmr836120oap.112.1672212159132; Tue, 27 Dec 2022 23:22:39 -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: NightStrike Date: Wed, 28 Dec 2022 02:22:28 -0500 Message-ID: Subject: Re: Document how to build PGO-optimized GCC version To: Alexander Zaitsev Cc: "gcc@gcc.gnu.org" Content-Type: multipart/alternative; boundary="000000000000bbf86305f0de3b15" X-Spam-Status: No, score=0.0 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,HTML_MESSAGE,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: --000000000000bbf86305f0de3b15 Content-Type: text/plain; charset="UTF-8" On Wed, Dec 28, 2022, 00:37 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 > * (if GCC community provides prebuilt gcc binaries) use PGO for the > prebuilt binaries. E.g. Clang and rustc already uses this approach. > > Any feedback is appreciated. > > Thanks in advance! > > -- > Best regards, > Alexander Zaitsev > I would wager that you would get more bang for your buck out of 1) building a more recent gcc yourself instead of using whatever comes packaged, and 2) building with march=native for each processor type you run on. Not that PGO won't help, of course it will since you are building the same software repeatedly, but my personal experience doing the exact same thing is that I saw a 50% performance improvement from just from that, and it's rather trivial to do if your infrastructure is homogeneous (mine was a many node compute cluster). The next biggest bottleneck for me was IO, because the project this was for when compiling was very file intensive. Anyway, just some alternative suggestions, since there's already a response giving you what you asked for. Feel free to ignore me :) > --000000000000bbf86305f0de3b15--