This is an archive of the discontinued LLVM Phabricator instance.

[mlir][ODS] Add documentation for the declarative assembly format.
ClosedPublic

Authored by rriddle on Feb 4 2020, 11:02 AM.

Details

Summary

This details the structure of the format, it's requirements, and gives a few examples.

Diff Detail

Event Timeline

rriddle created this revision.Feb 4 2020, 11:02 AM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 4 2020, 11:02 AM

Unit tests: pass. 62423 tests passed, 0 failed and 845 were skipped.

clang-tidy: pass.

clang-format: pass.

Build artifacts: diff.json, clang-tidy.txt, clang-format.patch, CMakeCache.txt, console-log.txt, test-results.xml

Pre-merge checks is in beta. Report issue. Please join beta or enable it for your project.

jpienaar accepted this revision.Feb 4 2020, 4:22 PM
jpienaar marked an inline comment as done.

Looks good thanks

mlir/docs/OpDefinitions.md
608

Does this render correctly with hugo?

623

It might be good to point out that this is a requirement of parsing custom forms in general and not specific to this.

631

Are optional attributes handled? I'm assuming no special handling, only via attr-dict.

654–655

Reflow?

1129

Awh, I just looked at when this was originally written :)

This revision is now accepted and ready to land.Feb 4 2020, 4:22 PM
antiagainst accepted this revision.Feb 4 2020, 6:47 PM

Nice!

mlir/docs/OpDefinitions.md
596

"all the operands" to be clear.

603

Say a bit more about variadic operand/result?

616

A variable ... an argument, result, attribute, etc.

632

Should we also mention what happens when we have both attr-dict and specific attributes using variables?

rriddle updated this revision to Diff 242505.Feb 4 2020, 7:13 PM
rriddle marked 10 inline comments as done.

Resolve most comments.

mlir/docs/OpDefinitions.md
603

I added, and linked to, "variable" to be a bit more specific. The operand/result here refers to the thing registered on the operation in ODS, so variadic isn't differentiated from non-variadic.

623

Several of these technically apply to the custom form in general, i.e. you should really make sure all operands are covered. Is there a specific way that you suggest I point this out?

631

Yep. There is no distinction between optional/non-optional attributes. We just elide any attributes that were explicitly present in the format from the attribute dictionary.

632

See response to Jacques.

Unit tests: pass. 62465 tests passed, 0 failed and 845 were skipped.

clang-tidy: pass.

clang-format: pass.

Build artifacts: diff.json, clang-tidy.txt, clang-format.patch, CMakeCache.txt, console-log.txt, test-results.xml

Pre-merge checks is in beta. Report issue. Please join beta or enable it for your project.

rriddle updated this revision to Diff 242682.Feb 5 2020, 10:15 AM

Add example of variable.

rriddle marked 3 inline comments as done.Feb 5 2020, 10:16 AM
rriddle added inline comments.
mlir/docs/OpDefinitions.md
608

Confirmed that it does.

This revision was automatically updated to reflect the committed changes.
rriddle marked an inline comment as done.