[PATCH] D35744: Make new PM honor -fdebug-info-for-profiling

Dehao Chen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 25 15:40:01 PDT 2017


danielcdh updated this revision to Diff 108171.
danielcdh added a comment.

update the option to put it within PGOOPtions. Will add test once https://reviews.llvm.org/D35807 is committed.


https://reviews.llvm.org/D35744

Files:
  include/llvm/Passes/PassBuilder.h
  lib/Passes/PassBuilder.cpp


Index: lib/Passes/PassBuilder.cpp
===================================================================
--- lib/Passes/PassBuilder.cpp
+++ lib/Passes/PassBuilder.cpp
@@ -330,6 +330,10 @@
   assert(Level != O0 && "Must request optimizations!");
   FunctionPassManager FPM(DebugLogging);
 
+  // If SamplePGO is enabled, add the AddDiscriminator pass.
+  if (PGOOpt && (PGOpt.SampleProfileGen || PGOOpt.SampleProfileFile))
+    FPM.addPass(AddDiscriminatorsPass());
+
   // Form SSA out of local memory accesses after breaking apart aggregates into
   // scalars.
   FPM.addPass(SROA());
Index: include/llvm/Passes/PassBuilder.h
===================================================================
--- include/llvm/Passes/PassBuilder.h
+++ include/llvm/Passes/PassBuilder.h
@@ -32,6 +32,7 @@
   std::string ProfileGenFile = "";
   std::string ProfileUseFile = "";
   std::string SampleProfileFile = "";
+  bool SampleProfileGen = false;
   bool RunProfileGen = false;
 };
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D35744.108171.patch
Type: text/x-patch
Size: 969 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170725/ea0c02be/attachment.bin>


More information about the llvm-commits mailing list