This is an archive of the discontinued LLVM Phabricator instance.

[mlir][Pass] Disallow mixing -pass-pipeline with other pass options
ClosedPublic

Authored by rkayaith on Oct 11 2022, 9:52 PM.

Details

Summary

Currently -pass-pipeline can be specified multiple times and mixed
with the individual -pass-name options. Removing this feature will
allow for including the pipeline anchor as part of the option
argument (see D134900).

Diff Detail

Event Timeline

rkayaith created this revision.Oct 11 2022, 9:52 PM
Herald added a project: Restricted Project. · View Herald Transcript
rkayaith updated this revision to Diff 467021.Oct 11 2022, 10:34 PM

clang-format

rkayaith published this revision for review.Oct 11 2022, 10:53 PM
rkayaith added a reviewer: mehdi_amini.
rriddle added inline comments.Oct 11 2022, 11:58 PM
mlir/include/mlir/Pass/PassRegistry.h
259

Can you move this to the impl?

mlir/lib/Pass/PassRegistry.cpp
781–782

typo: does not does not

923–924

Can you just fix this now? i.e. you could have a temporary std::string+raw_string_ostream to capture error messages on failure.

rkayaith updated this revision to Diff 467189.Oct 12 2022, 10:32 AM
rkayaith marked 2 inline comments as done.

address comments

mlir/include/mlir/Pass/PassRegistry.h
259

PassPipelineCLParserImpl is used by PassNameCLParser as well, so moving the option into there causes it to be registered twice.

mlir/lib/Pass/PassRegistry.cpp
923–924

fixed, but since the messages from parsePassPipeline don't have a consistent format some cases end up looking odd, e.g.

$ mlir-opt -pass-pipeline='unbalanced('
MLIR Textual PassPipeline Parser:1:12: error: encountered unbalanced parentheses while parsing pipeline
unbalanced(
           ^

becomes:

$ mlir-opt -pass-pipeline='unbalanced('
<unknown>:0: error: MLIR Textual PassPipeline Parser:1:12: error: encountered unbalanced parentheses while parsing pipeline
unbalanced(
           ^

(the <location>: error: part is being printed twice)

friendly ping

@rriddle could you take another look at this? it's the last patch in the stack that needs review

LGTM. Apologies for the delay, I've been a little swamped lately.

mlir/lib/Pass/PassRegistry.cpp
923–924

Hmmm, can you file an issue for that? It'd be good to have a nice experience here.

rriddle accepted this revision.Nov 1 2022, 10:43 PM
This revision is now accepted and ready to land.Nov 1 2022, 10:43 PM
rkayaith added inline comments.Nov 2 2022, 12:16 PM
mlir/lib/Pass/PassRegistry.cpp
923–924