Add new options for context-sensitive PGO.
Refer to https://reviews.llvm.org/D54175
Paths
| Differential D54176
[PGO] clang part of change for context-sensitive PGO. ClosedPublic Authored by xur on Nov 6 2018, 12:20 PM.
Details
Summary Add new options for context-sensitive PGO. Refer to https://reviews.llvm.org/D54175
Diff Detail Event TimelineComment Actions Can you add a summary of this change, i.e., the driver option processing flow for csPGO. Test cases are also missing. Comment Actions Here is the summary of CSPGO options workflow: (1) CSPGO instrumentation. We also add a new instrument kind (csllvm) for cc1 option fprofile-instrument. This is corresponding to a new CodeGen option: CodeGenOptions::ProfileCSIRInstr. The driver option is parsed and translated to cc1 option in addPGOAndCoverageFlags(). cc1 option is converted to CodeGenOpts in setPGOInstrumentor() (CompilerInvocation.cpp). CodeGenOpts is passed into llvm pass manager in BackendUtil.cpp: (2) PGO use CodeGenOpts is handled similarly as in CSPGO instrumentation. (3) lto/thinlto
The change to lib/CodeGen/CodeGenModule.cpp is for llvm profile summary change.
xur added inline comments.
xur marked an inline comment as done. Comment ActionsIntegrated David's review comments. Also add a test to test the error when both CSInstrumentGen and CSInstrumentUse on.
Herald added subscribers: dexonsmith, steven_wu, mehdi_amini. · View Herald TranscriptDec 12 2018, 4:33 PM Comment Actions Clang reviews should mainly go to cfe-commits, not llvm-commits. (all that will happen automagically if one sets the correct repo for the differential..) Comment Actions LGTM except for place noted below where I disagree with a change made earlier. Will let @davidxl chime in if he disagrees with me or has any other comments.
Comment Actions Integrated Teresa's suggestion to change the err() to assert.
This revision is now accepted and ready to land.Mar 4 2019, 11:06 AM Closed by commit rC355331: [PGO] Clang part of change for context-sensitive PGO (part1) (authored by xur). · Explain WhyMar 4 2019, 12:21 PM This revision was automatically updated to reflect the committed changes.
Revision Contents
Diff 186023 include/clang/Basic/CodeGenOptions.h
include/clang/Driver/Options.td
lib/CodeGen/BackendUtil.cpp
lib/CodeGen/CodeGenModule.cpp
lib/Driver/ToolChain.cpp
lib/Driver/ToolChains/Clang.cpp
lib/Driver/ToolChains/CommonArgs.cpp
lib/Frontend/CompilerInvocation.cpp
test/CodeGen/cspgo-instrumentation.c
test/CodeGen/cspgo-instrumentation_lto.c
test/CodeGen/cspgo-instrumentation_thinlto.c
|
what is going to happen if user uses a merged data with CS profile in profile-use and also specifies CS prof-gen?