This is looking really good. So based on reading this, a rough sketch of how we can expand this to PGO would be something like:
- there is a separate PGO page that has similar structure, but is more tuned for the PGO use case.
- there is a separate page (maybe in the LLVM docs and not clang since other frontends might be using libprofile?) which describes "advanced usage of the profile runtime". That would cover the file and buffer API, __llvm_profile_runtime, runtime counter resetting and merging, etc.
Adding Maggie and Phillip, which are working on coverage at PlayStation.
|33 ↗||(On Diff #58732)|
Would it be possible to make these consistent with the later section headers?
|61 ↗||(On Diff #58732)|
Since these are clang's docs, we should just say clang (or clang++)
|91 ↗||(On Diff #58732)|
As a user, this would make me ask "why can't llvm-profdata do the indexing if I pass it a raw profile"?
I think the answer is largely that in a real program there are multiple profraws, so you need to merge them first. You probably want to mention that.
|140 ↗||(On Diff #58732)|
Can you show example output? That is one of the most useful things in a how-to document like this. (for example, a person reading this might be a prospective user of the feature, and seeing the output is valuable to them to see if it provides what they want)
|149 ↗||(On Diff #58732)|
Small wording nit: Instead of saying "It is possible for an instrumented program to..." I would say something like "Advanced use of the profile runtime library allows an instrumented program to..." or something like that.