[Mlir-commits] [mlir] [mlir][Vector] Add support for masks in castAwayContractionLeadingOneDim (PR #81906)

Diego Caballero llvmlistbot at llvm.org
Tue Feb 20 10:31:31 PST 2024


================
@@ -346,6 +349,12 @@ mlir::vector::castAwayContractionLeadingOneDim(vector::ContractionOp contractOp,
   // greedily to drop more.
   int64_t dropDim = 1;
 
+  if (isMasked) {
----------------
dcaballe wrote:

There are some snippets under the comment `Vector mask setup` or similar that doing something like this. I think we should perhaps create a utility for those and define some kind of canonical form to do this at pattern rewrite level. For conversions, the goal when we introduced the mask op was to try to reduce this kind of conditional code and provide some infra to make it as transparent as possible, hence the mask conversion pattern class that we use for LLVM conversion. Let's brainstorm a bit about the different options and see what can be improved in this regard.

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


More information about the Mlir-commits mailing list