diff --git a/mlir/lib/Conversion/VectorToSCF/VectorToSCF.cpp b/mlir/lib/Conversion/VectorToSCF/VectorToSCF.cpp --- a/mlir/lib/Conversion/VectorToSCF/VectorToSCF.cpp +++ b/mlir/lib/Conversion/VectorToSCF/VectorToSCF.cpp @@ -663,6 +663,12 @@ struct TransferOpConversion : public VectorToSCFPattern { using VectorToSCFPattern::VectorToSCFPattern; + void initialize() { + // This pattern recursively unpacks one dimension at a time. The recursion + // bounded as the rank is strictly decreasing. + this->setHasBoundedRewriteRecursion(); + } + LogicalResult matchAndRewrite(OpTy xferOp, PatternRewriter &rewriter) const override { if (!xferOp->hasAttr(kPassLabel)) @@ -826,6 +832,12 @@ : public VectorToSCFPattern { using VectorToSCFPattern::VectorToSCFPattern; + void initialize() { + // This pattern recursively unpacks one dimension at a time. The recursion + // bounded as the rank is strictly decreasing. + setHasBoundedRewriteRecursion(); + } + /// Return the vector into which the newly created TransferReadOp results /// are inserted. Value getResultVector(TransferReadOp xferOp, @@ -957,6 +969,12 @@ : public VectorToSCFPattern { using VectorToSCFPattern::VectorToSCFPattern; + void initialize() { + // This pattern recursively unpacks one dimension at a time. The recursion + // bounded as the rank is strictly decreasing. + setHasBoundedRewriteRecursion(); + } + /// Return the vector from which newly generated ExtracOps will extract. Value getDataVector(TransferWriteOp xferOp) const { if (auto extractOp = getExtractOp(xferOp))