[all-commits] [llvm/llvm-project] 61e82f: [mlir][Transforms][NFC] Turn block type convertion...
Matthias Springer via All-commits
all-commits at lists.llvm.org
Fri Feb 16 07:17:24 PST 2024
Branch: refs/heads/users/matthias-springer/block_type_conversion
Home: https://github.com/llvm/llvm-project
Commit: 61e82f6ab048ddca789a4e20e6b56781915157bf
https://github.com/llvm/llvm-project/commit/61e82f6ab048ddca789a4e20e6b56781915157bf
Author: Matthias Springer <springerm at google.com>
Date: 2024-02-16 (Fri, 16 Feb 2024)
Changed paths:
M mlir/lib/Transforms/Utils/DialectConversion.cpp
Log Message:
-----------
[mlir][Transforms][NFC] Turn block type convertion into `IRRewrite`
This commit is a refactoring of the dialect conversion. The dialect conversion maintains a list of "IR rewrites" that can be commited (upon success) or rolled back (upon failure).
Until now, the signature conversion of a block was only a "partial" IR rewrite. Rollbacks were triggered via `BlockTypeConversionRewrite::rollback`, but there was no `BlockTypeConversionRewrite::commit` equivalent.
Overview of changes:
* Remove `ArgConverter`, an internal helper class that kept track of all block type conversions. There is now a separate `BlockTypeConversionRewrite` for each block type conversion.
* No more special handling for block type conversions. They are now normal "IR rewrites", just like "block creation" or "block movement". In particular, trigger "commits" of block type conversion via `BlockTypeConversionRewrite::commit`.
* Remove `ArgConverter::notifyOpRemoved`. This function was used to inform the `ArgConverter` that an operation was erased, to prevent a double-free of operations in certain situations. It would be unpractical to add a `notifyOpRemoved` API to `IRRewrite`. Instead, erasing ops/block should go through a new `SingleEraseRewriter` (that is owned by the `ConversionPatternRewriterImpl`) if there is chance of double-free. This rewriter ignores `eraseOp`/`eraseBlock` if the op/block was already freed.
BEGIN_PUBLIC
No public commit message needed for presubmit.
END_PUBLIC
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list