diff --git a/mlir/docs/DialectConversion.md b/mlir/docs/DialectConversion.md index 23e74470a835..4f6cb1dec66a 100644 --- a/mlir/docs/DialectConversion.md +++ b/mlir/docs/DialectConversion.md @@ -383,6 +383,11 @@ class TypeConverter { }; ``` +Materializations through the type converter are optional. If the +`ConversionConfig::buildMaterializations` flag is set to "false", the dialect +conversion driver builds an `unrealized_conversion_cast` op instead of calling +the respective type converter callback whenever a materialization is required. + ### Region Signature Conversion From the perspective of type conversion, the types of block arguments are a bit diff --git a/mlir/include/mlir/Transforms/DialectConversion.h b/mlir/include/mlir/Transforms/DialectConversion.h index 5f680e8eca75..65e279e046e8 100644 --- a/mlir/include/mlir/Transforms/DialectConversion.h +++ b/mlir/include/mlir/Transforms/DialectConversion.h @@ -1127,13 +1127,12 @@ struct ConversionConfig { /// If set to "true", the dialect conversion attempts to build source/target/ /// argument materializations through the type converter API in lieu of - /// builtin.unrealized_conversion_cast ops. The conversion process fails if + /// "builtin.unrealized_conversion_cast ops". The conversion process fails if /// at least one materialization could not be built. /// - /// If set to "false", the dialect conversion does not does not build any - /// custom materializations and instead inserts - /// builtin.unrealized_conversion_cast ops to ensure that the resulting IR - /// is valid. + /// If set to "false", the dialect conversion does not build any custom + /// materializations and instead inserts "builtin.unrealized_conversion_cast" + /// ops to ensure that the resulting IR is valid. bool buildMaterializations = true; };