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

Oleksandr Alex Zinenko llvmlistbot at llvm.org
Wed Oct 11 09:28:24 PDT 2023


================
@@ -0,0 +1,56 @@
+//===- InterpreterPass.cpp - Transform dialect interpreter pass -----------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#include "mlir/Dialect/Transform/IR/TransformDialect.h"
+#include "mlir/Dialect/Transform/Transforms/Passes.h"
+#include "mlir/Dialect/Transform/Transforms/TransformInterpreterUtils.h"
+
+using namespace mlir;
+
+namespace mlir {
+namespace transform {
+#define GEN_PASS_DEF_INTERPRETERPASS
+#include "mlir/Dialect/Transform/Transforms/Passes.h.inc"
+} // namespace transform
+} // namespace mlir
+
+namespace {
+class InterpreterPass
+    : public transform::impl::InterpreterPassBase<InterpreterPass> {
+public:
+  using Base::Base;
+
+  LogicalResult initialize(MLIRContext *context) override {
+    // TODO: use a resource blob.
+    ModuleOp transformModule =
+        transform::detail::getPreloadedTransformModule(context);
+    if (transformModule) {
+      sharedTransformModule =
+          std::make_shared<OwningOpRef<ModuleOp>>(transformModule.clone());
+    }
----------------
ftynse wrote:

Do we still need this shared module thing? Is it being mutated?

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


More information about the Mlir-commits mailing list