aeubanks marked an inline comment as done.
aeubanks added inline comments.

================
Comment at: llvm/lib/Passes/PassBuilder.cpp:1659
+                                             bool DebugLogging) {
+  for (auto &C : PipelineStartEPCallbacks)
+    C(MPM);
----------------
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.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D89158/new/

https://reviews.llvm.org/D89158

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to