[llvm-dev] Should Verifier be an analysis?

Son Tuan VU via llvm-dev llvm-dev at lists.llvm.org
Thu Jul 12 08:51:33 PDT 2018


Hi Hal,

Thanks for your reply. I thought that Verifier does not modify the IR,
that's why I said that printing the IR after the Verifier was not worth it.
However, this is a problem for DebugifyEach. In a nutshell, DebugifyEach
has 2 parts: it first inserts synthetic debug info to the IR, so it creates
a DICompileUnit, DILocations, DIVariables, and so on.... Then the pass to
be debugified gets executed, and finally comes the second part of
DebugifyEach, which verifies the inserted debug info, dumps the statistics,
and removes these debug info. The problem is, Verifier registers the
DICompileUnit in run(), then checks if the DICompileUnit is still there in
doFinalization(). Unfortunately, the second part of DebugifyEach already
removed that DICompileUnit...

If this is only a problem for DebugifyEach, I can handle Verifier
specially. But as Matt points out, it is quite annoying to print the IR out
after Verifier, which most of the time do not modify the IR at all.

Son Tuan Vu

On Thu, Jul 12, 2018 at 5:25 PM, Hal Finkel <hfinkel at anl.gov> wrote:

>
> On 07/12/2018 10:19 AM, Son Tuan VU via llvm-dev wrote:
>
> Hello all,
>
> I came across the code of Verifier, and see that it doesn't modify the IR
> at all. Why it is not considered as an analysis pass?
>
>
> It does not analyze the IR for the use of other transformations or
> analysis passes. It does, in a sense, transform the IR: Either it does
> nothing, or, it deletes it all.
>
>
> Actually, this will have impact on debugify-each and
> print-before/after-all: we are not supposed to print/debugify Verifier
> pass, but since Verifier is declared as a transformation (well, a
> non-analysis) pass, we actually do print/debugify it.
>
>
> Why is printing the IR before the verifier undesirable? It seems desirable
> to me.
>
>  -Hal
>
>
> Thanks for your help!
>
> Son Tuan Vu
>
>
> _______________________________________________
> LLVM Developers mailing listllvm-dev at lists.llvm.orghttp://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
>
>
> --
> Hal Finkel
> Lead, Compiler Technology and Programming Languages
> Leadership Computing Facility
> Argonne National Laboratory
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20180712/8798509a/attachment.html>


More information about the llvm-dev mailing list