[Mlir-commits] [mlir] [mlir][Vectorizer] Added support to Vectorize tensor.unpack (PR #76087)
Diego Caballero
llvmlistbot at llvm.org
Fri Feb 16 07:40:56 PST 2024
================
@@ -1655,6 +1760,25 @@ isValidMaskedInputVector(ArrayRef<int64_t> shape,
return success();
}
+/// Need to check if the inner-tiles are static/constant.
+static LogicalResult
+vectorizeUnPackOpPrecondition(tensor::UnPackOp unpackOp,
+ ArrayRef<int64_t> inputVectorSizes) {
+
+ if (llvm::any_of(unpackOp.getInnerTiles(), [](OpFoldResult res) {
+ return !getConstantIntValue(res).has_value();
+ })) {
+ LDBG("Inner-tiles must be constant: " << unpackOp << "\n");
+ return failure();
+ }
+ llvm::ArrayRef<int64_t> resultShape = unpackOp.getDestType().getShape();
+ if (inputVectorSizes.empty() == false &&
----------------
dcaballe wrote:
nit: -> `!inputVectorSizes.empty()`? here and in other empty checks.
https://github.com/llvm/llvm-project/pull/76087
More information about the Mlir-commits
mailing list