<feed xmlns='http://www.w3.org/2005/Atom'>
<title>llvm-project.git/mlir/lib/Dialect/SCF/Transforms/TileUsingInterface.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>[mlir][SCF] Add `scf::tileAndFuseConsumer` that tiles a consumer into a given tiled loop nest. (#167634)</title>
<updated>2025-11-20T22:13:57+00:00</updated>
<author>
<name>MaheshRavishankar</name>
<email>1663364+MaheshRavishankar@users.noreply.github.com</email>
</author>
<published>2025-11-20T22:13:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=dbeda4f4199de87c7ecd8dabcc1c58944a7a37ad'/>
<id>dbeda4f4199de87c7ecd8dabcc1c58944a7a37ad</id>
<content type='text'>
The existing `scf::tileAndFuseConsumerOfSlices` takes a list of slices
(and loops they are part of), tries to find the consumer of these slices
(all slices are expected to be the same consumer), and then tiles the
consumer into the loop nest using the `TilingInterface`. A more natural
way of doing consumer fusion is to just start from the consumer, look
for operands that are produced by the loop nest passed in as `loops`
(presumably these loops are generated by tiling, but that is not a
requirement for consumer fusion). Using the consumer you can find the
slices of the operands that are accessed within the loop which you can
then use to tile and fuse the consumer (using `TilingInterface`). This
handles more naturally the case where multiple operands of the consumer
come from the loop nest.

The `scf::tileAndFuseConsumerOfSlices` was implemented as a mirror of
`scf::tileAndFuseProducerOfSlice`. For the latter, the slice has a
single producer for the source of the slice, which makes it a natural
way of specifying producer fusion. But for consumers, the result might
have multiple users, resulting in multiple candidates for fusion, as
well as a fusion candidate using multiple results from the tiled loop
nest. This means using slices
(`tensor.insert_slice`/`tensor.parallel_insert_slice`) as a hook for
consumer fusion turns out to be quite hard to navigate. The use of the
consumer directly avoids all those pain points. In time the
`scf::tileAndFuseConsumerOfSlices` should be deprecated in favor of
`scf::tileAndFuseConsumer`. There is a lot of tech-debt that has
accumulated in `scf::tileAndFuseConsumerOfSlices` that needs to be
cleanedup. So while that gets cleaned up, and required functionality is
moved to `scf::tileAndFuseConsumer`, the old path is still maintained.

The test for `scf::tileAndFuseConsumerUsingSlices` is copied to
`tile-and-fuse-consumer.mlir` to
`tile-and-fuse-consumer-using-slices.mlir`. All the tests that were
there in this file are now using the `tileAndFuseConsumer` method. The
test op `test.tile_and_fuse_consumer` is modified to call
`scf::tileAndFuseConsumer`, while a new op
`test.tile_and_fuse_consumer_of_slice` is used to keep the old path
tested while it is deprecated.

---------

Signed-off-by: MaheshRavishankar &lt;mahesh.ravishankar@gmail.com&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The existing `scf::tileAndFuseConsumerOfSlices` takes a list of slices
(and loops they are part of), tries to find the consumer of these slices
(all slices are expected to be the same consumer), and then tiles the
consumer into the loop nest using the `TilingInterface`. A more natural
way of doing consumer fusion is to just start from the consumer, look
for operands that are produced by the loop nest passed in as `loops`
(presumably these loops are generated by tiling, but that is not a
requirement for consumer fusion). Using the consumer you can find the
slices of the operands that are accessed within the loop which you can
then use to tile and fuse the consumer (using `TilingInterface`). This
handles more naturally the case where multiple operands of the consumer
come from the loop nest.

The `scf::tileAndFuseConsumerOfSlices` was implemented as a mirror of
`scf::tileAndFuseProducerOfSlice`. For the latter, the slice has a
single producer for the source of the slice, which makes it a natural
way of specifying producer fusion. But for consumers, the result might
have multiple users, resulting in multiple candidates for fusion, as
well as a fusion candidate using multiple results from the tiled loop
nest. This means using slices
(`tensor.insert_slice`/`tensor.parallel_insert_slice`) as a hook for
consumer fusion turns out to be quite hard to navigate. The use of the
consumer directly avoids all those pain points. In time the
`scf::tileAndFuseConsumerOfSlices` should be deprecated in favor of
`scf::tileAndFuseConsumer`. There is a lot of tech-debt that has
accumulated in `scf::tileAndFuseConsumerOfSlices` that needs to be
cleanedup. So while that gets cleaned up, and required functionality is
moved to `scf::tileAndFuseConsumer`, the old path is still maintained.

The test for `scf::tileAndFuseConsumerUsingSlices` is copied to
`tile-and-fuse-consumer.mlir` to
`tile-and-fuse-consumer-using-slices.mlir`. All the tests that were
there in this file are now using the `tileAndFuseConsumer` method. The
test op `test.tile_and_fuse_consumer` is modified to call
`scf::tileAndFuseConsumer`, while a new op
`test.tile_and_fuse_consumer_of_slice` is used to keep the old path
tested while it is deprecated.

---------

Signed-off-by: MaheshRavishankar &lt;mahesh.ravishankar@gmail.com&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>[mlir] Simplify unreachable type switch cases. NFC. (#162032)</title>
<updated>2025-10-06T13:23:25+00:00</updated>
<author>
<name>Jakub Kuderski</name>
<email>jakub@nod-labs.com</email>
</author>
<published>2025-10-06T13:23:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=8bab6c4e8c4f9a7b32ac5dd94436922c84705a86'/>
<id>8bab6c4e8c4f9a7b32ac5dd94436922c84705a86</id>
<content type='text'>
Use `DefaultUnreachable` from
https://github.com/llvm/llvm-project/pull/161970.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Use `DefaultUnreachable` from
https://github.com/llvm/llvm-project/pull/161970.</pre>
</div>
</content>
</entry>
<entry>
<title>[MLIR][SCF] Add loops as parameter to LoopTerminator callback when using CustomOp. (#161386)</title>
<updated>2025-09-30T16:46:05+00:00</updated>
<author>
<name>sebvince</name>
<email>115461989+sebvince@users.noreply.github.com</email>
</author>
<published>2025-09-30T16:46:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=178651ac872f4ca3b2d77e0ff6ff87e83a066f6f'/>
<id>178651ac872f4ca3b2d77e0ff6ff87e83a066f6f</id>
<content type='text'>
This PR adds to the generateLoopTerminatorFn callback the loops
generated by GenerateLoopHeaderFn. This is needed to correctly set the
insertion point with scf.forall ops.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This PR adds to the generateLoopTerminatorFn callback the loops
generated by GenerateLoopHeaderFn. This is needed to correctly set the
insertion point with scf.forall ops.</pre>
</div>
</content>
</entry>
<entry>
<title>[mlir][SCF] Allow using a custom operation to generate loops with `mlir::tileUsingSCF`. (#159660)</title>
<updated>2025-09-22T22:20:02+00:00</updated>
<author>
<name>MaheshRavishankar</name>
<email>1663364+MaheshRavishankar@users.noreply.github.com</email>
</author>
<published>2025-09-22T22:20:02+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=fa19a57b87a93dabba41a6bdd2b544ef71706253'/>
<id>fa19a57b87a93dabba41a6bdd2b544ef71706253</id>
<content type='text'>
This change adds an option to use a custom operation to generate the
inter-tile loops during tiling. When the loop type is set to
scf::SCFTilingOptions::LoopType::CustomOp, the method
mlir::tileUsingSCF provides two callback functions

First one to generate the header of the loop.
Second one to generate the terminator of the loop.
These methods receive the information needed to generate the
loops/terminator and expect to return information needed to generate
the code for the intra-tile computation. See comments for more
details.

Presently this is adds support only for tiling. Subsequent commits
will update this to add support for fusion as well.

The PR is split into two commits.

The first commit is an NFC that just refactors the code (and cleans up
some naming) to make it easier to add the support for custom loop
operations.
The second commit adds the support for using a custom loop operation, as
well as a test to exercise this path.

Note that this is duplicate of
https://github.com/llvm/llvm-project/pull/159506 that was accidently
committed and was reverted in
https://github.com/llvm/llvm-project/pull/159598 to wait for reviews.

Signed-off-by: MaheshRavishankar
[mahesh.ravishankar@gmail.com](mailto:mahesh.ravishankar@gmail.com)

---------

Signed-off-by: MaheshRavishankar &lt;mahesh.ravishankar@gmail.com&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This change adds an option to use a custom operation to generate the
inter-tile loops during tiling. When the loop type is set to
scf::SCFTilingOptions::LoopType::CustomOp, the method
mlir::tileUsingSCF provides two callback functions

First one to generate the header of the loop.
Second one to generate the terminator of the loop.
These methods receive the information needed to generate the
loops/terminator and expect to return information needed to generate
the code for the intra-tile computation. See comments for more
details.

Presently this is adds support only for tiling. Subsequent commits
will update this to add support for fusion as well.

The PR is split into two commits.

The first commit is an NFC that just refactors the code (and cleans up
some naming) to make it easier to add the support for custom loop
operations.
The second commit adds the support for using a custom loop operation, as
well as a test to exercise this path.

Note that this is duplicate of
https://github.com/llvm/llvm-project/pull/159506 that was accidently
committed and was reverted in
https://github.com/llvm/llvm-project/pull/159598 to wait for reviews.

Signed-off-by: MaheshRavishankar
[mahesh.ravishankar@gmail.com](mailto:mahesh.ravishankar@gmail.com)

---------

Signed-off-by: MaheshRavishankar &lt;mahesh.ravishankar@gmail.com&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>[mlir][scf] Modify the return logic of generateLoopNestUsingForOp (NFC) (#159394)</title>
<updated>2025-09-22T16:40:54+00:00</updated>
<author>
<name>lonely eagle</name>
<email>2020382038@qq.com</email>
</author>
<published>2025-09-22T16:40:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=a25eda2bec2de8a611b014d4473e7dace2bcf975'/>
<id>a25eda2bec2de8a611b014d4473e7dace2bcf975</id>
<content type='text'>
When loops is empty, avoid executing yieldTiledValuesFn and Add a test
which all tile sizes are set to zero.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When loops is empty, avoid executing yieldTiledValuesFn and Add a test
which all tile sizes are set to zero.</pre>
</div>
</content>
</entry>
<entry>
<title>Revert "[mlir][SCF] Allow using a custom operation to generate loops with `mlir::tileUsingSCF`." (#159598)</title>
<updated>2025-09-18T21:52:29+00:00</updated>
<author>
<name>MaheshRavishankar</name>
<email>1663364+MaheshRavishankar@users.noreply.github.com</email>
</author>
<published>2025-09-18T21:52:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=cfaf23927c6b083646a431eb8eea2d286694c0a0'/>
<id>cfaf23927c6b083646a431eb8eea2d286694c0a0</id>
<content type='text'>
Reverts llvm/llvm-project#159506

It was committed by accident. Reverting it for reviews.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Reverts llvm/llvm-project#159506

It was committed by accident. Reverting it for reviews.</pre>
</div>
</content>
</entry>
<entry>
<title>[mlir][SCF] Allow using a custom operation to generate loops with `mlir::tileUsingSCF`. (#159506)</title>
<updated>2025-09-18T16:28:44+00:00</updated>
<author>
<name>MaheshRavishankar</name>
<email>1663364+MaheshRavishankar@users.noreply.github.com</email>
</author>
<published>2025-09-18T16:28:44+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=b8649098a7fcf598406d8d8b7d68891d1444e9c8'/>
<id>b8649098a7fcf598406d8d8b7d68891d1444e9c8</id>
<content type='text'>
This change adds an option to use a custom operation to generate the
inter-tile loops during tiling. When the loop type is set to
`scf::SCFTilingOptions::LoopType::CustomOp`, the method
`mlir::tileUsingSCF` provides two callback functions

1. First one to generate the header of the loop.
2. Second one to generate the terminator of the loop.

These methods receive the information needed to generate the
loops/terminator and expect to return information needed to generate
the code for the intra-tile computation. See comments for more
details.

Presently this is adds support only for tiling. Subsequent commits
will update this to add support for fusion as well.

The PR is split into two commits.
1) The first commit is an NFC that just refactors the code (and cleans
up some naming) to make it easier to add the support for custom loop
operations.
2) The second commit adds the support for using a custom loop operation,
as well as a test to exercise this path.

Signed-off-by: MaheshRavishankar &lt;mahesh.ravishankar@gmail.com&gt;

---------

Signed-off-by: MaheshRavishankar &lt;mahesh.ravishankar@gmail.com&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This change adds an option to use a custom operation to generate the
inter-tile loops during tiling. When the loop type is set to
`scf::SCFTilingOptions::LoopType::CustomOp`, the method
`mlir::tileUsingSCF` provides two callback functions

1. First one to generate the header of the loop.
2. Second one to generate the terminator of the loop.

These methods receive the information needed to generate the
loops/terminator and expect to return information needed to generate
the code for the intra-tile computation. See comments for more
details.

Presently this is adds support only for tiling. Subsequent commits
will update this to add support for fusion as well.

The PR is split into two commits.
1) The first commit is an NFC that just refactors the code (and cleans
up some naming) to make it easier to add the support for custom loop
operations.
2) The second commit adds the support for using a custom loop operation,
as well as a test to exercise this path.

Signed-off-by: MaheshRavishankar &lt;mahesh.ravishankar@gmail.com&gt;

---------

Signed-off-by: MaheshRavishankar &lt;mahesh.ravishankar@gmail.com&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>[mlir][scf] Expose isPerfectlyNestedForLoops (#152115)</title>
<updated>2025-08-26T08:05:19+00:00</updated>
<author>
<name>Shay Kleiman</name>
<email>42376404+shay-kl@users.noreply.github.com</email>
</author>
<published>2025-08-26T08:05:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=0cbb6e7d6c30c4dd4d395941d332b0249088f9ff'/>
<id>0cbb6e7d6c30c4dd4d395941d332b0249088f9ff</id>
<content type='text'>
The function `isPerfectlyNestedForLoops` is useful on its own and so I'm
exposing it for downstream use.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The function `isPerfectlyNestedForLoops` is useful on its own and so I'm
exposing it for downstream use.</pre>
</div>
</content>
</entry>
<entry>
<title>[mlir][SCF] `scf.for`: Add support for unsigned integer comparison (#153379)</title>
<updated>2025-08-15T08:59:14+00:00</updated>
<author>
<name>Matthias Springer</name>
<email>me@m-sp.org</email>
</author>
<published>2025-08-15T08:59:14+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=21b607adbeb4326c10f899fb293d057ee1199794'/>
<id>21b607adbeb4326c10f899fb293d057ee1199794</id>
<content type='text'>
Add a new unit attribute to allow for unsigned integer comparison.

Example:
```mlir
scf.for unsigned %iv_32 = %lb_32 to %ub_32 step %step_32 : i32 {
  // body
}
```

Discussion:
https://discourse.llvm.org/t/scf-should-scf-for-support-unsigned-comparison/84655</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Add a new unit attribute to allow for unsigned integer comparison.

Example:
```mlir
scf.for unsigned %iv_32 = %lb_32 to %ub_32 step %step_32 : i32 {
  // body
}
```

Discussion:
https://discourse.llvm.org/t/scf-should-scf-for-support-unsigned-comparison/84655</pre>
</div>
</content>
</entry>
<entry>
<title>[mlir][NFC] update `mlir/Dialect` create APIs (20/n) (#149927)</title>
<updated>2025-07-24T12:09:58+00:00</updated>
<author>
<name>Maksim Levental</name>
<email>maksim.levental@gmail.com</email>
</author>
<published>2025-07-24T12:09:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=588845defd09359a8b87db339b563af848cf45a7'/>
<id>588845defd09359a8b87db339b563af848cf45a7</id>
<content type='text'>
See https://github.com/llvm/llvm-project/pull/147168 for more info.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
See https://github.com/llvm/llvm-project/pull/147168 for more info.</pre>
</div>
</content>
</entry>
</feed>
