[Mlir-commits] [mlir] [mlir][NFC] Remove unused deprecated API wrappers (PR #182715)
Vladimir Miloserdov
llvmlistbot at llvm.org
Sat Feb 21 17:48:59 PST 2026
https://github.com/miloserdow created https://github.com/llvm/llvm-project/pull/182715
Remove deprecated functions and constructors that have zero callers in the monorepo: `applyPatternsAndFoldGreedily`, `applyOpPatternsAndFold`, `NamedAttrList(std::nullopt_t)`, and `OpPrintingFlags(std::nullopt_t)`.
These had FIXME comments requesting their removal.
>From 2956ea92001d6ac2556b927a915b63bb47f2bc3a Mon Sep 17 00:00:00 2001
From: Vladimir Miloserdov <milosvova at gmail.com>
Date: Sun, 22 Feb 2026 01:31:34 +0000
Subject: [PATCH] [mlir][NFC] Remove unused deprecated API wrappers
Remove deprecated functions and constructors that have zero callers in
the monorepo: `applyPatternsAndFoldGreedily`, `applyOpPatternsAndFold`,
`NamedAttrList(std::nullopt_t)`, and `OpPrintingFlags(std::nullopt_t)`.
These had FIXME comments requesting their removal.
---
mlir/include/mlir/IR/OperationSupport.h | 4 --
.../Transforms/GreedyPatternRewriteDriver.h | 37 -------------------
2 files changed, 41 deletions(-)
diff --git a/mlir/include/mlir/IR/OperationSupport.h b/mlir/include/mlir/IR/OperationSupport.h
index 1ff7c56ddca38..79b929ff85e55 100644
--- a/mlir/include/mlir/IR/OperationSupport.h
+++ b/mlir/include/mlir/IR/OperationSupport.h
@@ -802,8 +802,6 @@ class NamedAttrList {
using size_type = size_t;
NamedAttrList() : dictionarySorted({}, true) {}
- LLVM_DEPRECATED("Use NamedAttrList() instead", "NamedAttrList()")
- NamedAttrList(std::nullopt_t none) : NamedAttrList() {}
NamedAttrList(ArrayRef<NamedAttribute> attributes);
NamedAttrList(DictionaryAttr attributes);
NamedAttrList(const_iterator inStart, const_iterator inEnd);
@@ -1176,8 +1174,6 @@ class alignas(8) OperandStorage {
class OpPrintingFlags {
public:
OpPrintingFlags();
- LLVM_DEPRECATED("Use OpPrintingFlags() instead", "OpPrintingFlags()")
- OpPrintingFlags(std::nullopt_t) : OpPrintingFlags() {}
/// Enables the elision of large elements attributes by printing a lexically
/// valid but otherwise meaningless form instead of the element data. The
diff --git a/mlir/include/mlir/Transforms/GreedyPatternRewriteDriver.h b/mlir/include/mlir/Transforms/GreedyPatternRewriteDriver.h
index 45e61b68f5db2..d56d7e58c35f9 100644
--- a/mlir/include/mlir/Transforms/GreedyPatternRewriteDriver.h
+++ b/mlir/include/mlir/Transforms/GreedyPatternRewriteDriver.h
@@ -177,18 +177,6 @@ LogicalResult
applyPatternsGreedily(Region ®ion, const FrozenRewritePatternSet &patterns,
GreedyRewriteConfig config = GreedyRewriteConfig(),
bool *changed = nullptr);
-/// Same as `applyPatternsAndGreedily` above with folding.
-/// FIXME: Remove this once transition to above is completed.
-LLVM_DEPRECATED("Use applyPatternsGreedily() instead", "applyPatternsGreedily")
-inline LogicalResult
-applyPatternsAndFoldGreedily(Region ®ion,
- const FrozenRewritePatternSet &patterns,
- GreedyRewriteConfig config = GreedyRewriteConfig(),
- bool *changed = nullptr) {
- config.enableFolding();
- return applyPatternsGreedily(region, patterns, config, changed);
-}
-
/// Rewrite ops nested under the given operation, which must be isolated from
/// above, by repeatedly applying the highest benefit patterns in a greedy
/// worklist driven manner until a fixpoint is reached.
@@ -229,18 +217,6 @@ applyPatternsGreedily(Operation *op, const FrozenRewritePatternSet &patterns,
*changed = anyRegionChanged;
return failure(failed);
}
-/// Same as `applyPatternsGreedily` above with folding.
-/// FIXME: Remove this once transition to above is complieted.
-LLVM_DEPRECATED("Use applyPatternsGreedily() instead", "applyPatternsGreedily")
-inline LogicalResult
-applyPatternsAndFoldGreedily(Operation *op,
- const FrozenRewritePatternSet &patterns,
- GreedyRewriteConfig config = GreedyRewriteConfig(),
- bool *changed = nullptr) {
- config.enableFolding();
- return applyPatternsGreedily(op, patterns, config, changed);
-}
-
/// Rewrite the specified ops by repeatedly applying the highest benefit
/// patterns in a greedy worklist driven manner until a fixpoint is reached.
///
@@ -274,19 +250,6 @@ applyOpPatternsGreedily(ArrayRef<Operation *> ops,
const FrozenRewritePatternSet &patterns,
GreedyRewriteConfig config = GreedyRewriteConfig(),
bool *changed = nullptr, bool *allErased = nullptr);
-/// Same as `applyOpPatternsGreedily` with folding.
-/// FIXME: Remove this once transition to above is complieted.
-LLVM_DEPRECATED("Use applyOpPatternsGreedily() instead",
- "applyOpPatternsGreedily")
-inline LogicalResult
-applyOpPatternsAndFold(ArrayRef<Operation *> ops,
- const FrozenRewritePatternSet &patterns,
- GreedyRewriteConfig config = GreedyRewriteConfig(),
- bool *changed = nullptr, bool *allErased = nullptr) {
- config.enableFolding();
- return applyOpPatternsGreedily(ops, patterns, config, changed, allErased);
-}
-
} // namespace mlir
#endif // MLIR_TRANSFORMS_GREEDYPATTERNREWRITEDRIVER_H_
More information about the Mlir-commits
mailing list