[PATCH] D142628: [memref][Transform][NFC] Improve the doc for masked_vectorize

Quentin Colombet via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 26 06:59:09 PST 2023


qcolombet created this revision.
qcolombet added reviewers: dcaballe, nicolasvasilache, rriddle, springerm.
qcolombet added a project: MLIR.
Herald added subscribers: hanchung, Moerafaat, bzcheeseman, sdasgup3, wenzhicui, wrengr, jsetoain, cota, mravishankar, teijeong, rdzhabarov, tatianashp, msifontes, jurahul, Kayjukh, grosul1, Joonsoo, liufengdb, aartbik, mgester, arpith-jacob, antiagainst, shauheen, mehdi_amini, thopre.
Herald added a reviewer: aartbik.
Herald added a project: All.
qcolombet requested review of this revision.
Herald added subscribers: pcwang-thead, limo1996, stephenneuendorffer.

The `transform.structured.masked_vectorize` operator assumes that the
iteration space of the given linalg op is smaller than the given vector
sizes.
Explicitly states this requirement in the description of the operation.

Also fix the related comment and assert message in the vectorization code.
The wording was flipped.

NFC


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D142628

Files:
  mlir/include/mlir/Dialect/Linalg/TransformOps/LinalgTransformOps.td
  mlir/lib/Dialect/Linalg/Transforms/Vectorization.cpp


Index: mlir/lib/Dialect/Linalg/Transforms/Vectorization.cpp
===================================================================
--- mlir/lib/Dialect/Linalg/Transforms/Vectorization.cpp
+++ mlir/lib/Dialect/Linalg/Transforms/Vectorization.cpp
@@ -987,7 +987,7 @@
                  return ShapedType::isDynamic(staticSize) ||
                         staticSize <= inputSize;
                }) &&
-           "Input vector sizes must be smaller or equal than iteration space "
+           "Input vector sizes must be greater than or equal to iteration space "
            "static sizes");
   }
 
@@ -1050,8 +1050,8 @@
 
 /// Emit a suitable vector form for a Linalg op. If provided, `inputVectorSizes`
 /// are used to vectorize this operation. `inputVectorSizes` must match the rank
-/// of the iteration space of the operation and the sizes must be smaller or
-/// equal than their counterpart interation space sizes, if static.
+/// of the iteration space of the operation and the input vector sizes must be
+/// greater than or equal to their counterpart iteration space sizes, if static.
 /// `inputVectorShapes` also allows the vectorization of operations with dynamic
 /// shapes.
 LogicalResult mlir::linalg::vectorize(RewriterBase &rewriter, LinalgOp linalgOp,
Index: mlir/include/mlir/Dialect/Linalg/TransformOps/LinalgTransformOps.td
===================================================================
--- mlir/include/mlir/Dialect/Linalg/TransformOps/LinalgTransformOps.td
+++ mlir/include/mlir/Dialect/Linalg/TransformOps/LinalgTransformOps.td
@@ -1428,6 +1428,12 @@
     SSA values, the handle must be mapped to exactly one payload op with
     exactly one index-typed result.
 
+    Note: The input vector sizes must be bigger than or equal to their
+    counterpart iteration space sizes.
+
+    Typically this operator should be applied to linalg operations that have
+    already be tiled to the appropriate sizes.
+
     #### Return modes:
 
     This operation produces a definite failure if the dynamic vector sizes (SSA


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D142628.492434.patch
Type: text/x-patch
Size: 2041 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230126/4ff44538/attachment.bin>


More information about the llvm-commits mailing list