This is an archive of the discontinued LLVM Phabricator instance.

[MLIR][doc] Make summary appear different than discription
ClosedPublic

Authored by rikhuijzer on Jun 10 2023, 8:08 AM.

Details

Summary

This patch aims to clarify which part of the docs is the summary and which
part is the description.

I did a preview of the output and think the suggested bold and italic style
is much clearer and looks reasonably nice.

I've considered also to enforce capitalization of the first letter of the
summary and ending with a dot (as discussed in
https://reviews.llvm.org/D151649), but it seems to me that the tradeoff in
extra test running time is not worth it. Currently, emitOpDoc is not
triggered for every summary during check-mlir.

Diff Detail

Event Timeline

rikhuijzer created this revision.Jun 10 2023, 8:08 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 10 2023, 8:08 AM
rikhuijzer requested review of this revision.Jun 10 2023, 8:08 AM
jpienaar accepted this revision.Jun 10 2023, 9:48 AM

I think there are only two tests for it, and none check anything much, so didn't quite follow the testing comment. I'd not be considered too much about efficiency here, it's not something that happens often and the time spent in the tool is rather low.

This revision is now accepted and ready to land.Jun 10 2023, 9:48 AM

I think there are only two tests for it, and none check anything much, so didn't quite follow the testing comment. I'd not be considered too much about efficiency here, it's not something that happens often and the time spent in the tool is rather low.

Ah yes I understand the confusion. I meant that we could add a test to check-mlir which verifies all the summarys by running mlir-tblgen, but that sounded pretty computationally expensive to me for a reasonably trivial check.

rikhuijzer added a comment.EditedJun 10 2023, 2:26 PM

Okay. Upon further inspection of the code and documentation, I've made a few mistakes with this patch:

  1. Passes use a different logic for generating the documentation; which I didn't update to be in-line with this change.
  2. Just like the documentation re-uses emitDescription internally for the generation, I should have defined and used emitSummary.
  3. amx.tdpbssd shows **Summary:** __ meaning that apparently hasSummary does not guarantee a non-empty summary.
  4. The **Summary:** is a bit verbose. Probably just making italic should be enough.
  5. Summary fields containing * cancel the italicization, so the * should probably be escaped to solve this. EDIT: Nope. This is because mlir-www runs Hugo 0.80 whereas 0.111 correctly parses _Raw Buffer Floating-point Atomic Add (MI-* only)_ as an italicized string.

I'll soon make a patch to fix these things.