This is an archive of the discontinued LLVM Phabricator instance.

[Docs] use -fprofile-generate for IR PGO and -fprofile-instr-generate for code coverage
Needs ReviewPublic

Authored by zequanwu on Jun 24 2021, 12:35 PM.

Details

Summary

Add docs to specify -fprofile-generate for IR PGO and -fprofile-instr-generate for code coverage.

Diff Detail

Event Timeline

zequanwu created this revision.Jun 24 2021, 12:35 PM
zequanwu requested review of this revision.Jun 24 2021, 12:35 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 24 2021, 12:35 PM
Herald added a subscriber: cfe-commits. · View Herald Transcript
davidxl added inline comments.Jun 25 2021, 9:50 AM
clang/docs/UsersManual.rst
1878–1879

This is not correct. As of today, -fprofile-use can be used with both -fprofile-generate and -fprofile-instr-generate. It does this by looking at the flag in the profile data.

The better way to document:

For profile guided optimizations, we recommend using IRPGO, aka using-fprofile-generate with -fprofile-use

zequanwu updated this revision to Diff 354615.Jun 25 2021, 3:18 PM
zequanwu marked an inline comment as done.

Update wording.

rnk added inline comments.Jun 29 2021, 3:09 PM
clang/docs/UsersManual.rst
2117–2118

I like the original paragraph here. The casual reader doesn't need to know about the two flavors of instrumentation, that detail can be added at the end of this section.

2188

This should be fprofile-use, correct?

2199–2200

This is the right place to mention the fprofile-instr-generate / use flags.

It's worth retaining the note that, although Clang and GCC use the same command line flags to enable PGO, the profile data format is not compatible.

2213

This probably needs edits too, it's not the alternative.

zequanwu updated this revision to Diff 355718.Jun 30 2021, 4:16 PM
zequanwu marked 4 inline comments as done.

Address comments.