[PATCH] D54175: [PGO] context sensitive PGO

Rong Xu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Dec 17 09:36:17 PST 2018


xur updated this revision to Diff 178479.
xur added a comment.

This new pass addresses the review comments from Teresa. Main changes are:
(1) used two enums in PGOOptions:

  enum PGOAction { NoAction, IRInstr, IRUse, SampleUse };
  enum CSPGOAction { NoCSAction, CSIRInstr, CSIRUse };

The first enum is for regular PGO. We will use one ProfileFile string to represent the profile (instrument path or profile path). 
CSPGOAction can be set when PGOAction == NaAction, or PGOAction==IRUse.
for CSIRUse, the profile is the same as ProfileFile. For CSIRInstr, we need another string CSProfileGenFile to represent instrumentation file name.

NewPMDDriver already use a similar method for regular PGO.

(2) Changed the clang options handling to give error message when -fsample-profile-use is used with -fprofile-use or -fprofile-generate.

(3) added support in tools/opt/NewPMDriver.cpp. This will be used in tests.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D54175/new/

https://reviews.llvm.org/D54175

Files:
  include/llvm/Analysis/ProfileSummaryInfo.h
  include/llvm/IR/Module.h
  include/llvm/IR/ProfileSummary.h
  include/llvm/LTO/Config.h
  include/llvm/Passes/PassBuilder.h
  include/llvm/ProfileData/InstrProf.h
  include/llvm/ProfileData/InstrProfData.inc
  include/llvm/ProfileData/InstrProfReader.h
  include/llvm/ProfileData/InstrProfWriter.h
  include/llvm/Transforms/IPO/PassManagerBuilder.h
  include/llvm/Transforms/Instrumentation.h
  include/llvm/Transforms/Instrumentation/PGOInstrumentation.h
  lib/Analysis/ProfileSummaryInfo.cpp
  lib/IR/Module.cpp
  lib/IR/ProfileSummary.cpp
  lib/LTO/LTOBackend.cpp
  lib/Passes/PassBuilder.cpp
  lib/ProfileData/InstrProfReader.cpp
  lib/ProfileData/InstrProfWriter.cpp
  lib/Transforms/IPO/PassManagerBuilder.cpp
  lib/Transforms/IPO/SampleProfile.cpp
  lib/Transforms/Instrumentation/InstrProfiling.cpp
  lib/Transforms/Instrumentation/PGOInstrumentation.cpp
  tools/gold/gold-plugin.cpp
  tools/llvm-profdata/llvm-profdata.cpp
  tools/opt/NewPMDriver.cpp
  unittests/ProfileData/InstrProfTest.cpp
  unittests/ProfileData/SampleProfTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D54175.178479.patch
Type: text/x-patch
Size: 69511 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20181217/3db860dd/attachment.bin>


More information about the llvm-commits mailing list