Skip to content

SYSTEM Cited by 2 sources

Clang

Clang is the LLVM-project C / C++ / Objective-C compiler frontend. Canonical project documentation at clang.llvm.org.

This wiki page is a stub covering clang's relevance to FDO tooling. For the LLVM post-link optimiser, see systems/llvm-bolt; for general C++ build-system patterns, see concepts/monorepo and the various code-analysis systems (systems/include-what-you-use, etc.).

PGO flags

Clang implements profile-guided optimization via a two-phase build:

  • -fprofile-generate[=<dir>] — phase 1. Instruments the binary. Profile data written on program exit.
  • -fprofile-use=<path> / -fprofile-instr-use=<path> — phase 2. Consumes the profile for code-layout, inlining, and branch-hint decisions.
  • -fprofile-sample-use=<path> — AutoFDO / CSSPGO variant. Consumes a sampling profile (from Linux perf or Strobelight) instead of the instrumented .profdata.

See concepts/instrumented-vs-sampling-profile for the trade-off.

Role on this wiki

Seen in

Last updated · 470 distilled / 1,213 read