History log of /llvm-project/mlir/tools/mlir-tblgen/OpDocGen.cpp (Results 1 – 25 of 66)
Revision Date Author Comments
# e5521fae 17-Dec-2024 Malte Dehling <mdehling@gmail.com>

[mlir-tblgen] Fix bug in emitEnumDoc (#118131)

Fixes a crash (assertion failure) in `mlir-tblgen -emit-enum-doc` caused
by calling `EnumAttr()` for the wrong type of `Record *`: `EnumAttr`
rather

[mlir-tblgen] Fix bug in emitEnumDoc (#118131)

Fixes a crash (assertion failure) in `mlir-tblgen -emit-enum-doc` caused
by calling `EnumAttr()` for the wrong type of `Record *`: `EnumAttr`
rather than `EnumAttrInfo` as asserted.

Compare the corresponding line in `emitDialectDoc()`:

https://github.com/llvm/llvm-project/blob/0ad6be1927f89cef09aa5d0fb244873f687997c9/mlir/tools/mlir-tblgen/OpDocGen.cpp#L532

Co-authored-by: Malte Dehling <m.dehling@samsung.com>

show more ...


# 0a6def62 19-Oct-2024 Longsheng Mou <longshengmou@gmail.com>

[mlir][doc] Emit `\n` if description not end with `\n`. (#112898)

This PR addresses a markdown formatting issue by ensuring a `\n` is
emitted if the description string does not already end with one

[mlir][doc] Emit `\n` if description not end with `\n`. (#112898)

This PR addresses a markdown formatting issue by ensuring a `\n` is
emitted if the description string does not already end with one. Fixes
#112672.

show more ...


# e8137503 03-Oct-2024 Rahul Joshi <rjoshi@nvidia.com>

[NFC] Rename variable `recordKeeper` to `records` (#110989)


# bccd37f6 02-Oct-2024 Rahul Joshi <rjoshi@nvidia.com>

[NFC][MLIR][TableGen] Eliminate `llvm::` for commonly used types (#110841)

Eliminate `llvm::` namespace qualifier for commonly used types in MLIR
TableGen backends to reduce code clutter.


# a5dfcccd 01-Oct-2024 Rahul Joshi <rjoshi@nvidia.com>

[MLIR][TableGen] Change MLIR TableGen to use const Record * (#110687)

This is a part of effort to have better const correctness in TableGen
backends:


https://discourse.llvm.org/t/psa-planned-c

[MLIR][TableGen] Change MLIR TableGen to use const Record * (#110687)

This is a part of effort to have better const correctness in TableGen
backends:


https://discourse.llvm.org/t/psa-planned-changes-to-tablegen-getallderiveddefinitions-api-potential-downstream-breakages/81089

show more ...


# ffc80de8 15-Sep-2024 JOE1994 <joseph942010@gmail.com>

[mlir] Nits on uses of llvm::raw_string_ostream (NFC)

* Don't call raw_string_ostream::flush(), which is essentially a no-op
* Strip unneeded calls to raw_string_ostream::str(), to avoid excess indi

[mlir] Nits on uses of llvm::raw_string_ostream (NFC)

* Don't call raw_string_ostream::flush(), which is essentially a no-op
* Strip unneeded calls to raw_string_ostream::str(), to avoid excess indirection.

show more ...


# b60c6cbc 07-Sep-2024 Rahul Joshi <rjoshi@nvidia.com>

[MLIR][TableGen] Migrate MLIR backends to use const RecordKeeper (#107505)

- Migrate MLIR backends to use a const RecordKeeper reference.


# 16df489f 06-Sep-2024 Rahul Joshi <rjoshi@nvidia.com>

[TableGen] Add const variants of accessors for backend (#106658)

Split RecordKeeper `getAllDerivedDefinitions` family of functions into
two variants:
(a) non-const ones that return vectors of `R

[TableGen] Add const variants of accessors for backend (#106658)

Split RecordKeeper `getAllDerivedDefinitions` family of functions into
two variants:
(a) non-const ones that return vectors of `Record *` and
(b) const ones, that return vector/ArrayRef of `const Record *`.

This will help gradual migration of TableGen backends to use
`const RecordKeeper` and by implication change code to work
with const pointers and better const correctness.

Existing backends are not yet compatible with the const family of
functions, so change them to use a non-constant `RecordKeeper`
reference, till they are migrated.

show more ...


# f0918485 16-Jul-2024 Tom Natan <130450079+tomnatan30@users.noreply.github.com>

Add support for enum doc gen (#98885)


# 061e4f24 23-Dec-2023 Rik Huijzer <github@huijzer.xyz>

[mlir][doc] Escape effects, interfaces, and traits (#76297)

Fixes https://github.com/llvm/llvm-project/issues/76270.

Thanks to @scottamain for the clear description.


Co-authored-by: Scott Ma

[mlir][doc] Escape effects, interfaces, and traits (#76297)

Fixes https://github.com/llvm/llvm-project/issues/76270.

Thanks to @scottamain for the clear description.


Co-authored-by: Scott Main <scott@modular.com>

show more ...


# 88d319a2 14-Dec-2023 Kazu Hirata <kazu@google.com>

[mlir] Use StringRef::{starts,ends}_with (NFC)

This patch replaces uses of StringRef::{starts,ends}with with
StringRef::{starts,ends}_with for consistency with
std::{string,string_view}::{starts,end

[mlir] Use StringRef::{starts,ends}_with (NFC)

This patch replaces uses of StringRef::{starts,ends}with with
StringRef::{starts,ends}_with for consistency with
std::{string,string_view}::{starts,ends}_with in C++20.

I'm planning to deprecate and eventually remove
StringRef::{starts,ends}with.

show more ...


# e9869b57 30-Nov-2023 Rik Huijzer <github@huijzer.xyz>

[mlir][docgen] Add ops source link (#73657)

This patch suggests to change two things. Firstly, it adds a source link
above the generated operations docs (above the `emitOpDoc` calls). This
link wi

[mlir][docgen] Add ops source link (#73657)

This patch suggests to change two things. Firstly, it adds a source link
above the generated operations docs (above the `emitOpDoc` calls). This
link will point directly to the source TableGen file for the group of
operations. For example, for the current
[`amdgpu`](https://mlir.llvm.org/docs/Dialects/AMDGPU/) page, the link
will add a source link below the "Operation definition" heading pointing
to
[`mlir/include/mlir/Dialect/AMDGPU/IR/AMDGPU.td`](https://github.com/llvm/llvm-project/blob/main/mlir/include/mlir/Dialect/AMDGPU/IR/AMDGPU.td).
The link is wrapped in a "op-definitions-source-link" class which could
allow for custom styling, but it also looks reasonable without custom
styling I think:

![afbeelding](https://github.com/llvm/llvm-project/assets/20724914/7c0e59b9-b14b-4f5d-a671-c87e857a7b03)

Secondly, this patch simplifies the header names such as "Operation
definition" and "Attribute definition" to "Operations" and "Attributes"
respectively. This is in line with manually defined subheadings on pages
such as the one for the
[`vector`](https://mlir.llvm.org/docs/Dialects/Vector/#operations)
dialect.

show more ...


# 9a8ff346 13-Oct-2023 Rik Huijzer <github@huijzer.xyz>

[mlir][doc] Trim summary text during DocGen (#68477)

When defining a multi-line string in tblgen, the output in the Markdown
file currently contains too much whitespace and newlines for Hugo's
Mar

[mlir][doc] Trim summary text during DocGen (#68477)

When defining a multi-line string in tblgen, the output in the Markdown
file currently contains too much whitespace and newlines for Hugo's
Markdown parser. For example, for `arith.addui_extended` the tblgen
```tblgen
let summary = [{
extended unsigned integer addition operation returning sum and overflow bit
}];
```
is currently converted to
```markdown
_
extended unsigned integer addition operation returning sum and overflow bit
_
```
which causes the text to not be italicized (as can be seen at
https://mlir.llvm.org/docs/Dialects/ArithOps/#arithaddui_extended-arithadduiextendedop).
After this PR, the output becomes
```
_Extended unsigned integer addition operation returning sum and overflow bit_
```

show more ...


# 2754f88a 11-Oct-2023 Benjamin Maxwell <benjamin.maxwell@arm.com>

[mlir][docgen] Add option to enable Hugo Docs specific features (#68725)

This is set to off by default but enabled for the MLIR project, which
uses Hugo Docs. Downstream projects can choose if they

[mlir][docgen] Add option to enable Hugo Docs specific features (#68725)

This is set to off by default but enabled for the MLIR project, which
uses Hugo Docs. Downstream projects can choose if they want to set this
option or not.

Also fix an incorrectly closed `<table>` tag.

show more ...


# d339d8fe 27-Sep-2023 Benjamin Maxwell <benjamin.maxwell@arm.com>

[mlir][docgen] Display full attribute descriptions in expandable regions (#67009)

This updates the table of op attributes so that clicking the summary
expands to show the complete description.

`

[mlir][docgen] Display full attribute descriptions in expandable regions (#67009)

This updates the table of op attributes so that clicking the summary
expands to show the complete description.

```
Attribute | MLIR Type | Description
<name> <type> ▶ <summary> <-- Click to expand
```

Enum attributes have now also been updated to generate a description
that lists all the cases (with both their MLIR and C++ names). This
makes viewing enums on the MLIR docs much nicer.

**Example**

Default view:

![image](https://github.com/llvm/llvm-project/assets/11597044/922669c7-b838-4230-bcfd-a77cde0f335d)

Expanded:

![image](https://github.com/llvm/llvm-project/assets/11597044/41da086e-a5ce-45dd-9f44-9d10a4d5f2e1)

---

This requires: https://github.com/llvm/mlir-www/pull/158 (adds a very
simple markdown shortcode)

show more ...


# fbb5f733 23-Jun-2023 Jacques Pienaar <jpienaar@google.com>

[mlir][docgen] Change nested check

Allows for single op nested regions.


# 791c3cb7 19-Jun-2023 Jacques Pienaar <jpienaar@google.com>

[mlir][docgen] Enable op grouping mechanism.

Add ability to be able to group ops together in documentation generation. This
results in section of ops grouped together under one summary & description

[mlir][docgen] Enable op grouping mechanism.

Add ability to be able to group ops together in documentation generation. This
results in section of ops grouped together under one summary & description.
This doesn't do anything special for the groups beyond nesting yet.

Differential Revision: https://reviews.llvm.org/D153306

show more ...


# 4acbd444 13-Jun-2023 rikhuijzer <rikhuijzer@pm.me>

[MLIR][Doc] Also print `summary`s for passes on a newline

This patch is improves upon https://reviews.llvm.org/D152621. There, I pointed out some issues with D152621, which I'll repeat here.

> Pass

[MLIR][Doc] Also print `summary`s for passes on a newline

This patch is improves upon https://reviews.llvm.org/D152621. There, I pointed out some issues with D152621, which I'll repeat here.

> Passes use a different logic for generating the documentation; which I didn't update to be in-line with this change.

Fixed by defining and using `mlir::tblgen::emitSummary`. This is now used in `OpDocGen.cpp` and `PassDocGen.cpp`.

Note that the passes documentation currently prints the summary behind the pass argument. For example:

```
#### -arm-neon-2d-to-intr: Convert Arm NEON structured ops to intrinsics
```
at https://mlir.llvm.org/docs/Passes/#-promote-buffers-to-stack-promotes-heap-based-allocations-to-automatically-managed-stack-based-allocations.

This currently differs from how the summary is printed for Ops. For example:

```
#### amdgpu.lds_barrier (::mlir::amdgpu::LDSBarrierOp) ¶

**Summary:** _Barrier that includes a wait for LDS memory operations._
```

at https://mlir.llvm.org/docs/Dialects/AMDGPU/#amdgpulds_barrier-mliramdgpuldsbarrierop.

The changes in this patch ensure that:

1. The summary is always printed on a new line.
2. The summary is always printed in italic.
3. The summary always starts with a capital letter.

I've dropped the `**Summary:**`, which was introduced in D152621, because only italicization should be already clear enough.

> `amx.tdpbssd` shows **Summary:** __ meaning that apparently hasSummary does not guarantee a non-empty summary.

This is fixed by double-checking `!summary.empty()`, because the following code

```cpp
void mlir::tblgen::emitSummary(StringRef summary, raw_ostream &os) {
if (!summary.empty()) {
char first = std::toupper(summary.front());
llvm::StringRef rest = summary.drop_front();
os << "\n_" << first << rest << "_\n\n";
} else {
os << "\n_" << "foo" << "_\n\n";
}
}
```
generates the following Markdown:
```
### `amx.tdpbssd` (::mlir::amx::x86_amx_tdpbssd)

_foo_
```
in `tools/mlir/docs/Dialects/AMX.md`.

> 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.

This will be fixed by https://github.com/llvm/mlir-www/pull/152.

Reviewed By: jpienaar

Differential Revision: https://reviews.llvm.org/D152648

show more ...


# 0118a3f6 07-Jun-2023 Jacques Pienaar <jpienaar@google.com>

[mlir][docgen] Enable custom prefix strip for op name.

The fully qualified name gets long in the TOC (especially on mobile),
enable specifying a prefix to be stripped.

Differential Revision: https:

[mlir][docgen] Enable custom prefix strip for op name.

The fully qualified name gets long in the TOC (especially on mobile),
enable specifying a prefix to be stripped.

Differential Revision: https://reviews.llvm.org/D152404

show more ...


# 5c09caf5 10-Jun-2023 rikhuijzer <rikhuijzer@pm.me>

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

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 thin

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

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`.

Reviewed By: jpienaar

Differential Revision: https://reviews.llvm.org/D152621

show more ...


# 83685287 07-Dec-2022 Markus Böck <markus.boeck02@gmail.com>

[mlir][tblgen][docs] Use correct introductionary prefix for the Syntax description of attributes and types

The doc generator currently has the use of `!` as prefix hardcoded, despite being incorrect

[mlir][tblgen][docs] Use correct introductionary prefix for the Syntax description of attributes and types

The doc generator currently has the use of `!` as prefix hardcoded, despite being incorrect for Attributes. These start with `#`.

This patch fixes that little issue by using `#` for AttrDefs and `!` for TypeDefs in the `Syntax` field of the generated Markdown file.

Differential Revision: https://reviews.llvm.org/D139524

show more ...


# 3cfe412e 06-Dec-2022 Fangrui Song <i@maskray.me>

[TableGen] llvm::Optional => std::optional


# 832955f6 12-Oct-2022 River Riddle <riddleriver@gmail.com>

[mlir] Cleanup DialectDocGen to check for the dialect early

We only ever generate documentation for one dialect, so there
isn't a good reason to collect every possible dialect entity.

Differential

[mlir] Cleanup DialectDocGen to check for the dialect early

We only ever generate documentation for one dialect, so there
isn't a good reason to collect every possible dialect entity.

Differential Revision: https://reviews.llvm.org/D135812

show more ...


# 2e2ad539 10-Aug-2022 Alex Zinenko <zinenko@google.com>

[mlir] Generate C++ doc comments for interfaces

When emitting the declarations for interface methods defined in ODS,
also emit their descriptions as C++ comments. This makes the
documentation access

[mlir] Generate C++ doc comments for interfaces

When emitting the declarations for interface methods defined in ODS,
also emit their descriptions as C++ comments. This makes the
documentation accessible to C++ tooling such as IDEs that offers better
usability than reading it form the .td or the website.

Reviewed By: jpienaar

Differential Revision: https://reviews.llvm.org/D130478

show more ...


# 287ade41 17-Jun-2022 Jacques Pienaar <jpienaar@google.com>

[mlir][doc] Avoid duplication with constraints and defs

Where a constraint also has a def, emit the def only to avoid duplicate
output (and def has more complete info). Also move attributes and type

[mlir][doc] Avoid duplication with constraints and defs

Where a constraint also has a def, emit the def only to avoid duplicate
output (and def has more complete info). Also move attributes and types
to the end rather than some on top and some at end.

Differential Revision: https://reviews.llvm.org/D127823

show more ...


123