[Mlir-commits] [mlir] [MLIR] Allowing unsupported conv2d op to fail gracefully from vectorization (PR #130181)
Zhuoran Yin
llvmlistbot at llvm.org
Tue Mar 11 07:38:28 PDT 2025
================
@@ -3125,58 +3225,32 @@ bool isSupportedPoolKind(vector::CombiningKind kind) {
/// kw is unrolled, w is unrolled iff dilationW > 1.
struct Conv1DGenerator
: public StructuredGenerator<LinalgOp, utils::IteratorType> {
- Conv1DGenerator(RewriterBase &rewriter, LinalgOp linalgOp, int strideW,
- int dilationW)
- : StructuredGenerator<LinalgOp, utils::IteratorType>(rewriter, linalgOp),
- strideW(strideW), dilationW(dilationW) {
- // Determine whether `linalgOp` can be generated with this generator
- if (linalgOp.getNumDpsInputs() != 2 || linalgOp.getNumDpsInits() != 1)
- return;
+ Conv1DGenerator(RewriterBase &rewriter, LinalgOp linalgOp)
+ : StructuredGenerator<LinalgOp, utils::IteratorType>(rewriter, linalgOp) {
+
lhsShaped = linalgOp.getDpsInputOperand(0)->get();
rhsShaped = linalgOp.getDpsInputOperand(1)->get();
resShaped = linalgOp.getDpsInitOperand(0)->get();
lhsShapedType = dyn_cast<ShapedType>(lhsShaped.getType());
rhsShapedType = dyn_cast<ShapedType>(rhsShaped.getType());
resShapedType = dyn_cast<ShapedType>(resShaped.getType());
----------------
jerryyin wrote:
Those are all member variables, please refer to:
https://github.com/llvm/llvm-project/blob/2ef5555f82feb9f8dbaa1cac04cfc25013c0d16f/mlir/lib/Dialect/Linalg/Transforms/Vectorization.cpp#L3906-L3907
I'd be tempted to get rid of those too because those are a lot of state to track. I'm refraining myself from doing it to control the amount of refactor in this PR.
https://github.com/llvm/llvm-project/pull/130181
More information about the Mlir-commits
mailing list