diff --git a/mlir/include/mlir/Transforms/GreedyPatternRewriteDriver.h b/mlir/include/mlir/Transforms/GreedyPatternRewriteDriver.h --- a/mlir/include/mlir/Transforms/GreedyPatternRewriteDriver.h +++ b/mlir/include/mlir/Transforms/GreedyPatternRewriteDriver.h @@ -139,17 +139,6 @@ GreedyRewriteConfig config = GreedyRewriteConfig(), bool *changed = nullptr, bool *allErased = nullptr); -/// Applies the specified patterns on `op` while also trying to fold it. -/// This function is a shortcut for the ArrayRef overload and -/// behaves the same way. -inline LogicalResult -applyOpPatternsAndFold(Operation *op, const FrozenRewritePatternSet &patterns, - GreedyRewriteConfig config = GreedyRewriteConfig(), - bool *erased = nullptr) { - return applyOpPatternsAndFold(ArrayRef(op), patterns, config, - /*changed=*/nullptr, erased); -} - } // namespace mlir #endif // MLIR_TRANSFORMS_GREEDYPATTERNREWRITEDRIVER_H_ diff --git a/mlir/lib/Dialect/Affine/Utils/LoopUtils.cpp b/mlir/lib/Dialect/Affine/Utils/LoopUtils.cpp --- a/mlir/lib/Dialect/Affine/Utils/LoopUtils.cpp +++ b/mlir/lib/Dialect/Affine/Utils/LoopUtils.cpp @@ -324,7 +324,8 @@ GreedyRewriteConfig config; config.strictMode = GreedyRewriteStrictness::ExistingOps; bool erased; - (void)applyOpPatternsAndFold(res, std::move(patterns), config, &erased); + (void)applyOpPatternsAndFold(res.getOperation(), std::move(patterns), + config, /*changed=*/nullptr, &erased); if (!erased && !prologue) prologue = res; if (!erased) diff --git a/mlir/lib/Dialect/Affine/Utils/Utils.cpp b/mlir/lib/Dialect/Affine/Utils/Utils.cpp --- a/mlir/lib/Dialect/Affine/Utils/Utils.cpp +++ b/mlir/lib/Dialect/Affine/Utils/Utils.cpp @@ -417,7 +417,8 @@ GreedyRewriteConfig config; config.strictMode = GreedyRewriteStrictness::ExistingOps; bool erased; - (void)applyOpPatternsAndFold(ifOp, frozenPatterns, config, &erased); + (void)applyOpPatternsAndFold(ifOp.getOperation(), frozenPatterns, config, + /*changed=*/nullptr, &erased); if (erased) { if (folded) *folded = true;