[Mlir-commits] [mlir] [mlir][Transforms][NFC] Remove `InlineBlockRewrite` (PR #83262)

Matthias Springer llvmlistbot at llvm.org
Mon Mar 4 15:37:13 PST 2024


================
@@ -1649,10 +1598,18 @@ void ConversionPatternRewriter::inlineBlockBefore(Block *source, Block *dest,
          "expected 'source' to have no predecessors");
 #endif // NDEBUG
 
-  impl->notifyBlockBeingInlined(dest, source, before);
+  // Replace all uses of block arguments.
+  // TODO: Support `replaceAllUsesWith` in the dialect conversion. Then this
+  // function no longer has to be overridden and can be turned into a
+  // non-virtual function.
   for (auto it : llvm::zip(source->getArguments(), argValues))
     replaceUsesOfBlockArgument(std::get<0>(it), std::get<1>(it));
-  dest->getOperations().splice(before, source->getOperations());
+
+  // Move op by op.
----------------
matthias-springer wrote:

There is in fact a noticeable slowdown of moving ops one-by-one in IREE. I moved the necessary changes for listener support into #83425 (slow path / fast path). Closing this PR.


https://github.com/llvm/llvm-project/pull/83262


More information about the Mlir-commits mailing list