[PATCH] D35744: Make new PM honor -fdebug-info-for-profiling
Dehao Chen via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Jul 21 16:24:39 PDT 2017
danielcdh added inline comments.
================
Comment at: lib/Passes/PassBuilder.cpp:333-334
+ if (DebugInfoForProfiling)
+ FPM.addPass(AddDiscriminatorsPass());
+
----------------
chandlerc wrote:
> 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?)
This does not need to be at the exact position. It should be done before all passes. I'm not sure how to directly add this to the pipeline by FE, looks like all the passes added by FE are all module passes. As AddDiscriminatorsPass is a function pass, I'm not sure how to add it to the MPM. Could you suggest how to do that in new PM?
Could you point me to an example of how to use extension points in the new PM?
We could add this to PGOOpt if you think that is a good option. I don't think that we could pass in the PGOOpt to the opt tool.
Thanks,
Dehao
https://reviews.llvm.org/D35744
More information about the llvm-commits
mailing list