This is an archive of the discontinued LLVM Phabricator instance.

Disable implicit nesting on parsing textual pass pipeline
ClosedPublic

Authored by mehdi_amini on Nov 10 2020, 9:41 PM.

Details

Summary

Previous the textual form of the pass pipeline would implicitly nest,
instead we opt for the explicit form here: this has less surprise.

This also avoids asserting in the bindings when passing a pass pipeline
with incorrect nesting.

Diff Detail

Event Timeline

mehdi_amini created this revision.Nov 10 2020, 9:41 PM
mehdi_amini requested review of this revision.Nov 10 2020, 9:41 PM

Remove debugging braces

rriddle added inline comments.Nov 10 2020, 11:39 PM
mlir/include/mlir/Pass/PassManager.h
127

nit: I generally lean more towards a enableFoo(bool enable) style, which matches enableVerifier below.

mlir/lib/Pass/Pass.cpp
351

nit: Allowed -> Enabled

mlir/lib/Pass/PassRegistry.cpp
36

The result of the handler is being ignored here.

mlir/lib/Support/MlirOptMain.cpp
66

nit: The .str() shouldn't be necessary here.

mehdi_amini marked 2 inline comments as done.Nov 11 2020, 9:41 AM
mehdi_amini added inline comments.
mlir/include/mlir/Pass/PassManager.h
127

We have an enum, I'll go with setNesting(Implicit/Explicit)

mlir/lib/Support/MlirOptMain.cpp
66
error: no matching conversion for functional-style cast from 'llvm::Twine' to 'mlir::DiagnosticArgument'

Address River's comments

stellaraccident accepted this revision.Nov 11 2020, 9:43 AM

Aside from nits that River is discussing, lgtm! Thanks for this!

This revision is now accepted and ready to land.Nov 11 2020, 9:43 AM
rriddle accepted this revision.Nov 11 2020, 10:16 AM
rriddle added inline comments.
mlir/include/mlir/Pass/PassManager.h
122

nit: Can we just have a getNesting to match the setNesting?

127

nit: Missing a parameter name here.

mlir/lib/Support/MlirOptMain.cpp
66

Use const Twine& for the handler parameter

mehdi_amini marked an inline comment as done.Nov 11 2020, 11:20 AM
This revision was landed with ongoing or failed builds.Nov 11 2020, 11:22 AM
This revision was automatically updated to reflect the committed changes.