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

Ian Wood llvmlistbot at llvm.org
Fri Jan 16 11:09:34 PST 2026


================
@@ -1096,31 +1096,90 @@ LogicalResult mlir::simplifyRegions(RewriterBase &rewriter,
 // Move operation dependencies
 //===---------------------------------------------------------------------===//
 
+/// Check if moving operations in the slice before `insertionPoint` would break
+/// dominance due to block argument operands. Returns true if there's an issue.
+/// If `failingOp` is provided, it will be set to the first problematic op.
+///
+/// For operands defined by ops: either the defining op is in the slice (so
+/// dominance preserved), or it already dominates insertionPoint (otherwise it
+/// would be in the slice). So we only need to check block argument operands.
----------------
IanWood1 wrote:

I think you also need to check that none of the ops in the slice have uses of block arguments within their regions (using something like `mlir::visitUsedValuesDefinedAbove`).

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


More information about the Mlir-commits mailing list