[Mlir-commits] [mlir] [MLIR][Transform] Prefer entry points in current module (PR #151323)

Jakub Kuderski llvmlistbot at llvm.org
Wed Jul 30 14:01:28 PDT 2025


================
@@ -129,15 +129,29 @@ transform::detail::findTransformEntryPoint(Operation *root, ModuleOp module,
     l.push_back(module);
   for (Operation *op : l) {
     transform::TransformOpInterface transform = nullptr;
-    op->walk<WalkOrder::PreOrder>(
-        [&](transform::NamedSequenceOp namedSequenceOp) {
+    for (Region &region : op->getRegions()) {
+      for (Block &block : region.getBlocks()) {
+        auto namedSequenceOps = block.getOps<transform::NamedSequenceOp>();
+        for (transform::NamedSequenceOp namedSequenceOp : namedSequenceOps) {
           if (namedSequenceOp.getSymName() == entryPoint) {
             transform = cast<transform::TransformOpInterface>(
                 namedSequenceOp.getOperation());
-            return WalkResult::interrupt();
+            break;
           }
-          return WalkResult::advance();
-        });
+        }
+      }
+    }
+    if (!transform) {
----------------
kuhar wrote:

I know this and you know this, but I think it's worth documenting through a code comment

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


More information about the Mlir-commits mailing list