[PATCH] D86502: [CSSPGO] Pseudo probe instrumentation for basic blocks

Hongtao Yu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 24 18:23:15 PDT 2020


hoy created this revision.
Herald added subscribers: llvm-commits, cfe-commits, wenlei, dang, dexonsmith, hiraditya.
Herald added projects: clang, LLVM.
hoy requested review of this revision.

This change introduces a new clang switch `-fpseudo-probe-for-profiling` to enable AutoFDO with pseudo instrumentation. Please refer to https://reviews.llvm.org/D86193 for the whole story.

One implication from pseudo-probe instrumentation is that the profile is now sensitive to CFG changes. We perform the pseudo instrumentation very early in the pre-LTO pipeline, before any CFG transformation. This ensures that the CFG instrumented and annotated is stable and optimization-resilient.

The early instrumentation also allows the inliner to duplicate probes for inlined instances. When a probe along with the other instructions of a callee function are inlined into its caller function, the GUID of the callee function goes with the probe. This allows samples collected on inlined probes to be reported for the original callee function.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D86502

Files:
  clang/include/clang/Basic/CodeGenOptions.def
  clang/include/clang/Driver/Options.td
  clang/lib/CodeGen/BackendUtil.cpp
  clang/lib/Driver/ToolChains/Clang.cpp
  clang/lib/Frontend/CompilerInvocation.cpp
  clang/test/CodeGen/emit-pseudo-probe.c
  llvm/include/llvm/Passes/PassBuilder.h
  llvm/lib/Passes/PassBuilder.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D86502.287542.patch
Type: text/x-patch
Size: 8655 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200825/4a56dd5b/attachment.bin>


More information about the llvm-commits mailing list