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

Teresa Johnson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 11 11:14:22 PST 2019


tejohnson added a comment.

I just stumbled on this patch - sorry for the late review! I thought this was already in. A few comments and a question below. Also, presumably this should be done for the old PM as well?



================
Comment at: lib/Passes/PassBuilder.cpp:612
+        PGOOpt->SampleProfileFile, PGOOpt->ProfileRemappingFile,
+        Phase == ThinLTOPhase::PreLink, Phase == ThinLTOPhase::PostLink));
     // Do not invoke ICP in the ThinLTOPrelink phase as it makes it hard
----------------
Rather than passing this down and skipping the initialization in the pass, can we just skip adding the pass completely?


================
Comment at: lib/Transforms/IPO/SampleProfile.cpp:126
 
+static cl::opt<bool> FlattenProfileUsed(
+    "flatten-profile-used", cl::init(false), cl::Hidden,
----------------
s/flatten/flattened/ here and in name/description below (and in rest of patch)


================
Comment at: lib/Transforms/IPO/SampleProfile.cpp:310
   bool IsThinLTOPreLink;
+  /// Flag indicating if the pass is invoked in ThinLTO backend compile phase.
+  bool IsThinLTOPostLink;
----------------
Nit, add empty line above


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