[Mlir-commits] [mlir] c5972da - [mlir][Transforms] Dialect Conversion: Simplify block-inline handling (#145308)
llvmlistbot at llvm.org
llvmlistbot at llvm.org
Mon Jun 23 23:52:17 PDT 2025
Author: Matthias Springer
Date: 2025-06-24T08:52:13+02:00
New Revision: c5972da34a08e5568e2b14e4c6f82c86e25a452a
URL: https://github.com/llvm/llvm-project/commit/c5972da34a08e5568e2b14e4c6f82c86e25a452a
DIFF: https://github.com/llvm/llvm-project/commit/c5972da34a08e5568e2b14e4c6f82c86e25a452a.diff
LOG: [mlir][Transforms] Dialect Conversion: Simplify block-inline handling (#145308)
When a block is getting inlined, the destination block does not have to
be legalized. That's because the signature of the destination block does
not change by inlining.
This commit makes the implementation consistent with this comment:
```
// If the pattern moved or created any blocks, make sure the types of block
// arguments get legalized.
```
Added:
Modified:
mlir/lib/Transforms/Utils/DialectConversion.cpp
Removed:
################################################################################
diff --git a/mlir/lib/Transforms/Utils/DialectConversion.cpp b/mlir/lib/Transforms/Utils/DialectConversion.cpp
index 9cb6f2ba1eaae..7cfe7250d02c3 100644
--- a/mlir/lib/Transforms/Utils/DialectConversion.cpp
+++ b/mlir/lib/Transforms/Utils/DialectConversion.cpp
@@ -2301,7 +2301,7 @@ LogicalResult OperationLegalizer::legalizePatternBlockRewrites(
continue;
Block *block = rewrite->getBlock();
if (isa<BlockTypeConversionRewrite, EraseBlockRewrite,
- ReplaceBlockArgRewrite>(rewrite))
+ ReplaceBlockArgRewrite, InlineBlockRewrite>(rewrite))
continue;
// Only check blocks outside of the current operation.
Operation *parentOp = block->getParentOp();
More information about the Mlir-commits
mailing list