-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[mlir][Transforms] Mark 1:N conversion driver as deprecated #121102
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[mlir][Transforms] Mark 1:N conversion driver as deprecated #121102
Conversation
@llvm/pr-subscribers-mlir-scf @llvm/pr-subscribers-mlir-core Author: Matthias Springer (matthias-springer) ChangesDepends on: #121054, #121101 Full diff: https://github.com/llvm/llvm-project/pull/121102.diff 2 Files Affected:
diff --git a/mlir/include/mlir/Dialect/SCF/Transforms/Patterns.h b/mlir/include/mlir/Dialect/SCF/Transforms/Patterns.h
index b87407d302a823..9c1479d28c305f 100644
--- a/mlir/include/mlir/Dialect/SCF/Transforms/Patterns.h
+++ b/mlir/include/mlir/Dialect/SCF/Transforms/Patterns.h
@@ -66,6 +66,10 @@ void populateSCFStructuralTypeConversionTarget(
/// Populates the provided pattern set with patterns that do 1:N type
/// conversions on (some) SCF ops. This is intended to be used with
/// applyPartialOneToNConversion.
+/// FIXME: The 1:N dialect conversion is deprecated and will be removed soon.
+/// 1:N support has been added to the regular dialect conversion driver.
+LLVM_DEPRECATED("Use populateSCFStructuralTypeConversions() instead",
+ "populateSCFStructuralTypeConversions")
void populateSCFStructuralOneToNTypeConversions(
const TypeConverter &typeConverter, RewritePatternSet &patterns);
diff --git a/mlir/include/mlir/Transforms/OneToNTypeConversion.h b/mlir/include/mlir/Transforms/OneToNTypeConversion.h
index 7b4dd65cbff7b2..9c74bf916d971b 100644
--- a/mlir/include/mlir/Transforms/OneToNTypeConversion.h
+++ b/mlir/include/mlir/Transforms/OneToNTypeConversion.h
@@ -6,6 +6,9 @@
//
//===----------------------------------------------------------------------===//
//
+// Note: The 1:N dialect conversion is deprecated and will be removed soon.
+// 1:N support has been added to the regular dialect conversion driver.
+//
// This file provides utils for implementing (poor-man's) dialect conversion
// passes with 1:N type conversions.
//
@@ -119,6 +122,10 @@ class OneToNPatternRewriter : public PatternRewriter {
/// types must be the same as the result types of the op) and the new values
/// (i.e., the converted types must be the same as the types of the new
/// values).
+ /// FIXME: The 1:N dialect conversion is deprecated and will be removed soon.
+ /// 1:N support has been added to the regular dialect conversion driver.
+ LLVM_DEPRECATED("Use replaceOpWithMultiple() instead",
+ "replaceOpWithMultiple")
void replaceOp(Operation *op, ValueRange newValues,
const OneToNTypeMapping &resultMapping);
using PatternRewriter::replaceOp;
@@ -251,6 +258,10 @@ class OneToNOpConversionPattern : public OneToNConversionPattern {
/// or illegal types; the function simply applies the given patterns and does
/// not fail if some ops or types remain unconverted (i.e., the conversion is
/// only "partial").
+/// FIXME: The 1:N dialect conversion is deprecated and will be removed soon.
+/// 1:N support has been added to the regular dialect conversion driver.
+LLVM_DEPRECATED("Use applyPartialConversion() instead",
+ "applyPartialConversion")
LogicalResult
applyPartialOneToNConversion(Operation *op, TypeConverter &typeConverter,
const FrozenRewritePatternSet &patterns);
@@ -259,6 +270,11 @@ applyPartialOneToNConversion(Operation *op, TypeConverter &typeConverter,
/// FunctionOpInterface op with the given type converter. This only supports
/// ops which use FunctionType to represent their type. This is intended to be
/// used with the 1:N dialect conversion.
+/// FIXME: The 1:N dialect conversion is deprecated and will be removed soon.
+/// 1:N support has been added to the regular dialect conversion driver.
+LLVM_DEPRECATED(
+ "Use populateFunctionOpInterfaceTypeConversionPattern() instead",
+ "populateFunctionOpInterfaceTypeConversionPattern")
void populateOneToNFunctionOpInterfaceTypeConversionPattern(
StringRef functionLikeOpName, const TypeConverter &converter,
RewritePatternSet &patterns);
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
@matthias-springer |
|
@matthias-springer We are getting build failures as:
It seems the two (replaceOp and replaceOpWithMultiple) have different ABI. |
The two APIs are slightly different. It is not a 1:1 replacement. It seems like it was not the best idea to mark these functions as "deprecated" while they are still in use in MLIR because of compiler warnings. This PR turns them into comments. (Note: The 1:N conversion framework is still deprecated and I plan to delete it in April 2025.) |
Depends on: #121054, #121101