[cfe-dev] How much profile data is enough for pgo?

Reid Kleckner via cfe-dev cfe-dev at lists.llvm.org
Mon Oct 11 12:29:12 PDT 2021


Hans's solution to this problem when we deployed PGO for Chrome was to pick
a representative C++ file from the codebase, pre-process it, and use that
as an input during PGO training. This fails to cover input reading and use
cases like LTO, but it at least ensures that all the Sema, optimizer, and
codegen codepaths are representatively exercised.

On Fri, Oct 8, 2021 at 11:49 AM Chris Bieneman via cfe-dev <
cfe-dev at lists.llvm.org> wrote:

> This also came up during the LLVM Distributor's conference talk on PGO (
> https://github.com/ClangBuiltLinux/llvm-distributors-conf-2021/issues/4).
>
> Honestly I'm not actually convinced there's that much difference between
> carefully selected and curated collections of PGO data, and building a few
> "Hello World" type simple programs.
>
> When I was working on Clang at Apple much of our instrumentation showed
> that process launch time was the most consistent place that we could
> optimize performance to get significant wins that were pretty universal.
>
> When I added the in-tree multi-stage PGO that used LIT to run instrumented
> compiles, I found that just the one C++ hello-world program had something
> crazy like a 6% performance improvement. I'd love to see us add a few more
> source files into that system so that we could tune it a bit, but I never
> had the time.
>
> -Chris
>
> On Oct 8, 2021, at 1:39 PM, Shoaib Meenai <smeenai at fb.com> wrote:
>
> (now actually CCing him correctly)
>
> On 10/8/21, 11:08 AM, "cfe-dev on behalf of Shoaib Meenai via cfe-dev" <
> cfe-dev-bounces at lists.llvm.org on behalf of cfe-dev at lists.llvm.org> wrote:
>
>    CCing Chris; I remember discussing something like this with him at a
> developer meeting, but I don't remember his recommendation from the time :)
>
>    On 10/7/21, 1:10 PM, "cfe-dev on behalf of Tom Stellard via cfe-dev" <
> cfe-dev-bounces at lists.llvm.org on behalf of cfe-dev at lists.llvm.org> wrote:
>
>        Hi,
>
>        I'm trying to generate profile data for clang by building the some
> of the packages
>        we ship in Fedora Linux.  I'm trying to decide how many packages to
> build, is
>        there much advantage to building 1000 vs something substantially
> less, like 100?
>
>        -Tom
>
>        _______________________________________________
>        cfe-dev mailing list
>        cfe-dev at lists.llvm.org
>        https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
>
>    _______________________________________________
>    cfe-dev mailing list
>    cfe-dev at lists.llvm.org
>    https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
>
>
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20211011/04050d35/attachment.html>


More information about the cfe-dev mailing list