[Mlir-commits] [mlir] [MLIR] Fix control-flow sinking through nested regions (PR #217168)

Federico Bruzzone llvmlistbot at llvm.org
Wed Aug 19 05:38:12 PDT 2026


================
@@ -80,8 +80,11 @@ bool Sinker::allUsersDominatedBy(Operation *op, Region *region) {
          "expected op to be defined outside the region");
   return llvm::all_of(op->getUsers(), [&](Operation *user) {
     // The user is dominated by the region if its containing block is dominated
-    // by the region's entry block.
-    return domInfo.dominates(&region->front(), user->getBlock());
+    // by the region's entry block. Additionally, allow users that are in
----------------
FedericoBruzzone wrote:

The `isAncestor` disjunction is redundant, and I think it doesn't have the correct effect.

The new test (`test_scf_if_sink_through_loop`) still passes despite this change. We can undo this addition, right?

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


More information about the Mlir-commits mailing list