[PATCH] D54819: [SampleFDO] Skip profile reading when flatten profile is used in ThinLTO postlink phase

Wei Mi via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 15 14:52:05 PST 2019


wmi marked 3 inline comments as done.
wmi added inline comments.


================
Comment at: lib/Transforms/IPO/PassManagerBuilder.cpp:438
+    // no need to load the profile again in PostLink.
+    if (!FlattenedProfileUsed || PrepareForThinLTO)
+      MPM.add(createSampleProfileLoaderPass(PGOSampleUse));
----------------
tejohnson wrote:
> By guarding this with PrepareForThinLTO, I think that means that with a flattened profile and a non-thinlto build we would not get the sample PGO loaded. Should PrepareForThinLTO instead be !PerformThinLTO (which is equivalent to your new PM check)?
Good catch. Thanks.  A new option to control PerformThinLTO is added for testing purpose. 


================
Comment at: tools/opt/opt.cpp:391
 
+  switch (PGOKindFlag) {
+  case InstrGen:
----------------
tejohnson wrote:
> How have we been testing the PGO pipelines in the old PM without this change?
There are some opt options defined in PassManagerBuilder.cpp for PGO pipeline testing. I feel like it is better to use the mechanism in opt driver similar as what new pass manager does. I will send out a clean up patch first. 


Repository:
  rL LLVM

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

https://reviews.llvm.org/D54819





More information about the llvm-commits mailing list