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

Chandler Carruth via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 21 15:59:32 PDT 2017


chandlerc added inline comments.


================
Comment at: include/llvm/Passes/PassBuilder.h:47
   Optional<PGOOptions> PGOOpt;
+  bool DebugInfoForProfiling;
 
----------------
(If we end up using this flag, see below) Maybe call this "AddDebugInfoDiscriminators"? or otherwise make it more clear what changes it introduces?


================
Comment at: lib/Passes/PassBuilder.cpp:333-334
 
+  if (DebugInfoForProfiling)
+    FPM.addPass(AddDiscriminatorsPass());
+
----------------
Does this need to be at this *exact* position? Could it be done before all passes and directly added to the pipeline by the frontend?

Alternatively, could you use one of the extension points we have in the new PM for this?

If not, I would suggest that we need an `opt` flag that sets this and test it that way.

Yet another alternative: what about keying this off of the existing PGO options rather than a separate flag? (Side note: do we have a way to set up the PGO options using the `opt` tool?)


https://reviews.llvm.org/D35744





More information about the llvm-commits mailing list