<feed xmlns='http://www.w3.org/2005/Atom'>
<title>delta/llvm.git/mlir/lib/Bindings/Python/IRCore.cpp, branch EmptyLineAfterFunctionDefinition</title>
<subtitle>github.com: llvm/llvm-project.git
</subtitle>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/llvm.git/'/>
<entry>
<title>[mlir] Replace usages of Identifier with StringAttr</title>
<updated>2021-11-11T02:02:24+00:00</updated>
<author>
<name>River Riddle</name>
<email>riddleriver@gmail.com</email>
</author>
<published>2021-11-11T01:44:58+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/llvm.git/commit/?id=120591e126f97924f665baacea49080642b1162f'/>
<id>120591e126f97924f665baacea49080642b1162f</id>
<content type='text'>
Identifier and StringAttr essentially serve the same purpose, i.e. to hold a string value. Keeping these seemingly identical pieces of functionality separate has caused problems in certain situations:

* Identifier has nice accessors that StringAttr doesn't
* Identifier can't be used as an Attribute, meaning strings are often duplicated between Identifier/StringAttr (e.g. in PDL)

The only thing that Identifier has that StringAttr doesn't is support for caching a dialect that is referenced by the string (e.g. dialect.foo). This functionality is added to StringAttr, as this is useful for StringAttr in generally the same ways it was useful for Identifier.

Differential Revision: https://reviews.llvm.org/D113536
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Identifier and StringAttr essentially serve the same purpose, i.e. to hold a string value. Keeping these seemingly identical pieces of functionality separate has caused problems in certain situations:

* Identifier has nice accessors that StringAttr doesn't
* Identifier can't be used as an Attribute, meaning strings are often duplicated between Identifier/StringAttr (e.g. in PDL)

The only thing that Identifier has that StringAttr doesn't is support for caching a dialect that is referenced by the string (e.g. dialect.foo). This functionality is added to StringAttr, as this is useful for StringAttr in generally the same ways it was useful for Identifier.

Differential Revision: https://reviews.llvm.org/D113536
</pre>
</div>
</content>
</entry>
<entry>
<title>[mlir][python] fix constructor generation for optional operands in presence of segment attribute</title>
<updated>2021-11-05T11:40:27+00:00</updated>
<author>
<name>Alex Zinenko</name>
<email>zinenko@google.com</email>
</author>
<published>2021-11-05T11:05:02+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/llvm.git/commit/?id=6981e5ec91c98a23753d2dae590156107d857fda'/>
<id>6981e5ec91c98a23753d2dae590156107d857fda</id>
<content type='text'>
The ODS-based Python op bindings generator has been generating incorrect
specification of the operand segment in presence if both optional and variadic
operand groups: optional groups were treated as variadic whereas they require
separate treatement. Make sure it is the case. Also harden the tests around
generated op constructors as they could hitherto accept the code for both
optional and variadic arguments.

Reviewed By: nicolasvasilache

Differential Revision: https://reviews.llvm.org/D113259
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The ODS-based Python op bindings generator has been generating incorrect
specification of the operand segment in presence if both optional and variadic
operand groups: optional groups were treated as variadic whereas they require
separate treatement. Make sure it is the case. Also harden the tests around
generated op constructors as they could hitherto accept the code for both
optional and variadic arguments.

Reviewed By: nicolasvasilache

Differential Revision: https://reviews.llvm.org/D113259
</pre>
</div>
</content>
</entry>
<entry>
<title>[mlir][python] Make Operation and Value hashable</title>
<updated>2021-11-03T09:40:03+00:00</updated>
<author>
<name>rkayaith</name>
<email>rkayaith@gmail.com</email>
</author>
<published>2021-11-02T16:04:42+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/llvm.git/commit/?id=f78fe0b7b83842929262f1f05e308efe82fc6ffa'/>
<id>f78fe0b7b83842929262f1f05e308efe82fc6ffa</id>
<content type='text'>
This allows operations and values to be used as dict keys

Reviewed By: ftynse

Differential Revision: https://reviews.llvm.org/D112669
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This allows operations and values to be used as dict keys

Reviewed By: ftynse

Differential Revision: https://reviews.llvm.org/D112669
</pre>
</div>
</content>
</entry>
<entry>
<title>[mlir] provide C API and Python bindings for symbol tables</title>
<updated>2021-11-02T13:22:58+00:00</updated>
<author>
<name>Alex Zinenko</name>
<email>zinenko@google.com</email>
</author>
<published>2021-11-02T11:39:36+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/llvm.git/commit/?id=30d61893fb7bbe364bf25074feaf0b178dac64e6'/>
<id>30d61893fb7bbe364bf25074feaf0b178dac64e6</id>
<content type='text'>
Symbol tables are a largely useful top-level IR construct, for example, they
make it easy to access functions in a module by name instead of traversing the
list of module's operations to find the corresponding function.

Depends On D112886

Reviewed By: mehdi_amini

Differential Revision: https://reviews.llvm.org/D112821
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Symbol tables are a largely useful top-level IR construct, for example, they
make it easy to access functions in a module by name instead of traversing the
list of module's operations to find the corresponding function.

Depends On D112886

Reviewed By: mehdi_amini

Differential Revision: https://reviews.llvm.org/D112821
</pre>
</div>
</content>
</entry>
<entry>
<title>[mlir][python] allow for detaching operations from a block</title>
<updated>2021-10-31T08:42:15+00:00</updated>
<author>
<name>Alex Zinenko</name>
<email>zinenko@google.com</email>
</author>
<published>2021-10-31T08:37:20+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/llvm.git/commit/?id=24685aaeb7371137e74d8290a3cf9c8ad2d544a9'/>
<id>24685aaeb7371137e74d8290a3cf9c8ad2d544a9</id>
<content type='text'>
Provide support for removing an operation from the block that contains it and
moving it back to detached state. This allows for the operation to be moved to
a different block, a common IR manipulation for, e.g., module merging.

Also fix a potential one-past-end iterator dereference in Operation::moveAfter
discovered in the process.

Reviewed By: mehdi_amini

Differential Revision: https://reviews.llvm.org/D112700
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Provide support for removing an operation from the block that contains it and
moving it back to detached state. This allows for the operation to be moved to
a different block, a common IR manipulation for, e.g., module merging.

Also fix a potential one-past-end iterator dereference in Operation::moveAfter
discovered in the process.

Reviewed By: mehdi_amini

Differential Revision: https://reviews.llvm.org/D112700
</pre>
</div>
</content>
</entry>
<entry>
<title>Make Python MLIR Operation not iterable</title>
<updated>2021-10-26T07:21:09+00:00</updated>
<author>
<name>Mehdi Amini</name>
<email>joker.eph@gmail.com</email>
</author>
<published>2021-10-20T19:51:52+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/llvm.git/commit/?id=f431d3878a07a67e544dacb98ad553b6a0b6b25a'/>
<id>f431d3878a07a67e544dacb98ad553b6a0b6b25a</id>
<content type='text'>
The current behavior is conveniently allowing to iterate on the regions of an operation
implicitly by exposing an operation as Iterable. However this is also error prone and
code that may intend to iterate on the results or the operands could end up "working"
apparently instead of throwing a runtime error.
The lack of static type checking in Python contributes to the ambiguity here, it seems
safer to not do this and require and explicit qualification to iterate (`op.results`, `op.regions`, ...).

Reviewed By: ftynse

Differential Revision: https://reviews.llvm.org/D111697
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The current behavior is conveniently allowing to iterate on the regions of an operation
implicitly by exposing an operation as Iterable. However this is also error prone and
code that may intend to iterate on the results or the operands could end up "working"
apparently instead of throwing a runtime error.
The lack of static type checking in Python contributes to the ambiguity here, it seems
safer to not do this and require and explicit qualification to iterate (`op.results`, `op.regions`, ...).

Reviewed By: ftynse

Differential Revision: https://reviews.llvm.org/D111697
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix clang-tidy warnings in MLIR Python bindings (NFC)</title>
<updated>2021-10-19T17:15:20+00:00</updated>
<author>
<name>Mehdi Amini</name>
<email>joker.eph@gmail.com</email>
</author>
<published>2021-10-19T17:13:54+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/llvm.git/commit/?id=e2f16be5991af84e508fcd197bb5deb841aa0dc2'/>
<id>e2f16be5991af84e508fcd197bb5deb841aa0dc2</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>[mlir][python] Add 'loc' property to ops</title>
<updated>2021-10-18T14:01:12+00:00</updated>
<author>
<name>rkayaith</name>
<email>rkayaith@gmail.com</email>
</author>
<published>2021-10-18T14:00:39+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/llvm.git/commit/?id=d5429a13da2b61b356f996a41ea314a1a1ce9076'/>
<id>d5429a13da2b61b356f996a41ea314a1a1ce9076</id>
<content type='text'>
Add a read-only `loc` property to Operation and OpView

Reviewed By: ftynse

Differential Revision: https://reviews.llvm.org/D111972
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Add a read-only `loc` property to Operation and OpView

Reviewed By: ftynse

Differential Revision: https://reviews.llvm.org/D111972
</pre>
</div>
</content>
</entry>
<entry>
<title>[mlir][python] Provide some methods and properties for API completeness</title>
<updated>2021-10-13T12:30:55+00:00</updated>
<author>
<name>Alex Zinenko</name>
<email>zinenko@google.com</email>
</author>
<published>2021-10-11T16:24:48+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/llvm.git/commit/?id=78f2dae00d32504d1f645f74c67bf4340ebcda82'/>
<id>78f2dae00d32504d1f645f74c67bf4340ebcda82</id>
<content type='text'>
When writing the user-facing documentation, I noticed several inconsistencies
and asymmetries in the Python API we provide. Fix them by adding:

- the `owner` property to regions, similarly to blocks;
- the `isinstance` method to any class derived from `PyConcreteAttr`,
  `PyConcreteValue` and `PyConreteAffineExpr`, similar to `PyConcreteType` to
  enable `isa`-like calls without having to handle exceptions;
- a mechanism to create the first block in the region as we could only create
  blocks relative to other blocks, with is impossible in an empty region.

Reviewed By: gysit

Differential Revision: https://reviews.llvm.org/D111556
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When writing the user-facing documentation, I noticed several inconsistencies
and asymmetries in the Python API we provide. Fix them by adding:

- the `owner` property to regions, similarly to blocks;
- the `isinstance` method to any class derived from `PyConcreteAttr`,
  `PyConcreteValue` and `PyConreteAffineExpr`, similar to `PyConcreteType` to
  enable `isa`-like calls without having to handle exceptions;
- a mechanism to create the first block in the region as we could only create
  blocks relative to other blocks, with is impossible in an empty region.

Reviewed By: gysit

Differential Revision: https://reviews.llvm.org/D111556
</pre>
</div>
</content>
</entry>
<entry>
<title>[mlir][python] Expose CallSiteLoc Python side</title>
<updated>2021-10-13T08:25:40+00:00</updated>
<author>
<name>Jacques Pienaar</name>
<email>jpienaar@google.com</email>
</author>
<published>2021-10-13T08:02:12+00:00</published>
<link rel='alternate' type='text/html' href='http://git.baserock.org/cgit/delta/llvm.git/commit/?id=e67cbbef03392edc7f5a0e8bd1f64d798d2cfeef'/>
<id>e67cbbef03392edc7f5a0e8bd1f64d798d2cfeef</id>
<content type='text'>
This exposes creating a CallSiteLoc with a callee &amp; list of frames for
callers. Follows the creation approach in C++ side where a list of
frames may be provided.

Reviewed By: ftynse

Differential Revision: https://reviews.llvm.org/D111670
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This exposes creating a CallSiteLoc with a callee &amp; list of frames for
callers. Follows the creation approach in C++ side where a list of
frames may be provided.

Reviewed By: ftynse

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