[all-commits] [llvm/llvm-project] ba4da5: [ctx_prof] "Use" support for pre-thinlink. (#101338)

Mircea Trofin via All-commits all-commits at lists.llvm.org
Fri Aug 2 17:51:48 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: ba4da5a087f28c9522bc7f173e99673bb3009af9
      https://github.com/llvm/llvm-project/commit/ba4da5a087f28c9522bc7f173e99673bb3009af9
  Author: Mircea Trofin <mtrofin at google.com>
  Date:   2024-08-02 (Fri, 02 Aug 2024)

  Changed paths:
    M llvm/lib/Passes/PassBuilderPipelines.cpp
    A llvm/test/Transforms/PGOProfile/ctx-prof-use-prelink.ll

  Log Message:
  -----------
  [ctx_prof] "Use" support for pre-thinlink. (#101338)

There is currently no plan to support contextual profiling use in a non-
ThinLTO scenario.

In the pre-link phase, we only instrument and then immediately bail out
to let the linker group functions under an entrypoint in the same module
as the entrypoint. We don't actually care what the profile contains -
just that we want to use a contextual profile.

After that, in post-thinlink, we require the profile be passed again so
we can actually use it. The earlier instrumentation will be used to
match counter values.

While the feature is in development, we add a hidden flag for the use
scenario, but we can eventually tie it to the `PGOOptions` mechanism. We
will use the same flag in both pre- and post-thinlink, because it
simplifies things - usually the post-thinlink args are the same as the
ones for pre-. This, despite the flag being basically treated as a
boolean in pre-thinlink.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list