#ifdef GEN_PASS_DECL
#define GEN_PASS_DECL_MATHEXTENDTOSUPPORTEDTYPES
#define GEN_PASS_DECL_MATHUPLIFTTOFMA
#undef GEN_PASS_DECL
#endif
#ifdef GEN_PASS_DECL_MATHEXTENDTOSUPPORTEDTYPES
struct MathExtendToSupportedTypesOptions { … };
std::unique_ptr<::mlir::Pass> createMathExtendToSupportedTypes();
std::unique_ptr<::mlir::Pass> createMathExtendToSupportedTypes(MathExtendToSupportedTypesOptions options);
#undef GEN_PASS_DECL_MATHEXTENDTOSUPPORTEDTYPES
#endif
#ifdef GEN_PASS_DEF_MATHEXTENDTOSUPPORTEDTYPES
namespace impl {
std::unique_ptr<::mlir::Pass> createMathExtendToSupportedTypes();
}
namespace impl {
std::unique_ptr<::mlir::Pass> createMathExtendToSupportedTypes(MathExtendToSupportedTypesOptions options);
}
namespace impl {
template <typename DerivedT>
class MathExtendToSupportedTypesBase : public ::mlir::OperationPass<> {
public:
using Base = MathExtendToSupportedTypesBase;
MathExtendToSupportedTypesBase() : ::mlir::OperationPass<>(::mlir::TypeID::get<DerivedT>()) {}
MathExtendToSupportedTypesBase(const MathExtendToSupportedTypesBase &other) : ::mlir::OperationPass<>(other) {}
MathExtendToSupportedTypesBase& operator=(const MathExtendToSupportedTypesBase &) = delete;
MathExtendToSupportedTypesBase(MathExtendToSupportedTypesBase &&) = delete;
MathExtendToSupportedTypesBase& operator=(MathExtendToSupportedTypesBase &&) = delete;
~MathExtendToSupportedTypesBase() = default;
static constexpr ::llvm::StringLiteral getArgumentName() {
return ::llvm::StringLiteral("math-extend-to-supported-types");
}
::llvm::StringRef getArgument() const override { return "math-extend-to-supported-types"; }
::llvm::StringRef getDescription() const override { return "Legalize floating-point math ops on low-precision floats"; }
static constexpr ::llvm::StringLiteral getPassName() {
return ::llvm::StringLiteral("MathExtendToSupportedTypes");
}
::llvm::StringRef getName() const override { return "MathExtendToSupportedTypes"; }
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 {
registry.insert<math::MathDialect>();
registry.insert<arith::ArithDialect>();
}
MLIR_DEFINE_EXPLICIT_INTERNAL_INLINE_TYPE_ID(MathExtendToSupportedTypesBase<DerivedT>)
MathExtendToSupportedTypesBase(MathExtendToSupportedTypesOptions options) : MathExtendToSupportedTypesBase() {
extraTypeStrs = std::move(options.extraTypeStrs);
targetTypeStr = std::move(options.targetTypeStr);
}
protected:
::mlir::Pass::ListOption<std::string> extraTypeStrs{*this, "extra-types", ::llvm::cl::desc("MLIR types with arithmetic support on a given target (f64 and f32 are implicitly supported)")};
::mlir::Pass::Option<std::string> targetTypeStr{*this, "target-type", ::llvm::cl::desc("MLIR type to convert the unsupported source types to"), ::llvm::cl::init("f32")};
private:
friend std::unique_ptr<::mlir::Pass> createMathExtendToSupportedTypes() {
return std::make_unique<DerivedT>();
}
friend std::unique_ptr<::mlir::Pass> createMathExtendToSupportedTypes(MathExtendToSupportedTypesOptions options) {
return std::make_unique<DerivedT>(std::move(options));
}
};
}
std::unique_ptr<::mlir::Pass> createMathExtendToSupportedTypes() {
return impl::createMathExtendToSupportedTypes();
}
std::unique_ptr<::mlir::Pass> createMathExtendToSupportedTypes(MathExtendToSupportedTypesOptions options) {
return impl::createMathExtendToSupportedTypes(std::move(options));
}
#undef GEN_PASS_DEF_MATHEXTENDTOSUPPORTEDTYPES
#endif
#ifdef GEN_PASS_DECL_MATHUPLIFTTOFMA
std::unique_ptr<::mlir::Pass> createMathUpliftToFMA();
#undef GEN_PASS_DECL_MATHUPLIFTTOFMA
#endif
#ifdef GEN_PASS_DEF_MATHUPLIFTTOFMA
namespace impl {
std::unique_ptr<::mlir::Pass> createMathUpliftToFMA();
}
namespace impl {
template <typename DerivedT>
class MathUpliftToFMABase : public ::mlir::OperationPass<> {
public:
using Base = MathUpliftToFMABase;
MathUpliftToFMABase() : ::mlir::OperationPass<>(::mlir::TypeID::get<DerivedT>()) {}
MathUpliftToFMABase(const MathUpliftToFMABase &other) : ::mlir::OperationPass<>(other) {}
MathUpliftToFMABase& operator=(const MathUpliftToFMABase &) = delete;
MathUpliftToFMABase(MathUpliftToFMABase &&) = delete;
MathUpliftToFMABase& operator=(MathUpliftToFMABase &&) = delete;
~MathUpliftToFMABase() = default;
static constexpr ::llvm::StringLiteral getArgumentName() {
return ::llvm::StringLiteral("math-uplift-to-fma");
}
::llvm::StringRef getArgument() const override { return "math-uplift-to-fma"; }
::llvm::StringRef getDescription() const override { return "Uplift arith ops to math.fma."; }
static constexpr ::llvm::StringLiteral getPassName() {
return ::llvm::StringLiteral("MathUpliftToFMA");
}
::llvm::StringRef getName() const override { return "MathUpliftToFMA"; }
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 {
registry.insert<math::MathDialect>();
}
MLIR_DEFINE_EXPLICIT_INTERNAL_INLINE_TYPE_ID(MathUpliftToFMABase<DerivedT>)
protected:
private:
friend std::unique_ptr<::mlir::Pass> createMathUpliftToFMA() {
return std::make_unique<DerivedT>();
}
};
}
std::unique_ptr<::mlir::Pass> createMathUpliftToFMA() {
return impl::createMathUpliftToFMA();
}
#undef GEN_PASS_DEF_MATHUPLIFTTOFMA
#endif
#ifdef GEN_PASS_REGISTRATION
inline void registerMathExtendToSupportedTypes() { … }
inline void registerMathExtendToSupportedTypesPass() { … }
inline void registerMathUpliftToFMA() { … }
inline void registerMathUpliftToFMAPass() { … }
inline void registerMathPasses() { … }
#undef GEN_PASS_REGISTRATION
#endif
#ifdef GEN_PASS_CLASSES
template <typename DerivedT>
class MathExtendToSupportedTypesBase : public ::mlir::OperationPass<> {
public:
using Base = MathExtendToSupportedTypesBase;
MathExtendToSupportedTypesBase() : ::mlir::OperationPass<>(::mlir::TypeID::get<DerivedT>()) {}
MathExtendToSupportedTypesBase(const MathExtendToSupportedTypesBase &other) : ::mlir::OperationPass<>(other) {}
MathExtendToSupportedTypesBase& operator=(const MathExtendToSupportedTypesBase &) = delete;
MathExtendToSupportedTypesBase(MathExtendToSupportedTypesBase &&) = delete;
MathExtendToSupportedTypesBase& operator=(MathExtendToSupportedTypesBase &&) = delete;
~MathExtendToSupportedTypesBase() = default;
static constexpr ::llvm::StringLiteral getArgumentName() {
return ::llvm::StringLiteral("math-extend-to-supported-types");
}
::llvm::StringRef getArgument() const override { return "math-extend-to-supported-types"; }
::llvm::StringRef getDescription() const override { return "Legalize floating-point math ops on low-precision floats"; }
static constexpr ::llvm::StringLiteral getPassName() {
return ::llvm::StringLiteral("MathExtendToSupportedTypes");
}
::llvm::StringRef getName() const override { return "MathExtendToSupportedTypes"; }
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 {
registry.insert<math::MathDialect>();
registry.insert<arith::ArithDialect>();
}
MLIR_DEFINE_EXPLICIT_INTERNAL_INLINE_TYPE_ID(MathExtendToSupportedTypesBase<DerivedT>)
protected:
::mlir::Pass::ListOption<std::string> extraTypeStrs{*this, "extra-types", ::llvm::cl::desc("MLIR types with arithmetic support on a given target (f64 and f32 are implicitly supported)")};
::mlir::Pass::Option<std::string> targetTypeStr{*this, "target-type", ::llvm::cl::desc("MLIR type to convert the unsupported source types to"), ::llvm::cl::init("f32")};
};
template <typename DerivedT>
class MathUpliftToFMABase : public ::mlir::OperationPass<> {
public:
using Base = MathUpliftToFMABase;
MathUpliftToFMABase() : ::mlir::OperationPass<>(::mlir::TypeID::get<DerivedT>()) {}
MathUpliftToFMABase(const MathUpliftToFMABase &other) : ::mlir::OperationPass<>(other) {}
MathUpliftToFMABase& operator=(const MathUpliftToFMABase &) = delete;
MathUpliftToFMABase(MathUpliftToFMABase &&) = delete;
MathUpliftToFMABase& operator=(MathUpliftToFMABase &&) = delete;
~MathUpliftToFMABase() = default;
static constexpr ::llvm::StringLiteral getArgumentName() {
return ::llvm::StringLiteral("math-uplift-to-fma");
}
::llvm::StringRef getArgument() const override { return "math-uplift-to-fma"; }
::llvm::StringRef getDescription() const override { return "Uplift arith ops to math.fma."; }
static constexpr ::llvm::StringLiteral getPassName() {
return ::llvm::StringLiteral("MathUpliftToFMA");
}
::llvm::StringRef getName() const override { return "MathUpliftToFMA"; }
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 {
registry.insert<math::MathDialect>();
}
MLIR_DEFINE_EXPLICIT_INTERNAL_INLINE_TYPE_ID(MathUpliftToFMABase<DerivedT>)
protected:
};
#undef GEN_PASS_CLASSES
#endif