[PATCH] D89158: [NewPM] Run callbacks added via registerPipelineStartEPCallback under -O0

Arthur Eubanks via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Thu Oct 29 14:58:37 PDT 2020


aeubanks added a comment.

Looking at BackendUtil.cpp in Clang as well as the Rust code, I'm back to thinking that we should provide a way to to all callbacks. Then in the case of passes added via TargetMachine, we should extend `TargetMachine::registerPassBuilderCallbacks` to also take a `PassBuilder::OptimizationLevel`. Then targets can skip adding optional optimization passes at -O0. Does that make sense? It would allow us to clean up Clang and Rust.

In fact I see in `AMDGPUTargetMachine::adjustPassManager` a check for an optimization level, so some targets are already doing this, although it looks like it's more for codegen and not IR passes.


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