[PATCH] D88138: [NPM] Add target specific hook to add passes for New Pass Manager

Ankit via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 25 12:23:35 PDT 2020


quic_aankit added a comment.

In D88138#2295699 <https://reviews.llvm.org/D88138#2295699>, @aeubanks wrote:

> In D88138#2295673 <https://reviews.llvm.org/D88138#2295673>, @kparzysz wrote:
>
>> In D88138#2294257 <https://reviews.llvm.org/D88138#2294257>, @aeubanks wrote:
>>
>>> I think I'm still missing how exactly this will fit into the pipeline. As in where is `registerPassBuilderCallbacks()` going to be called?
>>
>> Perhaps `EmitAssemblyHelper::EmitAssemblyWithNewPassManager` in BackendUtil.cpp.  `PassBuilder` actually has `TM` as a member, so maybe from somewhere inside of `PassBuilder` itself, but I'm not sure whether that's the right thing to do.
>
> Anywhere `adjustPassManager()` is called should have a corresponding call to `registerPassBuilderCallbacks()` in the NPM path. So yes `EmitAssemblyHelper::EmitAssemblyWithNewPassManager()` in `BackendUtil.cpp`, but also since `opt.cpp` calls `adjustPassManager()`, the corresponding NPM path in `NewPMDriver.cpp` should also call `registerPassBuilderCallbacks()`. Both places have access to a `TM`.
>
> This should be done either before or in this patch, or else we can't test it and make sure it works.

Sorry I think I misunderstood the usage of adjustPassManager earlier. I'll add the calls in both opt and clang and add the test case as well. Thanks!


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

https://reviews.llvm.org/D88138



More information about the llvm-commits mailing list