Optionally turn off verifier during parsing?

Folks,

Debugging Tips - MLIR mentions (regarding mlir-opt)

  • When dealing with verifier errors, --verify-each=0 turns off the verifier, allowing one to see the full invalid IR

However, this only applies to passes (see llvm-project/mlir/lib/Tools/mlir-opt/MlirOptMain.cpp at 8274be509ed9e07188a8a64d95907a46cbe8e657 · llvm/llvm-project) and does not turn off the verifier during parsing (see llvm-project/mlir/lib/Tools/mlir-opt/MlirOptMain.cpp at main · llvm/llvm-project, and I see no readily-available method to do so.

Would it be worth it to submit a patch which extends --verify-each=0 to the parser as well? If so, I would do that.

Background: I have a huge IR and am debugging passes on it. My verifier is unfortunately slow (probably my own fault), and I’ve been hacking it off by other means to speed things along.

Thank you all for your efforts,
Tom

That may be a reasonable addition. I would want to see the option named very explicitly though, something like --mlir-very-unsafe-disable-verifier-on-parsing or something similar this that discourage folks from using it.
Feel free to send a PR and ping me there!

1 Like