[Mlir-commits] [mlir] [mlir][vector] Add vector.to_elements unrolling (PR #157142)

Erick Ochoa Lopez llvmlistbot at llvm.org
Wed Sep 10 12:06:10 PDT 2025


================
@@ -808,6 +808,28 @@ struct TestUnrollVectorFromElements
   }
 };
 
+struct TestUnrollVectorToElements
+    : public PassWrapper<TestUnrollVectorToElements,
+                         OperationPass<func::FuncOp>> {
+  MLIR_DEFINE_EXPLICIT_INTERNAL_INLINE_TYPE_ID(TestUnrollVectorToElements)
+
+  StringRef getArgument() const final {
+    return "test-unroll-vector-to-elements";
+  }
+  StringRef getDescription() const final {
+    return "Test unrolling patterns for to_elements ops";
+  }
+  void getDependentDialects(DialectRegistry &registry) const override {
+    registry.insert<func::FuncDialect, vector::VectorDialect>();
+  }
+
+  void runOnOperation() override {
+    RewritePatternSet patterns(&getContext());
+    populateVectorToElementsLoweringPatterns(patterns);
+    (void)applyPatternsGreedily(getOperation(), std::move(patterns));
+  }
+};
+
----------------
amd-eochoalo wrote:

https://github.com/llvm/llvm-project/pull/157142/commits/6894af06a787c03f7a72b9d62025d373170e3a88 I am keeping the test pass but also adding the transform dialect op to keep consistency. We can revisit removing these test passes in the future.

https://github.com/llvm/llvm-project/pull/157142


More information about the Mlir-commits mailing list