[llvm-dev] Pass reduction with new PM

Arthur Eubanks via llvm-dev llvm-dev at lists.llvm.org
Fri Jul 30 11:53:49 PDT 2021


There still is nothing like bugpoint's pass list reduce for the new PM.

The issue is that ideally we'd be able to map a pass pipeline to the string
version of it. But we can't really do that right now. We could attempt to
do that, but a generated argument list won't be exact since passes added
via code (e.g. PassManagerBuilder/PassBuilder.cpp) often have parameters
that can't be represented via opt arguments. Maybe getting an approximate
textual representation of the pipeline is good enough for some cases? But
that doesn't seem ideal.
We could also go down the route of making all pipelines representable via
text, but that's a non-trivial project.

Note that even the legacy PM has this problem, and I've heard that this has
bitten people in the past.

Perhaps as a short term hack, we could get an approximation of the pipeline
by hacking PrintPassInstrumentation to print the textual name of each pass
that's run via `PIC->getPassNameForClassName(PassID)` (like
PrintIRInstrumentation). Then run `opt -debug-pass-manager with that hacked
up version of PrintPassInstrumentation. We'd also need another version of
-debug-pass-manager that prints adaptors/pass managers but doesn't print
analyses. We'd run `opt` over a file with one function that contains one
loop, e.g. the IR in new-pm-defaults.ll. Then cleanup the output of
-debug-pass-manager with proper pass nesting.

Or of course you could attempt to manually recreate the proper textual
representation by looking at PassBuilder.cpp.

Then we'd need something that reduces the textual pass pipeline.

Let me know if you'd like more details.

On Fri, Jul 30, 2021 at 12:25 AM Markus Lavin via llvm-dev <
llvm-dev at lists.llvm.org> wrote:

> Hi,
>
>
>
> Right now I am trying to analyze a bug that appears with new PM pipeline
> as follows
>
>
>
> $ opt -enable-new-pm=1 -disable-basic-aa -tbaa -O1 -o /dev/null reduced.ll
>
>
>
> the crashing pass is LICM but simply exporting IR before that pass and
> then running just that pass does not seem to capture enough state to
> reproduce the problem.
>
>
>
> So here one would either want bugpoint to help automatically reduce the
> pass list or simply use -debug-pass=Arguments and do it manually but as I
> understand it neither of those options work with the new PM.
>
>
>
> This has already been brought up in [llvm-dev] How to get from "opt -O3"
> to "opt <a-single-pass>" with the new PM?
> <https://lists.llvm.org/pipermail/llvm-dev/2021-March/148994.html>
>
> Has there been any progress since then?
>
>
>
> br
>
> Markus
>
>
> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20210730/bf9ca963/attachment.html>


More information about the llvm-dev mailing list