[Mlir-commits] [mlir] [mlir][Transforms] Dialect Conversion: Simplify block conversion API (PR #94866)
Markus Böck
llvmlistbot at llvm.org
Sat Jun 8 13:20:56 PDT 2024
================
@@ -661,42 +662,38 @@ class ConversionPatternRewriter final : public PatternRewriter {
public:
~ConversionPatternRewriter() override;
- /// Apply a signature conversion to the entry block of the given region. This
- /// replaces the entry block with a new block containing the updated
- /// signature. The new entry block to the region is returned for convenience.
+ /// Apply a signature conversion to given block. This replaces the block with
+ /// a new block containing the updated signature. The operations of the given
+ /// block are inlined into the newly-created block, which is returned.
+ ///
/// If no block argument types are changing, the entry original block will be
/// left in place and returned.
///
- /// If provided, `converter` will be used for any materializations.
+ /// A signature converison must be provided. (Type converters can construct
+ /// signature conversion with `convertBlockSignature`.) Optionally, a type
+ /// converter can be provided to build materializations.
Block *
- applySignatureConversion(Region *region,
+ applySignatureConversion(Block *block,
TypeConverter::SignatureConversion &conversion,
const TypeConverter *converter = nullptr);
- /// Convert the types of block arguments within the given region. This
+ /// Apply a signature conversion to each block in the given region. This
/// replaces each block with a new block containing the updated signature. If
/// an updated signature would match the current signature, the respective
- /// block is left in place as is.
+ /// block is left in place as is. (See `applySignatureConversion` for
+ /// details.) The new entry block of the region is returned.
+ ///
+ /// SignatureConversions are computed with the specified type converter.
+ /// This function returns "failure" if the type converter failed to compute
+ /// a SignatureConversion for at least one block.
///
- /// The entry block may have a special conversion if `entryConversion` is
- /// provided. On success, the new entry block to the region is returned for
- /// convenience. Otherwise, failure is returned.
+ /// Optionally, a special SignatureConversion can be specified for the entry
+ /// block. This is because the types of the entry block arguments are often
+ /// tied semantically to details on the operation.
----------------
zero9178 wrote:
```suggestion
/// tied semantically to the operation.
```
nit
https://github.com/llvm/llvm-project/pull/94866
More information about the Mlir-commits
mailing list