<feed xmlns='http://www.w3.org/2005/Atom'>
<title>llvm-project.git/mlir/lib/CAPI/IR/BuiltinAttributes.cpp, branch main</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.
</subtitle>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/'/>
<entry>
<title>Reapply "[mlir][python] allow DenseIntElementsAttr for index type (#118947)" (#124804)</title>
<updated>2025-01-29T08:14:37+00:00</updated>
<author>
<name>Matthias Gehre</name>
<email>matthias.gehre@amd.com</email>
</author>
<published>2025-01-29T08:14:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=5d3ae5161210c068d01ffba36c8e0761e9971179'/>
<id>5d3ae5161210c068d01ffba36c8e0761e9971179</id>
<content type='text'>
This reapplies #118947 and adapts to nanobind.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This reapplies #118947 and adapts to nanobind.</pre>
</div>
</content>
</entry>
<entry>
<title>Revert "[mlir][python] allow DenseIntElementsAttr for index type (#118947)"</title>
<updated>2025-01-28T17:35:50+00:00</updated>
<author>
<name>Matthias Gehre</name>
<email>matthias.gehre@amd.com</email>
</author>
<published>2025-01-28T17:35:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=1b729c3d70cecd89504927fed56498f851f0d74d'/>
<id>1b729c3d70cecd89504927fed56498f851f0d74d</id>
<content type='text'>
This reverts commit 9dd762e8b10586e749b0ddf3542e5dccf8392395.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This reverts commit 9dd762e8b10586e749b0ddf3542e5dccf8392395.
</pre>
</div>
</content>
</entry>
<entry>
<title>[mlir][python] allow DenseIntElementsAttr for index type (#118947)</title>
<updated>2025-01-28T17:31:58+00:00</updated>
<author>
<name>Matthias Gehre</name>
<email>matthias.gehre@amd.com</email>
</author>
<published>2025-01-28T17:31:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=9dd762e8b10586e749b0ddf3542e5dccf8392395'/>
<id>9dd762e8b10586e749b0ddf3542e5dccf8392395</id>
<content type='text'>
Model the `IndexType` as `uint64_t` when converting to a python integer. 

With the python bindings, 
```python
DenseIntElementsAttr(op.attributes["attr"])
```
used to `assert` when `attr` had `index` type like `dense&lt;[1, 2, 3, 4]&gt;
: vector&lt;4xindex&gt;`.

---------

Co-authored-by: Christopher McGirr &lt;christopher.mcgirr@amd.com&gt;
Co-authored-by: Tiago Trevisan Jost &lt;tiago.trevisanjost@amd.com&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Model the `IndexType` as `uint64_t` when converting to a python integer. 

With the python bindings, 
```python
DenseIntElementsAttr(op.attributes["attr"])
```
used to `assert` when `attr` had `index` type like `dense&lt;[1, 2, 3, 4]&gt;
: vector&lt;4xindex&gt;`.

---------

Co-authored-by: Christopher McGirr &lt;christopher.mcgirr@amd.com&gt;
Co-authored-by: Tiago Trevisan Jost &lt;tiago.trevisanjost@amd.com&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>[MLIR][Python] Python binding support for IntegerSet attribute (#107640)</title>
<updated>2024-09-11T11:37:35+00:00</updated>
<author>
<name>Amy Wang</name>
<email>kai.ting.wang@huawei.com</email>
</author>
<published>2024-09-11T11:37:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=334873fe2df27a4fa613e8744f29e502d3358397'/>
<id>334873fe2df27a4fa613e8744f29e502d3358397</id>
<content type='text'>
Support IntegerSet attribute python binding.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Support IntegerSet attribute python binding.</pre>
</div>
</content>
</entry>
<entry>
<title>[MLIR] Add llvm (debug) attributes to CAPI (#83992)</title>
<updated>2024-03-07T17:10:46+00:00</updated>
<author>
<name>Edgar</name>
<email>git@edgarluque.com</email>
</author>
<published>2024-03-07T17:10:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=3714f937b835c06c8c32ca4f3f61ba2317db2296'/>
<id>3714f937b835c06c8c32ca4f3f61ba2317db2296</id>
<content type='text'>
This PR adds the following to the mlir c api:

- The disctinct mlir builtin attribute.
- LLVM attributes (mostly debug related ones)</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This PR adds the following to the mlir c api:

- The disctinct mlir builtin attribute.
- LLVM attributes (mostly debug related ones)</pre>
</div>
</content>
</entry>
<entry>
<title>[mlir] Add Python bindings for DenseResourceElementsAttr. (#66319)</title>
<updated>2023-09-15T01:45:29+00:00</updated>
<author>
<name>Stella Laurenzo</name>
<email>stellaraccident@gmail.com</email>
</author>
<published>2023-09-15T01:45:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=f66cd9e9556a53142a26a5c21a72e21f1579217c'/>
<id>f66cd9e9556a53142a26a5c21a72e21f1579217c</id>
<content type='text'>
Only construction and type casting are implemented. The method to create
is explicitly named "unsafe" and the documentation calls out what the
caller is responsible for. There really isn't a better way to do this
and retain the power-user feature this represents.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Only construction and type casting are implemented. The method to create
is explicitly named "unsafe" and the documentation calls out what the
caller is responsible for. There really isn't a better way to do this
and retain the power-user feature this represents.</pre>
</div>
</content>
</entry>
<entry>
<title>[mlir] Make it possible to build a DenseResourceElementsAttr from untyped memory. (#66009)</title>
<updated>2023-09-11T21:10:03+00:00</updated>
<author>
<name>Stella Laurenzo</name>
<email>stellaraccident@gmail.com</email>
</author>
<published>2023-09-11T21:10:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=7055df7b4f6abf64f672703316bb8a7e7b185652'/>
<id>7055df7b4f6abf64f672703316bb8a7e7b185652</id>
<content type='text'>
Exposes the existing `get(ShapedType, StringRef, AsmResourceBlob)`
builder publicly (was protected) and adds a CAPI
`mlirUnmanagedDenseBlobResourceElementsAttrGet`.

While such a generic construction interface is a big help when it comes
to interop, it is also necessary for creating resources that don't have
a standard C type (i.e. f16, the f8s, etc).

Previously reviewed/approved as part of https://reviews.llvm.org/D157064</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Exposes the existing `get(ShapedType, StringRef, AsmResourceBlob)`
builder publicly (was protected) and adds a CAPI
`mlirUnmanagedDenseBlobResourceElementsAttrGet`.

While such a generic construction interface is a big help when it comes
to interop, it is also necessary for creating resources that don't have
a standard C type (i.e. f16, the f8s, etc).

Previously reviewed/approved as part of https://reviews.llvm.org/D157064</pre>
</div>
</content>
</entry>
<entry>
<title>Add SymbolRefAttr to python bindings</title>
<updated>2023-07-06T01:51:33+00:00</updated>
<author>
<name>max</name>
<email>maksim.levental@gmail.com</email>
</author>
<published>2023-07-05T20:02:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=4eee9ef9768b1335800878b8f0b7aa3e549e41dc'/>
<id>4eee9ef9768b1335800878b8f0b7aa3e549e41dc</id>
<content type='text'>
Differential Revision: https://reviews.llvm.org/D154541
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Differential Revision: https://reviews.llvm.org/D154541
</pre>
</div>
</content>
</entry>
<entry>
<title>[MLIR][python bindings] TypeCasters for Attributes</title>
<updated>2023-06-07T17:01:00+00:00</updated>
<author>
<name>max</name>
<email>maksim.levental@gmail.com</email>
</author>
<published>2023-05-31T20:52:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=9566ee280607d91fa2e5eca730a6765ac84dfd0f'/>
<id>9566ee280607d91fa2e5eca730a6765ac84dfd0f</id>
<content type='text'>
Differential Revision: https://reviews.llvm.org/D151840
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Differential Revision: https://reviews.llvm.org/D151840
</pre>
</div>
</content>
</entry>
<entry>
<title>[mlir] Update method cast calls to function calls</title>
<updated>2023-05-12T09:21:30+00:00</updated>
<author>
<name>Tres Popp</name>
<email>tpopp@google.com</email>
</author>
<published>2023-05-11T09:10:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=c1fa60b4cde512964544ab66404dea79dbc5dcb4'/>
<id>c1fa60b4cde512964544ab66404dea79dbc5dcb4</id>
<content type='text'>
The MLIR classes Type/Attribute/Operation/Op/Value support
cast/dyn_cast/isa/dyn_cast_or_null functionality through llvm's doCast
functionality in addition to defining methods with the same name.
This change begins the migration of uses of the method to the
corresponding function call as has been decided as more consistent.

Note that there still exist classes that only define methods directly,
such as AffineExpr, and this does not include work currently to support
a functional cast/isa call.

Context:

* https://mlir.llvm.org/deprecation/ at "Use the free function variants for dyn_cast/cast/isa/…"
* Original discussion at https://discourse.llvm.org/t/preferred-casting-style-going-forward/68443

Implementation:
This follows a previous patch that updated calls
`op.cast&lt;T&gt;()-&gt; cast&lt;T&gt;(op)`. However some cases could not handle an
unprefixed `cast` call due to occurrences of variables named cast, or
occurring inside of class definitions which would resolve to the method.
All C++ files that did not work automatically with `cast&lt;T&gt;()` are
updated here to `llvm::cast` and similar with the intention that they
can be easily updated after the methods are removed through a
find-replace.

See https://github.com/llvm/llvm-project/compare/main...tpopp:llvm-project:tidy-cast-check
for the clang-tidy check that is used and then update printed
occurrences of the function to include `llvm::` before.

One can then run the following:
```
ninja -C $BUILD_DIR clang-tidy

run-clang-tidy -clang-tidy-binary=$BUILD_DIR/bin/clang-tidy -checks='-*,misc-cast-functions'\
                 -export-fixes /tmp/cast/casts.yaml mlir/*\
                 -header-filter=mlir/ -fix

rm -rf $BUILD_DIR/tools/mlir/**/*.inc
```

Differential Revision: https://reviews.llvm.org/D150348
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The MLIR classes Type/Attribute/Operation/Op/Value support
cast/dyn_cast/isa/dyn_cast_or_null functionality through llvm's doCast
functionality in addition to defining methods with the same name.
This change begins the migration of uses of the method to the
corresponding function call as has been decided as more consistent.

Note that there still exist classes that only define methods directly,
such as AffineExpr, and this does not include work currently to support
a functional cast/isa call.

Context:

* https://mlir.llvm.org/deprecation/ at "Use the free function variants for dyn_cast/cast/isa/…"
* Original discussion at https://discourse.llvm.org/t/preferred-casting-style-going-forward/68443

Implementation:
This follows a previous patch that updated calls
`op.cast&lt;T&gt;()-&gt; cast&lt;T&gt;(op)`. However some cases could not handle an
unprefixed `cast` call due to occurrences of variables named cast, or
occurring inside of class definitions which would resolve to the method.
All C++ files that did not work automatically with `cast&lt;T&gt;()` are
updated here to `llvm::cast` and similar with the intention that they
can be easily updated after the methods are removed through a
find-replace.

See https://github.com/llvm/llvm-project/compare/main...tpopp:llvm-project:tidy-cast-check
for the clang-tidy check that is used and then update printed
occurrences of the function to include `llvm::` before.

One can then run the following:
```
ninja -C $BUILD_DIR clang-tidy

run-clang-tidy -clang-tidy-binary=$BUILD_DIR/bin/clang-tidy -checks='-*,misc-cast-functions'\
                 -export-fixes /tmp/cast/casts.yaml mlir/*\
                 -header-filter=mlir/ -fix

rm -rf $BUILD_DIR/tools/mlir/**/*.inc
```

Differential Revision: https://reviews.llvm.org/D150348
</pre>
</div>
</content>
</entry>
</feed>
