[Mlir-commits] [mlir] [mlir][vector] Add a check to ensure input vector rank equals target shape rank (PR #127706)

Andrzej Warzyński llvmlistbot at llvm.org
Tue Feb 25 02:56:32 PST 2025


banach-space wrote:

> I was wondering—since we are not emitting any error messages when the conditions fail—whether a diagnostic test like the one in invalid.mlir is required ?

>From what I can tell, your test in invalid.mlir simply covers a case that we are not testing ATM. So it's something that's missing and it's good that you are adding it. Strictly speaking, it's not required for this PR (you have another, more targeted test), but the noise level is low and it's a positive addition. A dedicated note in the summary would be helpful.

Now, since you mentioned a diagnostic, could you replace `return failure()` with `return rewriter.notifyMatchFailure("SOME MSG HERE");`. Note, you won't be able to test it :)


> For the vector-unroll-option case i guess this might work ?
> `// CHECK: %[[R0:.*]] = vector.fma %{{.+}}, %{{.+}}, %{{.+}} : vector<3x2x2xf32>`

You can simplify further (since the actual arguments don't matter here):
> `// CHECK: %[[R0:.*]] = vector.fma %{{.+}} : vector<3x2x2xf32>`

Thanks!

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


More information about the Mlir-commits mailing list