Skip to content

Commit 23e3cbb

Browse files
[mlir][Transforms] Delete 1:N dialect conversion driver (#121389)
The 1:N dialect conversion driver has been deprecated. Use the regular dialect conversion driver instead. This commit deletes the 1:N dialect conversion driver. Note for LLVM integration: If you are already using the regular dialect conversion, but still have argument materializations in your code base, simply delete all `addArgumentMaterialization` calls. For details, see https://discourse.llvm.org/t/rfc-merging-1-1-and-1-n-dialect-conversions/82513.
1 parent f9c01b5 commit 23e3cbb

File tree

23 files changed

+4
-1801
lines changed

23 files changed

+4
-1801
lines changed

mlir/include/mlir/Dialect/Func/Transforms/OneToNFuncConversions.h

-26
This file was deleted.

mlir/include/mlir/Dialect/SCF/Transforms/Patterns.h

-9
Original file line numberDiff line numberDiff line change
@@ -63,15 +63,6 @@ void populateSCFStructuralTypeConversions(const TypeConverter &typeConverter,
6363
void populateSCFStructuralTypeConversionTarget(
6464
const TypeConverter &typeConverter, ConversionTarget &target);
6565

66-
/// Populates the provided pattern set with patterns that do 1:N type
67-
/// conversions on (some) SCF ops. This is intended to be used with
68-
/// applyPartialOneToNConversion.
69-
/// FIXME: The 1:N dialect conversion is deprecated and will be removed soon.
70-
/// 1:N support has been added to the regular dialect conversion driver.
71-
/// Use populateSCFStructuralTypeConversions() instead.
72-
void populateSCFStructuralOneToNTypeConversions(
73-
const TypeConverter &typeConverter, RewritePatternSet &patterns);
74-
7566
/// Populate patterns for SCF software pipelining transformation. See the
7667
/// ForLoopPipeliningPattern for the transformation details.
7768
void populateSCFLoopPipeliningPatterns(RewritePatternSet &patterns,

mlir/include/mlir/Dialect/SPIRV/Transforms/SPIRVConversion.h

-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
#include "mlir/Dialect/Vector/Transforms/VectorRewritePatterns.h"
2121
#include "mlir/Transforms/DialectConversion.h"
2222
#include "mlir/Transforms/GreedyPatternRewriteDriver.h"
23-
#include "mlir/Transforms/OneToNTypeConversion.h"
2423
#include "llvm/ADT/SmallSet.h"
2524
#include "llvm/Support/LogicalResult.h"
2625

mlir/include/mlir/Transforms/DialectConversion.h

-20
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,11 @@ class TypeConverter {
4545
// Copy the registered conversions, but not the caches
4646
TypeConverter(const TypeConverter &other)
4747
: conversions(other.conversions),
48-
argumentMaterializations(other.argumentMaterializations),
4948
sourceMaterializations(other.sourceMaterializations),
5049
targetMaterializations(other.targetMaterializations),
5150
typeAttributeConversions(other.typeAttributeConversions) {}
5251
TypeConverter &operator=(const TypeConverter &other) {
5352
conversions = other.conversions;
54-
argumentMaterializations = other.argumentMaterializations;
5553
sourceMaterializations = other.sourceMaterializations;
5654
targetMaterializations = other.targetMaterializations;
5755
typeAttributeConversions = other.typeAttributeConversions;
@@ -180,21 +178,6 @@ class TypeConverter {
180178
/// can be a TypeRange; in that case, the function must return a
181179
/// SmallVector<Value>.
182180

183-
/// This method registers a materialization that will be called when
184-
/// converting (potentially multiple) block arguments that were the result of
185-
/// a signature conversion of a single block argument, to a single SSA value
186-
/// with the old block argument type.
187-
///
188-
/// Note: Argument materializations are used only with the 1:N dialect
189-
/// conversion driver. The 1:N dialect conversion driver will be removed soon
190-
/// and so will be argument materializations.
191-
template <typename FnT, typename T = typename llvm::function_traits<
192-
std::decay_t<FnT>>::template arg_t<1>>
193-
void addArgumentMaterialization(FnT &&callback) {
194-
argumentMaterializations.emplace_back(
195-
wrapMaterialization<T>(std::forward<FnT>(callback)));
196-
}
197-
198181
/// This method registers a materialization that will be called when
199182
/// converting a replacement value back to its original source type.
200183
/// This is used when some uses of the original value persist beyond the main
@@ -322,8 +305,6 @@ class TypeConverter {
322305
/// generating a cast sequence of some kind. See the respective
323306
/// `add*Materialization` for more information on the context for these
324307
/// methods.
325-
Value materializeArgumentConversion(OpBuilder &builder, Location loc,
326-
Type resultType, ValueRange inputs) const;
327308
Value materializeSourceConversion(OpBuilder &builder, Location loc,
328309
Type resultType, ValueRange inputs) const;
329310
Value materializeTargetConversion(OpBuilder &builder, Location loc,
@@ -510,7 +491,6 @@ class TypeConverter {
510491
SmallVector<ConversionCallbackFn, 4> conversions;
511492

512493
/// The list of registered materialization functions.
513-
SmallVector<MaterializationCallbackFn, 2> argumentMaterializations;
514494
SmallVector<MaterializationCallbackFn, 2> sourceMaterializations;
515495
SmallVector<TargetMaterializationCallbackFn, 2> targetMaterializations;
516496

mlir/include/mlir/Transforms/OneToNTypeConversion.h

-285
This file was deleted.

mlir/lib/Dialect/Func/Transforms/CMakeLists.txt

-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
add_mlir_dialect_library(MLIRFuncTransforms
22
DuplicateFunctionElimination.cpp
33
FuncConversions.cpp
4-
OneToNFuncConversions.cpp
54

65
ADDITIONAL_HEADER_DIRS
76
${MLIR_MAIN_INCLUDE_DIR}/mlir/Dialect/Func/Transforms

0 commit comments

Comments
 (0)