This is an archive of the discontinued LLVM Phabricator instance.

Move getAsmBlockArgumentNames from OpAsmDialectInterface to OpAsmOpInterface
ClosedPublic

Authored by mehdi_amini on Dec 19 2021, 10:44 PM.

Details

Summary

This method is more suitable as an opinterface: it seems intrinsic to
individual instances of the operation instead of the dialect.
Also remove the restriction on the interface being applicable to the entry block only.

Diff Detail

Event Timeline

mehdi_amini created this revision.Dec 19 2021, 10:44 PM
mehdi_amini requested review of this revision.Dec 19 2021, 10:44 PM
mehdi_amini retitled this revision from BEGIN_PUBLIC Move getAsmBlockArgumentNames from OpAsmDialectInterface to OpAsmOpInterface to Move getAsmBlockArgumentNames from OpAsmDialectInterface to OpAsmOpInterface.Dec 19 2021, 10:45 PM
mehdi_amini edited the summary of this revision. (Show Details)
rriddle accepted this revision.Dec 19 2021, 10:57 PM

LG. The behavior change of allowing non-entry blocks also LGTM, no valid reason not to allow that IMO.

mlir/include/mlir/IR/OpAsmInterface.td
74

? Makes it a little more obvious.

mlir/include/mlir/IR/OpImplementation.h
1353

We also have getAsmResultNames nested in the dialect interface, should we just remove that now that dialects can provide fallback op interfaces (no need to resolve that in this patch)?

mlir/lib/IR/AsmPrinter.cpp
1017
1017–1019

The behavior change of allowing non-entry blocks is not captured in the patch description.

This revision is now accepted and ready to land.Dec 19 2021, 10:57 PM
mehdi_amini added inline comments.Dec 19 2021, 11:14 PM
mlir/include/mlir/IR/OpAsmInterface.td
74

I copied from the one above, will update both!

mlir/include/mlir/IR/OpImplementation.h
1353

Yes absolutely! I noticed this as well and was planning to look into this later.

mlir/lib/IR/AsmPrinter.cpp
1017–1019

Good point!

mehdi_amini edited the summary of this revision. (Show Details)

Added comments

mehdi_amini edited the summary of this revision. (Show Details)

Update description

This revision was landed with ongoing or failed builds.Dec 19 2021, 11:19 PM
This revision was automatically updated to reflect the committed changes.