This is an archive of the discontinued LLVM Phabricator instance.

[mlir][ods] Allow custom directives in optional groups
ClosedPublic

Authored by Mogball on Sep 30 2022, 5:02 PM.

Details

Summary

Attributes and types only (so far). Since struct and params are
allowed, it makes sense to allow custom directives as long as their
arguments contain at least one bound argument.

Diff Detail

Event Timeline

Mogball created this revision.Sep 30 2022, 5:02 PM
Herald added a project: Restricted Project. · View Herald TranscriptSep 30 2022, 5:02 PM
Mogball requested review of this revision.Sep 30 2022, 5:02 PM

Can you update the docs with the semantics around custom inside of an optional group?

Also, can you add tests for the error cases?

Mogball updated this revision to Diff 466662.Oct 10 2022, 4:38 PM

add error tests and update docs

rriddle accepted this revision.Oct 12 2022, 12:13 AM
rriddle added inline comments.
mlir/docs/AttributesAndTypes.md
663
664
mlir/tools/mlir-tblgen/AttrOrTypeFormatGen.cpp
1009–1010

Please don't use if initializers for nullable things. In this case it also doesn't provide any real benefits.

1027–1029

Is this possible? (I think I've seen it work before)

This revision is now accepted and ready to land.Oct 12 2022, 12:13 AM
Mogball added inline comments.Oct 12 2022, 1:54 PM
mlir/tools/mlir-tblgen/AttrOrTypeFormatGen.cpp
1027–1029

I believe it should be. Let me try

Mogball updated this revision to Diff 467326.Oct 12 2022, 5:54 PM
Mogball marked 4 inline comments as done.

comments

This revision was landed with ongoing or failed builds.Oct 12 2022, 5:56 PM
This revision was automatically updated to reflect the committed changes.