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

Mikael Holmén via llvm-dev llvm-dev at lists.llvm.org
Fri Jul 8 00:38:55 PDT 2016


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 ?

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?

Is there any way to do this somewhat easily?

(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.)


More information about the llvm-dev mailing list