[PATCH] D50923: [New PM][PassInstrumentation] IR printing support for New Pass Manager

Fedor Sergeev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 14 14:50:57 PDT 2018


fedor.sergeev added a comment.

In https://reviews.llvm.org/D50923#1235550, @philip.pfaffe wrote:

> This implementation is modeled unnecessarily close to the legacy behavior. `opt` should just manually add the printer instrumentation if a print option is given.
>  In particular., this shouldn't use the `ShouldPrint*` functions.


I want all the debugging options to work the same manner whether it is opt or any other tool/way to run the pipeline
(say, in our JIT compiler we do sometimes use -print options). And I want them to work the same way both in legacy and new pass manager.
That means the main controlling interface should better be joined (and thats where ShouldPrint come into play).

> This way there's no need to involve the PassBuilder API,

PassBuilder API is there again for an easy setup in tools *like* opt.
Somehow I thought providing a central way to install all the "blessed" callbacks would be adequate, even if right now there is only a single tool that calls it.

> and you also don't pay for the instrumentation if you don't want to print.

Callbacks are not installed if printing is not enabled.
And empty instrumentation iteration is a price that we will always pay for simplicity sake. As discussed with Chandler.


Repository:
  rL LLVM

https://reviews.llvm.org/D50923





More information about the llvm-commits mailing list