[Mlir-commits] [mlir] [mlir] Add vector.{to_elements, from_elements} unrolling to `unrollVectorsInFuncBodies` (PR #159118)
Jakub Kuderski
llvmlistbot at llvm.org
Tue Sep 16 09:19:30 PDT 2025
================
@@ -1495,6 +1495,8 @@ LogicalResult mlir::spirv::unrollVectorsInFuncBodies(Operation *op) {
RewritePatternSet patterns(context);
auto options = vector::UnrollVectorOptions().setNativeShapeFn(
[](auto op) { return mlir::spirv::getNativeVectorShape(op); });
+ vector::populateVectorFromElementsLoweringPatterns(patterns);
+ vector::populateVectorToElementsLoweringPatterns(patterns);
populateVectorUnrollPatterns(patterns, options);
----------------
kuhar wrote:
> At the moment, I opted not to add them there because the initial vector.from_elements pattern was not added there. (When I wrote the vector.to_elements pattern I tried to be consistent with vector.from_elements and therefore vector.to_elements was also not added to populateVectorUnrollPatterns.
That's probably only by omission -- I think these belong in `populateVectorUnrollPatterns`
https://github.com/llvm/llvm-project/pull/159118
More information about the Mlir-commits
mailing list