[Mlir-commits] [mlir] [mlir][Transform] Create a transform interpreter and a preloader pass (PR #68661)

Nicolas Vasilache llvmlistbot at llvm.org
Wed Oct 11 11:31:04 PDT 2023


================
@@ -1761,8 +1761,20 @@ DiagnosedSilenceableFailure
 transform::NamedSequenceOp::apply(transform::TransformRewriter &rewriter,
                                   transform::TransformResults &results,
                                   transform::TransformState &state) {
-  // Nothing to do here.
-  return DiagnosedSilenceableFailure::success();
+  if (isExternal())
+    return emitDefiniteFailure() << "unresolved external named sequence";
+
+  // Map the entry block argument to the list of operations.
+  // Note: this is the same implementation as PossibleTopLevelTransformOp but
+  // without attaching the interface / trait since that is tailored to a
+  // dangling top-level op that does not get "called".
+  auto scope = state.make_region_scope(getBody());
+  if (failed(detail::mapPossibleTopLevelTransformOpBlockArguments(
+          state, this->getOperation(), getBody())))
+    return DiagnosedSilenceableFailure::definiteFailure();
+
+  return applySequenceBlock(getBody().front(),
+                            FailurePropagationMode::Propagate, state, results);
----------------
nicolasvasilache wrote:

there isn't; I started plumbing it through but overall found it not worth it, we end up only applying this code to the top-level entry point and propagating at this point made sense.

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


More information about the Mlir-commits mailing list