<feed xmlns='http://www.w3.org/2005/Atom'>
<title>llvm-project.git/mlir/lib/Conversion/SCFToSPIRV/SCFToSPIRV.cpp, branch users/koachan/spr/main.sparcias-enable-parseforallfeatures-in-matchoperandparserimpl</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>[mlir][Transforms] Dialect Conversion: Simplify block conversion API (#94866)</title>
<updated>2024-06-10T19:49:52+00:00</updated>
<author>
<name>Matthias Springer</name>
<email>me@m-sp.org</email>
</author>
<published>2024-06-10T19:49:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=52050f3ff388773b9345d421d968a7d1ee880531'/>
<id>52050f3ff388773b9345d421d968a7d1ee880531</id>
<content type='text'>
This commit simplifies and improves documentation for the part of the
`ConversionPatternRewriter` API that deals with signature conversions.

There are now two public functions for signature conversion:
* `applySignatureConversion` converts a single block signature. This
function used to take a `Region *` (but converted only the entry block).
It now takes a `Block *`.
* `convertRegionTypes` converts all block signatures of a region.

`convertNonEntryRegionTypes` is removed because it is not widely used
and can easily be expressed with a call to `applySignatureConversion`
inside a loop. (See `Detensorize.cpp` for an example.)

Note: For consistency, `convertRegionTypes` could be renamed to
`applySignatureConversion` (overload) in the future. (Or
`applySignatureConversion` renamed to `convertBlockTypes`.)

Also clarify when a type converter and/or signature conversion object is
needed and for what purpose.

Internal code refactoring (NFC) of `ConversionPatternRewriterImpl` (the
part that deals with signature conversions). This part of the codebase
was quite convoluted and unintuitive.

From a functional perspective, this change is NFC. However, the public
API changes, thus not marking as NFC.

Note for LLVM integration: When you see
`applySignatureConversion(region, ...)`, replace with
`applySignatureConversion(region-&gt;front(), ...)`. In the unlikely case
that you see `convertNonEntryRegionTypes`, apply the same changes as
this commit did to `Detensorize.cpp`.

---------

Co-authored-by: Markus Böck &lt;markus.boeck02@gmail.com&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This commit simplifies and improves documentation for the part of the
`ConversionPatternRewriter` API that deals with signature conversions.

There are now two public functions for signature conversion:
* `applySignatureConversion` converts a single block signature. This
function used to take a `Region *` (but converted only the entry block).
It now takes a `Block *`.
* `convertRegionTypes` converts all block signatures of a region.

`convertNonEntryRegionTypes` is removed because it is not widely used
and can easily be expressed with a call to `applySignatureConversion`
inside a loop. (See `Detensorize.cpp` for an example.)

Note: For consistency, `convertRegionTypes` could be renamed to
`applySignatureConversion` (overload) in the future. (Or
`applySignatureConversion` renamed to `convertBlockTypes`.)

Also clarify when a type converter and/or signature conversion object is
needed and for what purpose.

Internal code refactoring (NFC) of `ConversionPatternRewriterImpl` (the
part that deals with signature conversions). This part of the codebase
was quite convoluted and unintuitive.

From a functional perspective, this change is NFC. However, the public
API changes, thus not marking as NFC.

Note for LLVM integration: When you see
`applySignatureConversion(region, ...)`, replace with
`applySignatureConversion(region-&gt;front(), ...)`. In the unlikely case
that you see `convertNonEntryRegionTypes`, apply the same changes as
this commit did to `Detensorize.cpp`.

---------

Co-authored-by: Markus Böck &lt;markus.boeck02@gmail.com&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>[mlir] Use `OpBuilder::createBlock` in op builders and patterns (#82770)</title>
<updated>2024-02-24T08:10:07+00:00</updated>
<author>
<name>Matthias Springer</name>
<email>me@m-sp.org</email>
</author>
<published>2024-02-24T08:10:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=91d5653e3ae9742f7fb847f809b534ee128501b0'/>
<id>91d5653e3ae9742f7fb847f809b534ee128501b0</id>
<content type='text'>
When creating a new block in (conversion) rewrite patterns,
`OpBuilder::createBlock` must be used. Otherwise, no
`notifyBlockInserted` notification is sent to the listener.

Note: The dialect conversion relies on listener notifications to keep
track of IR modifications. Creating blocks without the builder API can
lead to memory leaks during rollback.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When creating a new block in (conversion) rewrite patterns,
`OpBuilder::createBlock` must be used. Otherwise, no
`notifyBlockInserted` notification is sent to the listener.

Note: The dialect conversion relies on listener notifications to keep
track of IR modifications. Creating blocks without the builder API can
lead to memory leaks during rollback.</pre>
</div>
</content>
</entry>
<entry>
<title>[MLIR][NFC] Fix build on recent GCC with C++20 enabled (#73308)</title>
<updated>2023-11-24T12:13:39+00:00</updated>
<author>
<name>Alexander Batashev</name>
<email>alexbatashev@gmail.com</email>
</author>
<published>2023-11-24T12:13:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=a4ee55fe6ea088f55bf44236bd05f6a847a3de6c'/>
<id>a4ee55fe6ea088f55bf44236bd05f6a847a3de6c</id>
<content type='text'>
The following pattern fails on recent GCC versions with -std=c++20 flag
passed and succeeds with -std=c++17. Such behavior is not observed on
Clang 16.0.

```
template &lt;typename T&gt;
struct Foo {
    Foo&lt;T&gt;(int a) {}
};
```

This patch removes template parameter from constructor in two occurences
to make the following command complete successfully:
bazel build -c fastbuild --cxxopt=-std=c++20 --host_cxxopt=-std=c++20
@llvm-project//mlir/...

This patch is similar to https://reviews.llvm.org/D154782

Co-authored-by: Alexander Batashev &lt;a.batashev@partner.samsung.com&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The following pattern fails on recent GCC versions with -std=c++20 flag
passed and succeeds with -std=c++17. Such behavior is not observed on
Clang 16.0.

```
template &lt;typename T&gt;
struct Foo {
    Foo&lt;T&gt;(int a) {}
};
```

This patch removes template parameter from constructor in two occurences
to make the following command complete successfully:
bazel build -c fastbuild --cxxopt=-std=c++20 --host_cxxopt=-std=c++20
@llvm-project//mlir/...

This patch is similar to https://reviews.llvm.org/D154782

Co-authored-by: Alexander Batashev &lt;a.batashev@partner.samsung.com&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>[mlir][spirv] SCFToSPIRV: fix WhileOp block args types conversion (#68588)</title>
<updated>2023-10-10T12:01:18+00:00</updated>
<author>
<name>Ivan Butygin</name>
<email>ivan.butygin@gmail.com</email>
</author>
<published>2023-10-10T12:01:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=0c21dfdf1263bad26e09fe4232fcea01a69693ab'/>
<id>0c21dfdf1263bad26e09fe4232fcea01a69693ab</id>
<content type='text'>
WhileOp before/after block args types weren't converted, resulting in
invalid IR.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
WhileOp before/after block args types weren't converted, resulting in
invalid IR.</pre>
</div>
</content>
</entry>
<entry>
<title>[mlir][Interfaces] `LoopLikeOpInterface`: Support ops with multiple regions (#66754)</title>
<updated>2023-09-19T15:35:38+00:00</updated>
<author>
<name>Matthias Springer</name>
<email>me@m-sp.org</email>
</author>
<published>2023-09-19T15:35:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=9b5ef2bea8e3de8fd564ab74b8123b446883216f'/>
<id>9b5ef2bea8e3de8fd564ab74b8123b446883216f</id>
<content type='text'>
This commit implements `LoopLikeOpInterface` on `scf.while`. This
enables LICM (and potentially other transforms) on `scf.while`.

`LoopLikeOpInterface::getLoopBody()` is renamed to `getLoopRegions` and
can now return multiple regions.

Also fix a bug in the default implementation of
`LoopLikeOpInterface::isDefinedOutsideOfLoop()`, which returned "false"
for some values that are defined outside of the loop (in a nested op, in
such a way that the value does not dominate the loop). This interface is
currently only used for LICM and there is no way to trigger this bug, so
no test is added.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This commit implements `LoopLikeOpInterface` on `scf.while`. This
enables LICM (and potentially other transforms) on `scf.while`.

`LoopLikeOpInterface::getLoopBody()` is renamed to `getLoopRegions` and
can now return multiple regions.

Also fix a bug in the default implementation of
`LoopLikeOpInterface::isDefinedOutsideOfLoop()`, which returned "false"
for some values that are defined outside of the loop (in a nested op, in
such a way that the value does not dominate the loop). This interface is
currently only used for LICM and there is no way to trigger this bug, so
no test is added.</pre>
</div>
</content>
</entry>
<entry>
<title>[mlir][spirv] Fix scf.yield pattern conversion</title>
<updated>2023-03-14T22:47:34+00:00</updated>
<author>
<name>Jakub Kuderski</name>
<email>kubak@google.com</email>
</author>
<published>2023-03-14T22:47:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=dfee4c7fb0fb02cf05e9a16b7fe058557f33eb15'/>
<id>dfee4c7fb0fb02cf05e9a16b7fe058557f33eb15</id>
<content type='text'>
Only rewrite `scf.yield` when the parent op is supported by
scf-to-spirv.

Fixes: #61380, #61107, #61148

Reviewed By: antiagainst

Differential Revision: https://reviews.llvm.org/D146080
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Only rewrite `scf.yield` when the parent op is supported by
scf-to-spirv.

Fixes: #61380, #61107, #61148

Reviewed By: antiagainst

Differential Revision: https://reviews.llvm.org/D146080
</pre>
</div>
</content>
</entry>
<entry>
<title>[mlir][spirv][NFC] Clean up scf-to-spirv pass</title>
<updated>2023-03-14T22:44:35+00:00</updated>
<author>
<name>Jakub Kuderski</name>
<email>kubak@google.com</email>
</author>
<published>2023-03-14T22:35:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=ab5eae01646e2a83356ec8fe300bf727dadc87dd'/>
<id>ab5eae01646e2a83356ec8fe300bf727dadc87dd</id>
<content type='text'>
This is a clean up before fixing issues identified in this pass by
https://github.com/llvm/llvm-project/issues/61380 and similar issues.

- Move patterns definitions closer to declarations.
- Simplify pattern definitions.
- Drop hand-written pass constructor in favor of an auto-generated on.
- Fix typos in pass description.

Reviewed By: antiagainst

Differential Revision: https://reviews.llvm.org/D146077
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This is a clean up before fixing issues identified in this pass by
https://github.com/llvm/llvm-project/issues/61380 and similar issues.

- Move patterns definitions closer to declarations.
- Simplify pattern definitions.
- Drop hand-written pass constructor in favor of an auto-generated on.
- Fix typos in pass description.

Reviewed By: antiagainst

Differential Revision: https://reviews.llvm.org/D146077
</pre>
</div>
</content>
</entry>
<entry>
<title>[mlir][spirv] Account for type conversion failures in scf-to-spirv</title>
<updated>2023-01-09T16:35:47+00:00</updated>
<author>
<name>Jakub Kuderski</name>
<email>kubak@google.com</email>
</author>
<published>2023-01-09T16:35:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=80d5400d924e543c5420f4e924f5818313605e99'/>
<id>80d5400d924e543c5420f4e924f5818313605e99</id>
<content type='text'>
Fixes: https://github.com/llvm/llvm-project/issues/59136

Reviewed By: antiagainst

Differential Revision: https://reviews.llvm.org/D141292
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fixes: https://github.com/llvm/llvm-project/issues/59136

Reviewed By: antiagainst

Differential Revision: https://reviews.llvm.org/D141292
</pre>
</div>
</content>
</entry>
<entry>
<title>[mlir] Use std::nullopt instead of None (NFC)</title>
<updated>2022-12-04T02:50:27+00:00</updated>
<author>
<name>Kazu Hirata</name>
<email>kazu@google.com</email>
</author>
<published>2022-12-04T02:50:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=1a36588ec64ae8576e531e6f0b49eadb90ab0b11'/>
<id>1a36588ec64ae8576e531e6f0b49eadb90ab0b11</id>
<content type='text'>
This patch mechanically replaces None with std::nullopt where the
compiler would warn if None were deprecated.  The intent is to reduce
the amount of manual work required in migrating from Optional to
std::optional.

This is part of an effort to migrate from llvm::Optional to
std::optional:

https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch mechanically replaces None with std::nullopt where the
compiler would warn if None were deprecated.  The intent is to reduce
the amount of manual work required in migrating from Optional to
std::optional.

This is part of an effort to migrate from llvm::Optional to
std::optional:

https://discourse.llvm.org/t/deprecating-llvm-optional-x-hasvalue-getvalue-getvalueor/63716
</pre>
</div>
</content>
</entry>
<entry>
<title>[mlir][spirv] Change dialect name from 'spv' to 'spirv'</title>
<updated>2022-09-26T14:58:30+00:00</updated>
<author>
<name>Jakub Kuderski</name>
<email>kubak@google.com</email>
</author>
<published>2022-09-26T14:58:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=5ab6ef758f0f549fb39bf9b34a6a743e989b212a'/>
<id>5ab6ef758f0f549fb39bf9b34a6a743e989b212a</id>
<content type='text'>
Tested with `check-mlir` and `check-mlir-integration`.

Issue: https://github.com/llvm/llvm-project/issues/56863

Reviewed By: antiagainst

Differential Revision: https://reviews.llvm.org/D134620
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Tested with `check-mlir` and `check-mlir-integration`.

Issue: https://github.com/llvm/llvm-project/issues/56863

Reviewed By: antiagainst

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