This is an archive of the discontinued LLVM Phabricator instance.

Refactor mlir-opt setup in a new helper function (NFC)
ClosedPublic

Authored by mehdi_amini on Aug 15 2020, 11:33 AM.

Details

Summary

This will help refactoring some of the tools to prepare for the explicit registration of
Dialects.

Diff Detail

Event Timeline

mehdi_amini created this revision.Aug 15 2020, 11:33 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 15 2020, 11:33 AM
mehdi_amini requested review of this revision.Aug 15 2020, 11:33 AM

Minor update

Update standalone-opt.cpp

jpienaar accepted this revision.Aug 15 2020, 12:47 PM

LGTM if towards removing static registration

mlir/include/mlir/Support/MlirOptMain.h
29

passPipeline as name for arg that is a CL pass pipeline parser, seems confusing. Could passes be passed in rather than parsed inside? (And so be a passed in pass pipeline). Else why not call it a parser?

mlir/lib/Support/MlirOptMain.cpp
181

Mmm, this almost feels like something that should always be displayed in help message rather than with separate option (like what targets are linked in effectively). Passes effectively are. Up to you.

This revision is now accepted and ready to land.Aug 15 2020, 12:47 PM

List dialects in --help

mlir/include/mlir/Support/MlirOptMain.h
29

The naming is weird but PassPipelineCLParser is the object that contains the result of the parsing.
It is added to the PM with LogicalResult addToPipeline(OpPassManager &pm) const;
I agree it can be a bit confusing, that said the pm has an MLIR context while the PassPipelineCLParser does not.

I'm open to suggestion on how to change this, but right now I'm not changing this API, just documenting it ; so I'll leave it for a subsequent revision

mlir/lib/Support/MlirOptMain.cpp
181

Added the list in the output of --help

I'll keep this for now as the --help is very long and one may just want the list and nothing else. We can remove later if needed.

This revision was landed with ongoing or failed builds.Aug 15 2020, 1:09 PM
This revision was automatically updated to reflect the committed changes.