[Mlir-commits] [mlir] b97aaa7 - Remove `let construct =` from ArithExpandOpsPass definition (NFC)

Mehdi Amini llvmlistbot at llvm.org
Mon Oct 2 15:54:42 PDT 2023


Author: Mehdi Amini
Date: 2023-10-02T15:54:22-07:00
New Revision: b97aaa72d9dd21e95eac43c88e35142f96a443a2

URL: https://github.com/llvm/llvm-project/commit/b97aaa72d9dd21e95eac43c88e35142f96a443a2
DIFF: https://github.com/llvm/llvm-project/commit/b97aaa72d9dd21e95eac43c88e35142f96a443a2.diff

LOG: Remove `let construct =` from ArithExpandOpsPass definition (NFC)

Note that the `Pass` suffix is added in tablegen, and as a side effect the
options are renamed from `ArithExpandOpsOptions` to `ArithExpandOpsPassOptions`.

Added: 
    

Modified: 
    mlir/include/mlir/Dialect/Arith/Transforms/Passes.h
    mlir/include/mlir/Dialect/Arith/Transforms/Passes.td
    mlir/lib/Dialect/Arith/Transforms/ExpandOps.cpp

Removed: 
    


################################################################################
diff  --git a/mlir/include/mlir/Dialect/Arith/Transforms/Passes.h b/mlir/include/mlir/Dialect/Arith/Transforms/Passes.h
index a8c69f900a0e813..cbc6147cb81e224 100644
--- a/mlir/include/mlir/Dialect/Arith/Transforms/Passes.h
+++ b/mlir/include/mlir/Dialect/Arith/Transforms/Passes.h
@@ -63,13 +63,6 @@ void populateExpandBFloat16Patterns(RewritePatternSet &patterns);
 /// Add patterns to expand Arith ops.
 void populateArithExpandOpsPatterns(RewritePatternSet &patterns);
 
-/// Create a pass to legalize Arith ops.
-std::unique_ptr<Pass> createArithExpandOpsPass();
-
-/// Create a pass to legalize Arith ops with specified configuration.
-std::unique_ptr<Pass>
-createArithExpandOpsPass(const ArithExpandOpsOptions &options);
-
 /// Create a pass to replace signed ops with unsigned ones where they are proven
 /// equivalent.
 std::unique_ptr<Pass> createArithUnsignedWhenEquivalentPass();

diff  --git a/mlir/include/mlir/Dialect/Arith/Transforms/Passes.td b/mlir/include/mlir/Dialect/Arith/Transforms/Passes.td
index 5e50adc1cc1f590..4096e309199e98c 100644
--- a/mlir/include/mlir/Dialect/Arith/Transforms/Passes.td
+++ b/mlir/include/mlir/Dialect/Arith/Transforms/Passes.td
@@ -27,9 +27,8 @@ def ArithBufferizePass : Pass<"arith-bufferize", "ModuleOp"> {
   ];
 }
 
-def ArithExpandOps : Pass<"arith-expand"> {
+def ArithExpandOpsPass : Pass<"arith-expand"> {
   let summary = "Legalize Arith ops to be convertible to LLVM.";
-  let constructor = "mlir::arith::createArithExpandOpsPass()";
   let dependentDialects = ["vector::VectorDialect"];
   let options = [
     Option<"includeBf16", "include-bf16", "bool", /*default=*/"false",

diff  --git a/mlir/lib/Dialect/Arith/Transforms/ExpandOps.cpp b/mlir/lib/Dialect/Arith/Transforms/ExpandOps.cpp
index b8630da2ea83302..42a63316b31c6b6 100644
--- a/mlir/lib/Dialect/Arith/Transforms/ExpandOps.cpp
+++ b/mlir/lib/Dialect/Arith/Transforms/ExpandOps.cpp
@@ -16,7 +16,7 @@
 
 namespace mlir {
 namespace arith {
-#define GEN_PASS_DEF_ARITHEXPANDOPS
+#define GEN_PASS_DEF_ARITHEXPANDOPSPASS
 #include "mlir/Dialect/Arith/Transforms/Passes.h.inc"
 } // namespace arith
 } // namespace mlir
@@ -303,11 +303,8 @@ struct BFloat16TruncFOpConverter : public OpRewritePattern<arith::TruncFOp> {
 };
 
 struct ArithExpandOpsPass
-    : public arith::impl::ArithExpandOpsBase<ArithExpandOpsPass> {
-  ArithExpandOpsPass() = default;
-  ArithExpandOpsPass(const arith::ArithExpandOpsOptions& options) {
-    this->includeBf16 = options.includeBf16;
-  }
+    : public arith::impl::ArithExpandOpsPassBase<ArithExpandOpsPass> {
+  using ArithExpandOpsPassBase::ArithExpandOpsPassBase;
 
   void runOnOperation() override {
     RewritePatternSet patterns(&getContext());
@@ -372,12 +369,3 @@ void mlir::arith::populateArithExpandOpsPatterns(RewritePatternSet &patterns) {
    >(patterns.getContext());
   // clang-format on
 }
-
-std::unique_ptr<Pass> mlir::arith::createArithExpandOpsPass() {
-  return std::make_unique<ArithExpandOpsPass>();
-}
-
-std::unique_ptr<Pass> mlir::arith::createArithExpandOpsPass(
-  const ArithExpandOpsOptions& options) {
-  return std::make_unique<ArithExpandOpsPass>(options);
-}


        


More information about the Mlir-commits mailing list