[Mlir-commits] [mlir] [mlir] Extend moveValueDefinitions/moveOperationDependencies with cross-region support (PR #176343)

Ian Wood llvmlistbot at llvm.org
Wed Jan 21 11:03:23 PST 2026


================
@@ -1167,13 +1260,29 @@ LogicalResult mlir::moveValueDefinitions(RewriterBase &rewriter,
           insertionPoint,
           "unsupported case of moving block argument before insertion point");
     }
-    // Check for currently unsupported case if the insertion point is in a
-    // different block.
-    if (value.getDefiningOp()->getBlock() != insertionPoint->getBlock()) {
-      return rewriter.notifyMatchFailure(
-          insertionPoint,
-          "unsupported case of moving definition of value before an insertion "
-          "point in a different basic block");
+
+    Block *insertionBlock = insertionPoint->getBlock();
+    Operation *definingOp = value.getDefiningOp();
+    Block *definingBlock = definingOp->getBlock();
+
+    // Check if the value is defined in a different block.
+    if (definingBlock != insertionBlock) {
----------------
IanWood1 wrote:

Optional: similar to the other comment, this could also be removed.

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


More information about the Mlir-commits mailing list