[PATCH] D89158: [NewPM] Run all EP callbacks under -O0
Alina Sbirlea via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Tue Oct 27 17:37:06 PDT 2020
asbirlea added inline comments.
================
Comment at: llvm/lib/Passes/PassBuilder.cpp:1659
+ bool DebugLogging) {
+ for (auto &C : PipelineStartEPCallbacks)
+ C(MPM);
----------------
aeubanks wrote:
> ychen wrote:
> > What I have in mind is a newly added `O0EPCallbacks` field in PassBuilder class. Then we can keep existing EPCallbacks (including PipelineStartEPCallbacks) for >O0 optimization pipeline. Yeah, then you need to add related passes to O0EPCallbacks (for BPF in this case).
> It's a tradeoff between having to specify required passes in both O0EPCallbacks and PipelineStartEPCallbacks which is repetitive, versus making all callbacks in PipelineStartEPCallbacks run at -O0, meaning even optional passes in PipelineStartEPCallbacks will run at -O0 (may be skipped via optnone).
>
> The legacy PM chooses the first, and I'm inclined to keep it that way just for consistency.
>
> If we did go down the second route, we could just have a second TargetMachine API like TargetMachine::addO0Passes() which directly adds passes to a ModulePassManager.
This seems more in line with the LPM behavior for O0.
If BPF needs those passes even for O0 they should be added as such.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D89158/new/
https://reviews.llvm.org/D89158
More information about the cfe-commits
mailing list