#ifdef GEN_PASS_DECL
#define GEN_PASS_DECL_OPTREDUCTION
#define GEN_PASS_DECL_REDUCTIONTREE
#undef GEN_PASS_DECL
#endif
#ifdef GEN_PASS_DECL_OPTREDUCTION
struct OptReductionOptions { … };
#undef GEN_PASS_DECL_OPTREDUCTION
#endif
#ifdef GEN_PASS_DEF_OPTREDUCTION
namespace impl {
template <typename DerivedT>
class OptReductionBase : public ::mlir::OperationPass<ModuleOp> {
public:
using Base = OptReductionBase;
OptReductionBase() : ::mlir::OperationPass<ModuleOp>(::mlir::TypeID::get<DerivedT>()) {}
OptReductionBase(const OptReductionBase &other) : ::mlir::OperationPass<ModuleOp>(other) {}
OptReductionBase& operator=(const OptReductionBase &) = delete;
OptReductionBase(OptReductionBase &&) = delete;
OptReductionBase& operator=(OptReductionBase &&) = delete;
~OptReductionBase() = default;
static constexpr ::llvm::StringLiteral getArgumentName() {
return ::llvm::StringLiteral("opt-reduction-pass");
}
::llvm::StringRef getArgument() const override { return "opt-reduction-pass"; }
::llvm::StringRef getDescription() const override { return "A wrapper pass that reduces the file with optimization passes"; }
static constexpr ::llvm::StringLiteral getPassName() {
return ::llvm::StringLiteral("OptReduction");
}
::llvm::StringRef getName() const override { return "OptReduction"; }
static bool classof(const ::mlir::Pass *pass) {
return pass->getTypeID() == ::mlir::TypeID::get<DerivedT>();
}
std::unique_ptr<::mlir::Pass> clonePass() const override {
return std::make_unique<DerivedT>(*static_cast<const DerivedT *>(this));
}
void getDependentDialects(::mlir::DialectRegistry ®istry) const override {
}
MLIR_DEFINE_EXPLICIT_INTERNAL_INLINE_TYPE_ID(OptReductionBase<DerivedT>)
OptReductionBase(OptReductionOptions options) : OptReductionBase() {
optPass = std::move(options.optPass);
testerName = std::move(options.testerName);
testerArgs = std::move(options.testerArgs);
}
protected:
::mlir::Pass::Option<std::string> optPass{*this, "opt-pass", ::llvm::cl::desc("The optimization passes used for reduction, e.g., symbol-dce")};
::mlir::Pass::Option<std::string> testerName{*this, "test", ::llvm::cl::desc("The location of the tester which tests the file interestingness")};
::mlir::Pass::ListOption<std::string> testerArgs{*this, "test-arg", ::llvm::cl::desc("arguments of the tester")};
private:
};
}
#undef GEN_PASS_DEF_OPTREDUCTION
#endif
#ifdef GEN_PASS_DECL_REDUCTIONTREE
struct ReductionTreeOptions { … };
#undef GEN_PASS_DECL_REDUCTIONTREE
#endif
#ifdef GEN_PASS_DEF_REDUCTIONTREE
namespace impl {
template <typename DerivedT>
class ReductionTreeBase : public ::mlir::OperationPass<> {
public:
using Base = ReductionTreeBase;
ReductionTreeBase() : ::mlir::OperationPass<>(::mlir::TypeID::get<DerivedT>()) {}
ReductionTreeBase(const ReductionTreeBase &other) : ::mlir::OperationPass<>(other) {}
ReductionTreeBase& operator=(const ReductionTreeBase &) = delete;
ReductionTreeBase(ReductionTreeBase &&) = delete;
ReductionTreeBase& operator=(ReductionTreeBase &&) = delete;
~ReductionTreeBase() = default;
static constexpr ::llvm::StringLiteral getArgumentName() {
return ::llvm::StringLiteral("reduction-tree");
}
::llvm::StringRef getArgument() const override { return "reduction-tree"; }
::llvm::StringRef getDescription() const override { return "Reduce the input with reduction-tree algorithm"; }
static constexpr ::llvm::StringLiteral getPassName() {
return ::llvm::StringLiteral("ReductionTree");
}
::llvm::StringRef getName() const override { return "ReductionTree"; }
static bool classof(const ::mlir::Pass *pass) {
return pass->getTypeID() == ::mlir::TypeID::get<DerivedT>();
}
std::unique_ptr<::mlir::Pass> clonePass() const override {
return std::make_unique<DerivedT>(*static_cast<const DerivedT *>(this));
}
void getDependentDialects(::mlir::DialectRegistry ®istry) const override {
}
MLIR_DEFINE_EXPLICIT_INTERNAL_INLINE_TYPE_ID(ReductionTreeBase<DerivedT>)
ReductionTreeBase(ReductionTreeOptions options) : ReductionTreeBase() {
traversalModeId = std::move(options.traversalModeId);
testerName = std::move(options.testerName);
testerArgs = std::move(options.testerArgs);
}
protected:
::mlir::Pass::Option<unsigned> traversalModeId{*this, "traversal-mode", ::llvm::cl::desc("The graph traversal mode, the default is single-path mode"), ::llvm::cl::init(0)};
::mlir::Pass::Option<std::string> testerName{*this, "test", ::llvm::cl::desc("The location of the tester which tests the file interestingness")};
::mlir::Pass::ListOption<std::string> testerArgs{*this, "test-arg", ::llvm::cl::desc("arguments of the tester")};
private:
};
}
#undef GEN_PASS_DEF_REDUCTIONTREE
#endif
#ifdef GEN_PASS_REGISTRATION
inline void registerOptReduction() {
::mlir::registerPass([]() -> std::unique_ptr<::mlir::Pass> {
return mlir::createOptReductionPass();
});
}
inline void registerOptReductionPass() {
::mlir::registerPass([]() -> std::unique_ptr<::mlir::Pass> {
return mlir::createOptReductionPass();
});
}
inline void registerReductionTree() {
::mlir::registerPass([]() -> std::unique_ptr<::mlir::Pass> {
return mlir::createReductionTreePass();
});
}
inline void registerReductionTreePass() {
::mlir::registerPass([]() -> std::unique_ptr<::mlir::Pass> {
return mlir::createReductionTreePass();
});
}
inline void registerReducerPasses() {
registerOptReduction();
registerReductionTree();
}
#undef GEN_PASS_REGISTRATION
#endif
#ifdef GEN_PASS_CLASSES
template <typename DerivedT>
class OptReductionBase : public ::mlir::OperationPass<ModuleOp> {
public:
using Base = OptReductionBase;
OptReductionBase() : ::mlir::OperationPass<ModuleOp>(::mlir::TypeID::get<DerivedT>()) {}
OptReductionBase(const OptReductionBase &other) : ::mlir::OperationPass<ModuleOp>(other) {}
OptReductionBase& operator=(const OptReductionBase &) = delete;
OptReductionBase(OptReductionBase &&) = delete;
OptReductionBase& operator=(OptReductionBase &&) = delete;
~OptReductionBase() = default;
static constexpr ::llvm::StringLiteral getArgumentName() {
return ::llvm::StringLiteral("opt-reduction-pass");
}
::llvm::StringRef getArgument() const override { return "opt-reduction-pass"; }
::llvm::StringRef getDescription() const override { return "A wrapper pass that reduces the file with optimization passes"; }
static constexpr ::llvm::StringLiteral getPassName() {
return ::llvm::StringLiteral("OptReduction");
}
::llvm::StringRef getName() const override { return "OptReduction"; }
static bool classof(const ::mlir::Pass *pass) {
return pass->getTypeID() == ::mlir::TypeID::get<DerivedT>();
}
std::unique_ptr<::mlir::Pass> clonePass() const override {
return std::make_unique<DerivedT>(*static_cast<const DerivedT *>(this));
}
void getDependentDialects(::mlir::DialectRegistry ®istry) const override {
}
MLIR_DEFINE_EXPLICIT_INTERNAL_INLINE_TYPE_ID(OptReductionBase<DerivedT>)
protected:
::mlir::Pass::Option<std::string> optPass{*this, "opt-pass", ::llvm::cl::desc("The optimization passes used for reduction, e.g., symbol-dce")};
::mlir::Pass::Option<std::string> testerName{*this, "test", ::llvm::cl::desc("The location of the tester which tests the file interestingness")};
::mlir::Pass::ListOption<std::string> testerArgs{*this, "test-arg", ::llvm::cl::desc("arguments of the tester")};
};
template <typename DerivedT>
class ReductionTreeBase : public ::mlir::OperationPass<> {
public:
using Base = ReductionTreeBase;
ReductionTreeBase() : ::mlir::OperationPass<>(::mlir::TypeID::get<DerivedT>()) {}
ReductionTreeBase(const ReductionTreeBase &other) : ::mlir::OperationPass<>(other) {}
ReductionTreeBase& operator=(const ReductionTreeBase &) = delete;
ReductionTreeBase(ReductionTreeBase &&) = delete;
ReductionTreeBase& operator=(ReductionTreeBase &&) = delete;
~ReductionTreeBase() = default;
static constexpr ::llvm::StringLiteral getArgumentName() {
return ::llvm::StringLiteral("reduction-tree");
}
::llvm::StringRef getArgument() const override { return "reduction-tree"; }
::llvm::StringRef getDescription() const override { return "Reduce the input with reduction-tree algorithm"; }
static constexpr ::llvm::StringLiteral getPassName() {
return ::llvm::StringLiteral("ReductionTree");
}
::llvm::StringRef getName() const override { return "ReductionTree"; }
static bool classof(const ::mlir::Pass *pass) {
return pass->getTypeID() == ::mlir::TypeID::get<DerivedT>();
}
std::unique_ptr<::mlir::Pass> clonePass() const override {
return std::make_unique<DerivedT>(*static_cast<const DerivedT *>(this));
}
void getDependentDialects(::mlir::DialectRegistry ®istry) const override {
}
MLIR_DEFINE_EXPLICIT_INTERNAL_INLINE_TYPE_ID(ReductionTreeBase<DerivedT>)
protected:
::mlir::Pass::Option<unsigned> traversalModeId{*this, "traversal-mode", ::llvm::cl::desc("The graph traversal mode, the default is single-path mode"), ::llvm::cl::init(0)};
::mlir::Pass::Option<std::string> testerName{*this, "test", ::llvm::cl::desc("The location of the tester which tests the file interestingness")};
::mlir::Pass::ListOption<std::string> testerArgs{*this, "test-arg", ::llvm::cl::desc("arguments of the tester")};
};
#undef GEN_PASS_CLASSES
#endif