[llvm-dev] Running verify between every opt pass?

Mehdi Amini via llvm-dev llvm-dev at lists.llvm.org
Fri Jul 8 11:18:20 PDT 2016


> On Jul 8, 2016, at 11:16 AM, Madhur Amilkanthwar <madhur13490 at gmail.com> wrote:
> 
> Mehdi, as you said yes this is a workaround but this is not portable
> 

Not sure what you mean by “not portable”?

> and i think the scenario mentioned here could occur in general. So running verify pass after each pass is useful.. May be we should invoke verify pass after each pass in O3 under an option say --verify-after-each? In other words, opt will invoke verify pass after each pass only if the above option is provided.
> 
Patch welcome :)
Not sure what’s the best way to implement it though...

— 
Mehdi



> On Jul 8, 2016 11:31 PM, "Mehdi Amini via llvm-dev" <llvm-dev at lists.llvm.org <mailto:llvm-dev at lists.llvm.org>> wrote:
> 
> > On Jul 8, 2016, at 12:38 AM, Mikael Holmén via llvm-dev <llvm-dev at lists.llvm.org <mailto:llvm-dev at lists.llvm.org>> wrote:
> >
> > Hi,
> >
> > Is there any easy way to run the verifier between each pass in opt if I do e.g. opt -O3 foo.ll -o foo.opt.ll ?
> 
> I don’t think so.
> 
> >
> > If I add -verify after -O3 I get one invocation of the verifier first in the FunctionPass manager and then get two (!) runs of the verifier after all other passes are run.
> >
> > Then I saw the flag -verify-each which sounds promising, the help text says
> >
> > - Verify after each transform
> >
> > but if I do
> >
> > -O3 -verify-each
> >
> > it still looks like the verifier is only run once, first in the FunctionPass manager?
> 
> 
> The verify-each flag only works for passes that are specified on the command line, it does not operate on O3.
> 
> 
> >
> > Is there any way to do this somewhat easily?
> 
> As a workaround, you can get the list of passes that matches O3:
> 
> echo "" | opt -O3 -debug-pass=Arguments
> 
> And the re-run opt with all theses passes on the command line instead of O3.
> 
>> Mehdi
> 
> 
> 
> >
> > (And the reason I got interested in this is that we've recently seen a bug in the loop-vectorizer where a verifer invocation would have complained, but without it the resulting code from opt was wrong which later caused the code to do the wrong thing at runtime.
> >
> > And running a single verifier pass after all of the opt passes wouldn't have caught it either because some other pass had already rewritten the code by then so the verifier wouldn't complain anymore.)
> >
> > Thanks,
> > Mikael
> > _______________________________________________
> > LLVM Developers mailing list
> > llvm-dev at lists.llvm.org <mailto:llvm-dev at lists.llvm.org>
> > http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev <http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev>
> 
> _______________________________________________
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org <mailto:llvm-dev at lists.llvm.org>
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev <http://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/20160708/5985ce40/attachment.html>


More information about the llvm-dev mailing list