This is an archive of the discontinued LLVM Phabricator instance.

[mlir] Revamp operation documentation generation
ClosedPublic

Authored by rriddle on Mar 22 2020, 1:47 PM.

Details

Summary

This revisions performs several cleanups to the generated dialect documentation:

  • Standardizes format of attributes/operands/results sections
  • Splits out operation/type/dialect documentation generation to allow for composing generated and hand-written documentation
  • Add section for declarative assembly syntax and successors
  • General cleanup

Diff Detail

Event Timeline

rriddle created this revision.Mar 22 2020, 1:47 PM
bondhugula added inline comments.
mlir/tools/mlir-tblgen/OpDocGen.cpp
185

Should this be just changed to `dialect.getName() << " Dialect\n"? It's a bit odd to see Dialect -> Dialect 'xyz' definition here:
https://mlir.llvm.org/docs/Dialects/

rriddle updated this revision to Diff 251950.Mar 22 2020, 11:38 PM
rriddle marked an inline comment as done.

Resolve comments

rriddle updated this revision to Diff 251951.Mar 22 2020, 11:40 PM

Resolve clang-tidy/clang-format errors

jpienaar marked an inline comment as done.Mar 23 2020, 9:08 AM
jpienaar added inline comments.
mlir/tools/mlir-tblgen/OpDocGen.cpp
120–121

I'm pro a table here as then the formatting can be left to markdown generation/CSS etc. and so this produces the content and the formatting/"pretty" parts gets done by markdown generator (then switching between different formats, alternating highlights, left align/center align etc. can be left to the formatters). Markdown generators and CSS already have so many different nobs for all those things ...

185

Yeah the weirdness was due to expecting that one could have multiple dialects in one file, which I don't think has happened really.

rriddle updated this revision to Diff 252085.Mar 23 2020, 9:50 AM
rriddle marked an inline comment as done.

Resolve comments

jpienaar accepted this revision.Mar 24 2020, 11:06 AM
This revision is now accepted and ready to land.Mar 24 2020, 11:06 AM
This revision was automatically updated to reflect the committed changes.