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`.
This commit is contained in:
Mehdi Amini 2023-10-02 15:53:13 -07:00
parent b1c10dfd72
commit b97aaa72d9
3 changed files with 4 additions and 24 deletions

View File

@ -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();

View File

@ -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",

View File

@ -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);
}