[llvm-dev] optnone/skipping passes in the new pass manager

Arthur Eubanks via llvm-dev llvm-dev at lists.llvm.org
Tue Jun 9 09:44:48 PDT 2020


Thanks for the link to the previous discussion, that's super helpful! I'll
have to read it over more closely again.

That does remind me of another item on the NPM TODO list: codegen is still
using the legacy pass manager. I don't think it's a blocker as long as
things like opt-bisect work with it (as mentioned in the previous
discussion).

On Mon, Jun 8, 2020 at 5:56 PM Chen, Yuanfang <Yuanfang.Chen at sony.com>
wrote:

> I think adding a before-pass callback checking optnone to
> PassInstrumentation of NPM should suffice for the `skipFunction` alone.
> However, it is closely related to opt-bisect which makes it more
> complicated.
>
> This was the previous discussion.
> http://lists.llvm.org/pipermail/llvm-dev/2018-September/126477.html
>
>
> ________________________________________
> From: llvm-dev <llvm-dev-bounces at lists.llvm.org> on behalf of Arthur
> Eubanks via llvm-dev <llvm-dev at lists.llvm.org>
> Sent: Sunday, June 7, 2020 4:58 PM
> To: llvm-dev
> Subject: [llvm-dev] optnone/skipping passes in the new pass manager
>
> Looking through some of the remaining test failures under the new pass
> manager, I've narrowed down one of the failures in GWPAsan(!) to the fact
> that the new pass manager doesn't properly skip passes like the old pass
> manager. For example, when a function is marked optnone, or when using
> https://llvm.org/docs/OptBisect.html.
>
> Lots of passes (e.g. SROA) will do the following under the legacy pass
> manager:
>
>   bool runOnFunction(Function &F) override {
>     if (skipFunction(F))
>       return false;
>     // do pass
>   }
>
> What's the right way to proceed with this? There are 50-100 calls to
> skipFunction() in legacy passes. This doesn't even account for other types
> of IR units, like skipModule(Module&).
>
> I suppose it's possible to manually go in and add in the same check in the
> new passes, but that seems tedious (and how do you test that at scale?
> clearly there aren't many tests for it right now since check-llvm passes
> under the new pass manager). An alternative of skipping passes at the pass
> manager level would require marking each pass as necessary/optional (I
> think...).
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20200609/289d2aa4/attachment.html>


More information about the llvm-dev mailing list