[Mlir-commits] [mlir] [MLIR][NFC] Retire let constructor for EmitC (PR #133732)
llvmlistbot at llvm.org
llvmlistbot at llvm.org
Mon Mar 31 08:03:44 PDT 2025
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-mlir
Author: lorenzo chelini (chelini)
<details>
<summary>Changes</summary>
---
Full diff: https://github.com/llvm/llvm-project/pull/133732.diff
3 Files Affected:
- (modified) mlir/include/mlir/Dialect/EmitC/Transforms/Passes.h (+2-6)
- (modified) mlir/include/mlir/Dialect/EmitC/Transforms/Passes.td (+1-2)
- (modified) mlir/lib/Dialect/EmitC/Transforms/FormExpressions.cpp (+2-6)
``````````diff
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>();
-}
``````````
</details>
https://github.com/llvm/llvm-project/pull/133732
More information about the Mlir-commits
mailing list