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 instrumented-vs-sampling-profile for the trade-off.

Role on this wiki

Seen in

  • systems/llvm-bolt — the post-link sibling.
  • systems/meta-bolt-binary-optimizer — Meta's BOLT perspective.
  • systems/linux-perf — the sampling-profile source.
  • systems/redpanda — Tier-3 adopter.
  • profile-guided-optimization — the optimisation clang's PGO flags implement.
  • feedback-directed-optimization — the umbrella.
  • instrumented-vs-sampling-profile — the two profile-collection shapes clang supports.
  • hot-cold-code-splitting / concepts/cache-locality — the transformations clang PGO applies.
  • pgo-for-frontend-bound-application — the canonical apply pattern.
Last updated · 766 distilled / 2,225 read