From: Alex Zinenko Date: Mon, 17 Oct 2022 13:37:09 +0000 (+0000) Subject: [mlir] stopgap for incorrect vector.contract lowering X-Git-Tag: upstream/17.0.6~30361 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4b6447e220fd86d5e45461d4d00593fb91e10880;p=platform%2Fupstream%2Fllvm.git [mlir] stopgap for incorrect vector.contract lowering `vector.contract` is being lowered to the default mul/add contraction regardless if of the kind indicated. Stop the lowering completely in this case until the correct one can be implemented. Reviewed By: springerm, ThomasRaoux Differential Revision: https://reviews.llvm.org/D136079 --- diff --git a/mlir/lib/Dialect/Vector/Transforms/VectorTransforms.cpp b/mlir/lib/Dialect/Vector/Transforms/VectorTransforms.cpp index 570b4b2..0bdaf7b 100644 --- a/mlir/lib/Dialect/Vector/Transforms/VectorTransforms.cpp +++ b/mlir/lib/Dialect/Vector/Transforms/VectorTransforms.cpp @@ -1862,6 +1862,13 @@ ContractionOpLowering::matchAndRewrite(vector::ContractionOp op, op.getRhsType().getElementType() != getElementTypeOrSelf(op.getAccType())) return failure(); + // TODO: the code below assumes the default contraction, make sure it supports + // other kinds before enabling this lowering. + if (op.getKind() != vector::CombiningKind::ADD) { + return rewriter.notifyMatchFailure( + op, "contractions other than 'add' not supported"); + } + // TODO: implement benefits, cost models. MLIRContext *ctx = op.getContext(); ContractionOpToMatmulOpLowering pat1(vectorTransformOptions, ctx);