[PATCH] D89158: [NewPM] Run all EP callbacks under -O0

2020-10-28 Thread Nikita Popov via Phabricator via cfe-commits
nikic added a comment. If you are not invoking all the needed callbacks in invokeRegisteredO0EPCallbacks(), I would suggest to instead provide a set of methods like invokePipelineStartEPCallbacks(), invokeOptimizerLastEPCallbacks() that allow the consumer to chose which callbacks to invoke. (Ju

[PATCH] D89158: [NewPM] Run all EP callbacks under -O0

2020-10-27 Thread Yuanfang Chen via Phabricator via cfe-commits
ychen added inline comments. Comment at: llvm/lib/Passes/PassBuilder.cpp:1659 + bool DebugLogging) { + for (auto &C : PipelineStartEPCallbacks) +C(MPM); aeubanks wrote: > ychen wrote: > > asbirlea wrote: > > > aeub

[PATCH] D89158: [NewPM] Run all EP callbacks under -O0

2020-10-27 Thread Arthur Eubanks via Phabricator via cfe-commits
aeubanks added inline comments. Comment at: llvm/lib/Passes/PassBuilder.cpp:1659 + bool DebugLogging) { + for (auto &C : PipelineStartEPCallbacks) +C(MPM); ychen wrote: > asbirlea wrote: > > aeubanks wrote: > > > y

[PATCH] D89158: [NewPM] Run all EP callbacks under -O0

2020-10-27 Thread Yuanfang Chen via Phabricator via cfe-commits
ychen added inline comments. Comment at: llvm/lib/Passes/PassBuilder.cpp:1659 + bool DebugLogging) { + for (auto &C : PipelineStartEPCallbacks) +C(MPM); asbirlea wrote: > aeubanks wrote: > > ychen wrote: > > > What

[PATCH] D89158: [NewPM] Run all EP callbacks under -O0

2020-10-27 Thread Alina Sbirlea via Phabricator via cfe-commits
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

[PATCH] D89158: [NewPM] Run all EP callbacks under -O0

2020-10-27 Thread Arthur Eubanks via Phabricator via cfe-commits
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: >

[PATCH] D89158: [NewPM] Run all EP callbacks under -O0

2020-10-27 Thread Arthur Eubanks via Phabricator via cfe-commits
aeubanks updated this revision to Diff 301145. aeubanks added a comment. run -> invoke Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D89158/new/ https://reviews.llvm.org/D89158 Files: clang/lib/CodeGen/BackendUtil.cpp clang/test/CodeGen/bpf-O0.

[PATCH] D89158: [NewPM] Run all EP callbacks under -O0

2020-10-27 Thread Yuanfang Chen via Phabricator via cfe-commits
ychen added inline comments. Comment at: llvm/include/llvm/Passes/PassBuilder.h:626 + /// typically run at the very beginning. + void runRegisteredO0EPCallbacks(ModulePassManager &MPM, bool DebugLogging); + invokeO0EPCallbacks? I saw there is `PassBuilder::invo

[PATCH] D89158: [NewPM] Run all EP callbacks under -O0

2020-10-27 Thread Arthur Eubanks via Phabricator via cfe-commits
aeubanks added a comment. In D89158#2357850 , @ychen wrote: > IIUC, this is the NPM version of EP_EarlyAsPossible in legacy PM for O0, > right? Between the choice of (1) [this patch and ] reusing all existing EP > callbacks and letting optnone filtering

[PATCH] D89158: [NewPM] Run all EP callbacks under -O0

2020-10-27 Thread Arthur Eubanks via Phabricator via cfe-commits
aeubanks updated this revision to Diff 301132. aeubanks added a comment. only run passes in PipelineStartEPCallbacks Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D89158/new/ https://reviews.llvm.org/D89158 Files: clang/lib/CodeGen/BackendUtil.cp

[PATCH] D89158: [NewPM] Run all EP callbacks under -O0

2020-10-27 Thread Yuanfang Chen via Phabricator via cfe-commits
ychen added a comment. IIUC, this is the NPM version of EP_EarlyAsPossible in legacy PM for O0, right? Between the choice of (1) [this patch and ] reusing all existing EP callbacks and letting optnone filtering out non-required passes (which I think does not work for `-disable-O0-optnone`) and

[PATCH] D89158: [NewPM] Run all EP callbacks under -O0

2020-10-26 Thread Arthur Eubanks via Phabricator via cfe-commits
aeubanks added inline comments. Comment at: clang/lib/CodeGen/BackendUtil.cpp:1439 if (CodeGenOpts.OptimizationLevel == 0) { + PB.runRegisteredEPCallbacks(MPM, Level, CodeGenOpts.DebugPassManager); + nikic wrote: > It should be possible to simplify this

[PATCH] D89158: [NewPM] Run all EP callbacks under -O0

2020-10-26 Thread Nikita Popov via Phabricator via cfe-commits
nikic added inline comments. Comment at: clang/lib/CodeGen/BackendUtil.cpp:1439 if (CodeGenOpts.OptimizationLevel == 0) { + PB.runRegisteredEPCallbacks(MPM, Level, CodeGenOpts.DebugPassManager); + It should be possible to simplify this function a lot no

[PATCH] D89158: [NewPM] Run all EP callbacks under -O0

2020-10-25 Thread Arthur Eubanks via Phabricator via cfe-commits
aeubanks updated this revision to Diff 300575. aeubanks added a comment. rebase add assert for O0 Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D89158/new/ https://reviews.llvm.org/D89158 Files: clang/lib/CodeGen/BackendUtil.cpp clang/test/Code

[PATCH] D89158: [NewPM] Run all EP callbacks under -O0

2020-10-09 Thread Arthur Eubanks via Phabricator via cfe-commits
aeubanks created this revision. Herald added subscribers: llvm-commits, cfe-commits, hiraditya. Herald added projects: clang, LLVM. aeubanks requested review of this revision. Some targets may add required passes via TargetMachine::registerPassBuilderCallbacks(). We need to run those even under -O