[Mlir-commits] [mlir] [MLIR][NFC] Retire let constructor for EmitC (PR #133732)
lorenzo chelini
llvmlistbot at llvm.org
Mon Mar 31 08:03:10 PDT 2025
https://github.com/chelini created https://github.com/llvm/llvm-project/pull/133732
None
>From 077d47517867fac59d125cb2317e060724aed299 Mon Sep 17 00:00:00 2001
From: lorenzo chelini <lchelini at nvidia.com>
Date: Sat, 1 Mar 2025 14:47:59 +0100
Subject: [PATCH] [MLIR][NFC] Retire let constructor for EmitC
---
mlir/include/mlir/Dialect/EmitC/Transforms/Passes.h | 8 ++------
mlir/include/mlir/Dialect/EmitC/Transforms/Passes.td | 3 +--
mlir/lib/Dialect/EmitC/Transforms/FormExpressions.cpp | 8 ++------
3 files changed, 5 insertions(+), 14 deletions(-)
diff --git a/mlir/include/mlir/Dialect/EmitC/Transforms/Passes.h b/mlir/include/mlir/Dialect/EmitC/Transforms/Passes.h
index 5cd27149d366e..5a103f181c76b 100644
--- a/mlir/include/mlir/Dialect/EmitC/Transforms/Passes.h
+++ b/mlir/include/mlir/Dialect/EmitC/Transforms/Passes.h
@@ -14,12 +14,8 @@
namespace mlir {
namespace emitc {
-//===----------------------------------------------------------------------===//
-// Passes
-//===----------------------------------------------------------------------===//
-
-/// Creates an instance of the C-style expressions forming pass.
-std::unique_ptr<Pass> createFormExpressionsPass();
+#define GEN_PASS_DECL_FORMEXPRESSIONSPASS
+#include "mlir/Dialect/EmitC/Transforms/Passes.h.inc"
//===----------------------------------------------------------------------===//
// Registration
diff --git a/mlir/include/mlir/Dialect/EmitC/Transforms/Passes.td b/mlir/include/mlir/Dialect/EmitC/Transforms/Passes.td
index fd083abc95715..f46b705ca2dfe 100644
--- a/mlir/include/mlir/Dialect/EmitC/Transforms/Passes.td
+++ b/mlir/include/mlir/Dialect/EmitC/Transforms/Passes.td
@@ -11,13 +11,12 @@
include "mlir/Pass/PassBase.td"
-def FormExpressions : Pass<"form-expressions"> {
+def FormExpressionsPass : Pass<"form-expressions"> {
let summary = "Form C-style expressions from C-operator ops";
let description = [{
The pass wraps emitc ops modelling C operators in emitc.expression ops and
then folds single-use expressions into their users where possible.
}];
- let constructor = "mlir::emitc::createFormExpressionsPass()";
let dependentDialects = ["emitc::EmitCDialect"];
}
diff --git a/mlir/lib/Dialect/EmitC/Transforms/FormExpressions.cpp b/mlir/lib/Dialect/EmitC/Transforms/FormExpressions.cpp
index 3385514375804..224d68ab8b4a6 100644
--- a/mlir/lib/Dialect/EmitC/Transforms/FormExpressions.cpp
+++ b/mlir/lib/Dialect/EmitC/Transforms/FormExpressions.cpp
@@ -18,7 +18,7 @@
namespace mlir {
namespace emitc {
-#define GEN_PASS_DEF_FORMEXPRESSIONS
+#define GEN_PASS_DEF_FORMEXPRESSIONSPASS
#include "mlir/Dialect/EmitC/Transforms/Passes.h.inc"
} // namespace emitc
} // namespace mlir
@@ -28,7 +28,7 @@ using namespace emitc;
namespace {
struct FormExpressionsPass
- : public emitc::impl::FormExpressionsBase<FormExpressionsPass> {
+ : public emitc::impl::FormExpressionsPassBase<FormExpressionsPass> {
void runOnOperation() override {
Operation *rootOp = getOperation();
MLIRContext *context = rootOp->getContext();
@@ -56,7 +56,3 @@ struct FormExpressionsPass
}
};
} // namespace
-
-std::unique_ptr<Pass> mlir::emitc::createFormExpressionsPass() {
- return std::make_unique<FormExpressionsPass>();
-}
More information about the Mlir-commits
mailing list