[Mlir-commits] [mlir] [MLIR][VectorToLLVM] Handle scalable dim in createVectorLengthValue() (PR #93361)
Zhaoshi Zheng
llvmlistbot at llvm.org
Wed May 29 12:59:09 PDT 2024
================
@@ -532,9 +532,19 @@ static Value createVectorLengthValue(ConversionPatternRewriter &rewriter,
auto vShape = vType.getShape();
assert(vShape.size() == 1 && "Unexpected multi-dim vector type");
- return rewriter.create<LLVM::ConstantOp>(
+ Value vLen = rewriter.create<LLVM::ConstantOp>(
loc, rewriter.getI32Type(),
rewriter.getIntegerAttr(rewriter.getI32Type(), vShape[0]));
+
+ if (!vType.getScalableDims()[0])
+ return vLen;
+
+ // Create VScale*vShape[0] and return it as vector length.
----------------
zhaoshiz wrote:
Changed to `vScale * baseVecLength`, refering to actual variable names in code.
https://github.com/llvm/llvm-project/pull/93361
More information about the Mlir-commits
mailing list