<feed xmlns='http://www.w3.org/2005/Atom'>
<title>llvm-project.git/mlir/lib/Dialect/Vector/IR/VectorOps.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][Vector] Add unroll pattern for vector.shape_cast (#167738)</title>
<updated>2025-11-20T00:16:44+00:00</updated>
<author>
<name>Nishant Patel</name>
<email>nishant.b.patel@intel.com</email>
</author>
<published>2025-11-20T00:16:44+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=af73aeaa19929127655d544b48a5145105e9e28c'/>
<id>af73aeaa19929127655d544b48a5145105e9e28c</id>
<content type='text'>
This PR adds pattern for unrolling shape_cast given a targetShape. This
PR is a follow up of #164010 which was very general and was using
inserts and extracts on each element (which is also
LowerVectorShapeCast.cpp is doing).
After doing some more research on use cases, we (me and @Jianhui-Li )
realized that the previous version in #164010 is unnecessarily generic
and doesn't fit our performance needs.

Our use case requires that targetShape is contiguous in both source and
result vector.

This pattern only applies when contiguous slices can be extracted from
the source vector and inserted into the result vector such that each
slice remains in vector form with targetShape (and not decompose to
scalars). In these cases, the unrolling proceeds as:

vector.extract_strided_slice -&gt; vector.shape_cast (on the slice
unrolled) -&gt; vector.insert_strided_slice</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This PR adds pattern for unrolling shape_cast given a targetShape. This
PR is a follow up of #164010 which was very general and was using
inserts and extracts on each element (which is also
LowerVectorShapeCast.cpp is doing).
After doing some more research on use cases, we (me and @Jianhui-Li )
realized that the previous version in #164010 is unnecessarily generic
and doesn't fit our performance needs.

Our use case requires that targetShape is contiguous in both source and
result vector.

This pattern only applies when contiguous slices can be extracted from
the source vector and inserted into the result vector such that each
slice remains in vector form with targetShape (and not decompose to
scalars). In these cases, the unrolling proceeds as:

vector.extract_strided_slice -&gt; vector.shape_cast (on the slice
unrolled) -&gt; vector.insert_strided_slice</pre>
</div>
</content>
</entry>
<entry>
<title>[MLIR] Extend vector.scatter to accept tensor as base (#165548)</title>
<updated>2025-11-14T19:56:24+00:00</updated>
<author>
<name>Ryutaro Okada</name>
<email>140468571+sakupan102@users.noreply.github.com</email>
</author>
<published>2025-11-14T19:56:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=7e7ea9c5357efcdf9ba6bd7ea3669e607a9af400'/>
<id>7e7ea9c5357efcdf9ba6bd7ea3669e607a9af400</id>
<content type='text'>
This PR makes the following improvements to `vector.scatter` and its
lowering pipeline:
- In addition to `memref`, accept a ranked `tensor` as the base operand
of `vector.scatter`, similar to `vector.transfer_write`.
- Implement bufferization support for `vector.scatter`, so that
tensor-based scatter ops can be fully lowered to memref-based forms.

It's worth to complete the functionality of map_scatter decomposition.
Full discussion can be found here:
https://github.com/iree-org/iree/issues/21135

---------

Signed-off-by: Ryutaro Okada &lt;1015ryu88@gmail.com&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This PR makes the following improvements to `vector.scatter` and its
lowering pipeline:
- In addition to `memref`, accept a ranked `tensor` as the base operand
of `vector.scatter`, similar to `vector.transfer_write`.
- Implement bufferization support for `vector.scatter`, so that
tensor-based scatter ops can be fully lowered to memref-based forms.

It's worth to complete the functionality of map_scatter decomposition.
Full discussion can be found here:
https://github.com/iree-org/iree/issues/21135

---------

Signed-off-by: Ryutaro Okada &lt;1015ryu88@gmail.com&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>[MLIR][Affine] Extend getVectorReductionOp to support xor/maxnumf/minnumf (#163310)</title>
<updated>2025-11-04T04:52:51+00:00</updated>
<author>
<name>Lee Wei</name>
<email>lee10202013@gmail.com</email>
</author>
<published>2025-11-04T04:52:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=993a38fa539d23f83711a0e07d3cc40a0947ec7e'/>
<id>993a38fa539d23f83711a0e07d3cc40a0947ec7e</id>
<content type='text'>
This PR extends the `getVectorReductionOp` function, which is used by
the affine vectorizer, to also recognize and support
`xor/maxnumf/minnumf` reduction operations.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This PR extends the `getVectorReductionOp` function, which is used by
the affine vectorizer, to also recognize and support
`xor/maxnumf/minnumf` reduction operations.</pre>
</div>
</content>
</entry>
<entry>
<title>[mlir][vector] Fix missed `return` in ExtractStridedSliceOp::fold (#165669)</title>
<updated>2025-10-31T08:43:25+00:00</updated>
<author>
<name>Haocong Lu</name>
<email>haoconglu@qq.com</email>
</author>
<published>2025-10-31T08:43:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=37cf1fc62c8d95bc2b7487ef1302dc472606d66e'/>
<id>37cf1fc62c8d95bc2b7487ef1302dc472606d66e</id>
<content type='text'>
Fix missed `return` when folding splat ConstantOp, it could work well
probably because of good compatibility of
`foldExtractStridedSliceNonSplatConstant`.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fix missed `return` when folding splat ConstantOp, it could work well
probably because of good compatibility of
`foldExtractStridedSliceNonSplatConstant`.</pre>
</div>
</content>
</entry>
<entry>
<title>[MLIR] [Vector] Added canonicalizer for folding from_elements + transpose (#161841)</title>
<updated>2025-10-21T08:39:57+00:00</updated>
<author>
<name>Keshav Vinayak Jha</name>
<email>31160700+keshavvinayak01@users.noreply.github.com</email>
</author>
<published>2025-10-21T08:39:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=00092f9bdd1d5037a5f4c8f3059e31e32aee6e8d'/>
<id>00092f9bdd1d5037a5f4c8f3059e31e32aee6e8d</id>
<content type='text'>
## Description
Adds a new canonicalizer that folds
`vector.from_elements(vector.transpose))` =&gt; `vector.from_elements`.
This canonicalization reorders the input elements for
`vector.from_elements`, adjusts the output shape to match the effect of
the transpose op and eliminating its need.

## Testing
Added a 2D vector lit test that verifies the working of the rewrite.

---------

Signed-off-by: Keshav Vinayak Jha &lt;keshavvinayakjha@gmail.com&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
## Description
Adds a new canonicalizer that folds
`vector.from_elements(vector.transpose))` =&gt; `vector.from_elements`.
This canonicalization reorders the input elements for
`vector.from_elements`, adjusts the output shape to match the effect of
the transpose op and eliminating its need.

## Testing
Added a 2D vector lit test that verifies the working of the rewrite.

---------

Signed-off-by: Keshav Vinayak Jha &lt;keshavvinayakjha@gmail.com&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>[mlir][Vector] Fold vector.step compared to constant (#161615)</title>
<updated>2025-10-15T15:40:30+00:00</updated>
<author>
<name>James Newling</name>
<email>james.newling@gmail.com</email>
</author>
<published>2025-10-15T15:40:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=bea77ed52e2d714a9f1a836673733dc5f44a29e3'/>
<id>bea77ed52e2d714a9f1a836673733dc5f44a29e3</id>
<content type='text'>
This PR adds a canonicalizer to vector.step that folds vector.step iff
the result of the fold is a splat value. An alternative would be to
always constant fold it, but that might result in some very
large/cumbersome constants.

I do wonder if vector.step might be better represented as some sort of
attribute in the arith dialect, like %step = arith.constant iota&lt;32&gt; :
vector&lt;32xindex&gt;.

---------

Signed-off-by: James Newling &lt;james.newling@gmail.com&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This PR adds a canonicalizer to vector.step that folds vector.step iff
the result of the fold is a splat value. An alternative would be to
always constant fold it, but that might result in some very
large/cumbersome constants.

I do wonder if vector.step might be better represented as some sort of
attribute in the arith dialect, like %step = arith.constant iota&lt;32&gt; :
vector&lt;32xindex&gt;.

---------

Signed-off-by: James Newling &lt;james.newling@gmail.com&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>[mlir] Use llvm accumulate wrappers. NFCI. (#162957)</title>
<updated>2025-10-11T15:33:18+00:00</updated>
<author>
<name>Jakub Kuderski</name>
<email>jakub@nod-labs.com</email>
</author>
<published>2025-10-11T15:33:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=0820266651649c0eb6c384df91da4c6f662e5136'/>
<id>0820266651649c0eb6c384df91da4c6f662e5136</id>
<content type='text'>
Use wrappers around `std::accumulate` to make the code more concise and
less bug-prone: https://github.com/llvm/llvm-project/pull/162129.

With `std::accumulate`, it's the initial value that determines the
accumulator type. `llvm::sum_of` and `llvm::product_of` pick the right
accumulator type based on the range element type.

Found some funny bugs like a local accumulate helper that calculated a
sum with initial value of 1 -- we didn't hit the bug because the code
was actually dead...</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Use wrappers around `std::accumulate` to make the code more concise and
less bug-prone: https://github.com/llvm/llvm-project/pull/162129.

With `std::accumulate`, it's the initial value that determines the
accumulator type. `llvm::sum_of` and `llvm::product_of` pick the right
accumulator type based on the range element type.

Found some funny bugs like a local accumulate helper that calculated a
sum with initial value of 1 -- we didn't hit the bug because the code
was actually dead...</pre>
</div>
</content>
</entry>
<entry>
<title>[MLIR][Vector] Remove vector.splat (#162167)</title>
<updated>2025-10-10T16:58:18+00:00</updated>
<author>
<name>James Newling</name>
<email>james.newling@gmail.com</email>
</author>
<published>2025-10-10T16:58:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=ea291d0e8c93d47d7953eff5ca1048891a5fcc55'/>
<id>ea291d0e8c93d47d7953eff5ca1048891a5fcc55</id>
<content type='text'>
vector.splat has been deprecated (user: please use the very similar vector.broadcast instead) 
with the last PR landing about 6 weeks ago.

The discourse discussion is at
https://discourse.llvm.org/t/rfc-mlir-vector-deprecate-then-remove-vector-splat/87143/1
The last PR was #152230

This PR completely removes vector.splat. In addition to removing vector.splat from VectorOps.td, it

- Updates the few remaining places where vector::SplatOp is created (now vector::BroadcastOp is created)
- Removes temporary patterns where vector.splat is replaced by vector.broadcast

The only place 'vector.splat' appears is now the files

https://github.com/llvm/llvm-project/blob/main/mlir/utils/tree-sitter-mlir/test/corpus/op.txt
 and

https://github.com/llvm/llvm-project/blob/main/mlir/utils/tree-sitter-mlir/dialect/vector.js

---------

Signed-off-by: James Newling &lt;james.newling@gmail.com&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
vector.splat has been deprecated (user: please use the very similar vector.broadcast instead) 
with the last PR landing about 6 weeks ago.

The discourse discussion is at
https://discourse.llvm.org/t/rfc-mlir-vector-deprecate-then-remove-vector-splat/87143/1
The last PR was #152230

This PR completely removes vector.splat. In addition to removing vector.splat from VectorOps.td, it

- Updates the few remaining places where vector::SplatOp is created (now vector::BroadcastOp is created)
- Removes temporary patterns where vector.splat is replaced by vector.broadcast

The only place 'vector.splat' appears is now the files

https://github.com/llvm/llvm-project/blob/main/mlir/utils/tree-sitter-mlir/test/corpus/op.txt
 and

https://github.com/llvm/llvm-project/blob/main/mlir/utils/tree-sitter-mlir/dialect/vector.js

---------

Signed-off-by: James Newling &lt;james.newling@gmail.com&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>[MLIR][Vector] Added ToElementsOp::fold for broadcast-&gt;to_elements pattern rewrite. (#160318)</title>
<updated>2025-10-08T12:13:46+00:00</updated>
<author>
<name>Keshav Vinayak Jha</name>
<email>31160700+keshavvinayak01@users.noreply.github.com</email>
</author>
<published>2025-10-08T12:13:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=805451faedabf0e227b51683d43ebe3093115e58'/>
<id>805451faedabf0e227b51683d43ebe3093115e58</id>
<content type='text'>
Adds `::fold` for the new `vector.to_elements` op, folding `broadcast`
into `to_elements` or no-op wherever possible.

---------

Signed-off-by: keshavvinayak01 &lt;keshavvinayakjha@gmail.com&gt;
Signed-off-by: Keshav Vinayak Jha &lt;keshavvinayakjha@gmail.com&gt;
Co-authored-by: Jakub Kuderski &lt;kubakuderski@gmail.com&gt;</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Adds `::fold` for the new `vector.to_elements` op, folding `broadcast`
into `to_elements` or no-op wherever possible.

---------

Signed-off-by: keshavvinayak01 &lt;keshavvinayakjha@gmail.com&gt;
Signed-off-by: Keshav Vinayak Jha &lt;keshavvinayakjha@gmail.com&gt;
Co-authored-by: Jakub Kuderski &lt;kubakuderski@gmail.com&gt;</pre>
</div>
</content>
</entry>
<entry>
<title>[mlir][vector] Simplify op rewrite pattern inheriting constructors. NFC. (#161670)</title>
<updated>2025-10-02T23:07:25+00:00</updated>
<author>
<name>Jakub Kuderski</name>
<email>jakub@nod-labs.com</email>
</author>
<published>2025-10-02T23:07:25+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=3960ff6ca03b0441087f9042850199583d9e11d2'/>
<id>3960ff6ca03b0441087f9042850199583d9e11d2</id>
<content type='text'>
Use the `Base` type alias from
https://github.com/llvm/llvm-project/pull/158433.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Use the `Base` type alias from
https://github.com/llvm/llvm-project/pull/158433.</pre>
</div>
</content>
</entry>
</feed>
