diff options
Diffstat (limited to 'mlir/docs/DialectConversion.md')
| -rw-r--r-- | mlir/docs/DialectConversion.md | 30 |
1 files changed, 17 insertions, 13 deletions
diff --git a/mlir/docs/DialectConversion.md b/mlir/docs/DialectConversion.md index a355d5a90e4d..69781bb868bb 100644 --- a/mlir/docs/DialectConversion.md +++ b/mlir/docs/DialectConversion.md @@ -372,19 +372,23 @@ class TypeConverter { From the perspective of type conversion, the types of block arguments are a bit special. Throughout the conversion process, blocks may move between regions of different operations. Given this, the conversion of the types for blocks must be -done explicitly via a conversion pattern. To convert the types of block -arguments within a Region, a custom hook on the `ConversionPatternRewriter` must -be invoked; `convertRegionTypes`. This hook uses a provided type converter to -apply type conversions to all blocks within a given region, and all blocks that -move into that region. As noted above, the conversions performed by this method -use the argument materialization hook on the `TypeConverter`. This hook also -takes an optional `TypeConverter::SignatureConversion` parameter that applies a -custom conversion to the entry block of the region. The types of the entry block -arguments are often tied semantically to details on the operation, e.g. func::FuncOp, -AffineForOp, etc. To convert the signature of just the region entry block, and -not any other blocks within the region, the `applySignatureConversion` hook may -be used instead. A signature conversion, `TypeConverter::SignatureConversion`, -can be built programmatically: +done explicitly via a conversion pattern. + +To convert the types of block arguments within a Region, a custom hook on the +`ConversionPatternRewriter` must be invoked; `convertRegionTypes`. This hook +uses a provided type converter to apply type conversions to all blocks of a +given region. As noted above, the conversions performed by this method use the +argument materialization hook on the `TypeConverter`. This hook also takes an +optional `TypeConverter::SignatureConversion` parameter that applies a custom +conversion to the entry block of the region. The types of the entry block +arguments are often tied semantically to the operation, e.g., +`func::FuncOp`, `AffineForOp`, etc. + +To convert the signature of just one given block, the +`applySignatureConversion` hook can be used. + +A signature conversion, `TypeConverter::SignatureConversion`, can be built +programmatically: ```c++ class SignatureConversion { |
