[Mlir-commits] [mlir] [MLIR][Linalg] Scalable Vectorization of Reduction (PR #97788)
Zhaoshi Zheng
llvmlistbot at llvm.org
Thu Jul 11 10:38:38 PDT 2024
================
@@ -1947,13 +1956,30 @@ vectorizeScalableVectorPrecondition(Operation *op,
if (inputVectorSizes.empty())
return success();
+ auto linalgOp = dyn_cast<LinalgOp>(op);
+ if (linalgOp && isLinalgReduction(linalgOp)) {
+ LDBG("Checking reduce op dims for scalable vectorization\n");
+ auto iteratorTypes = linalgOp.getIteratorTypesArray();
+ assert(iteratorTypes.size() == inputScalableVecDims.size() &&
+ "Number of iterator types and input scalable dims mismatch");
----------------
zhaoshiz wrote:
Oh, I was unsure about size of iterator types array.. and both `inputVectorSizes` and `inputScalableVecDims` are set by user. I guess we can assume the user will ensure correct size of them rather than intentionally break the compiler.
https://github.com/llvm/llvm-project/pull/97788
More information about the Mlir-commits
mailing list