[PATCH] D130952: [Inliner] Handle multiple `run` invocation of `ModuleInlinerWrapperPass` (NFC).

Mircea Trofin via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Aug 2 12:35:01 PDT 2022


mtrofin added a comment.

In D130952#3693697 <https://reviews.llvm.org/D130952#3693697>, @michele.scandale wrote:

> In D130952#3692584 <https://reviews.llvm.org/D130952#3692584>, @mtrofin wrote:
>
>> asking to learn - what's the motivation for running ::run more than once / why not have different instances of ModuleInlinerWrapperPass?
>
> The use case I'm looking into is a system processing several modules with a custom optimization pipeline where I'd like to pay the setup cost of building the pass manager only once rather than for each module being processed.
> This is something that used to work (modulo bugs once in a while) with the legacy pass manager. I'm trying this with the new pass manager infrastructure, and found few issues while experimenting (the issue addressed here, D130954 <https://reviews.llvm.org/D130954> and D130955 <https://reviews.llvm.org/D130955>).

Wondering, is this something that's intentionally supported though?

Setting that question aside, maybe it'd make more sense we moved the finalization stuff in a `ModuleInlinerWrapperPass::finish()` or something like that, and then we just `assert(Finalized)` in `::run`; that would address a current oddity with the wrapper, in that the pass composition is somewhat deferred until the run.

wdyt?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D130952



More information about the llvm-commits mailing list