[Mlir-commits] [mlir] [mlir][linalg] Enable masked vectorisation for depthwise convolutions (PR #81625)

Cullen Rhodes llvmlistbot at llvm.org
Wed Mar 6 09:11:52 PST 2024


================
@@ -3371,7 +3465,17 @@ vectorizeConvolution(RewriterBase &rewriter, LinalgOp op,
   res = e.generateNcwPooling();
   if (succeeded(res))
     return res;
-  return e.generateDilatedConv(flatten1DDepthwiseConv);
+
+  uint64_t vecChDimSize = ShapedType::kDynamic;
+  bool vecChDimScalableFlag = false;
+  if (!inputVecSizes.empty()) {
+    // Only use the input vector size corresponding to the channel dim. Other
+    // vector dims will be inferred from the Ops.
+    vecChDimSize = inputVecSizes[2];
+    vecChDimScalableFlag = inputScalableVecDims[2];
----------------
c-rhodes wrote:

I think an assert that checks this is a `depthwise_conv_1d_nwc_wc` would be more appropriate?

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


More information about the Mlir-commits mailing list