[Mlir-commits] [mlir] [mlir][Vector] Handle 0-rank case in fold instead of RewriterPattern (PR #130168)

Kunwar Grover llvmlistbot at llvm.org
Mon Mar 24 06:02:11 PDT 2025


================
@@ -2159,13 +2159,11 @@ class ExtractOpFromBroadcast final : public OpRewritePattern<ExtractOp> {
     // folding patterns.
     if (extractResultRank < broadcastSrcRank)
       return failure();
+    // For scalar result, the input can only be a zero-dim vector, which will
+    // be handled by the folder.
----------------
Groverkss wrote:

Replaced zero-dim with rank-0 vector. I like having the reasoning here, in case someone reads it and thinks why we decided to do this.

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


More information about the Mlir-commits mailing list