#ifdef GEN_PASS_DECL
#define GEN_PASS_DECL_ARITHEMULATEUNSUPPORTEDFLOATS
#define GEN_PASS_DECL_ARITHEMULATEWIDEINT
#define GEN_PASS_DECL_ARITHEXPANDOPSPASS
#define GEN_PASS_DECL_ARITHINTNARROWING
#define GEN_PASS_DECL_ARITHINTRANGEOPTS
#define GEN_PASS_DECL_ARITHUNSIGNEDWHENEQUIVALENT
#undef GEN_PASS_DECL
#endif
#ifdef GEN_PASS_DECL_ARITHEMULATEUNSUPPORTEDFLOATS
struct ArithEmulateUnsupportedFloatsOptions { … };
std::unique_ptr<::mlir::Pass> createArithEmulateUnsupportedFloats();
std::unique_ptr<::mlir::Pass> createArithEmulateUnsupportedFloats(ArithEmulateUnsupportedFloatsOptions options);
#undef GEN_PASS_DECL_ARITHEMULATEUNSUPPORTEDFLOATS
#endif
#ifdef GEN_PASS_DEF_ARITHEMULATEUNSUPPORTEDFLOATS
namespace impl {
std::unique_ptr<::mlir::Pass> createArithEmulateUnsupportedFloats();
}
namespace impl {
std::unique_ptr<::mlir::Pass> createArithEmulateUnsupportedFloats(ArithEmulateUnsupportedFloatsOptions options);
}
namespace impl {
template <typename DerivedT>
class ArithEmulateUnsupportedFloatsBase : public ::mlir::OperationPass<> {
public:
using Base = ArithEmulateUnsupportedFloatsBase;
ArithEmulateUnsupportedFloatsBase() : ::mlir::OperationPass<>(::mlir::TypeID::get<DerivedT>()) {}
ArithEmulateUnsupportedFloatsBase(const ArithEmulateUnsupportedFloatsBase &other) : ::mlir::OperationPass<>(other) {}
ArithEmulateUnsupportedFloatsBase& operator=(const ArithEmulateUnsupportedFloatsBase &) = delete;
ArithEmulateUnsupportedFloatsBase(ArithEmulateUnsupportedFloatsBase &&) = delete;
ArithEmulateUnsupportedFloatsBase& operator=(ArithEmulateUnsupportedFloatsBase &&) = delete;
~ArithEmulateUnsupportedFloatsBase() = default;
static constexpr ::llvm::StringLiteral getArgumentName() {
return ::llvm::StringLiteral("arith-emulate-unsupported-floats");
}
::llvm::StringRef getArgument() const override { return "arith-emulate-unsupported-floats"; }
::llvm::StringRef getDescription() const override { return "Emulate operations on unsupported floats with extf/truncf"; }
static constexpr ::llvm::StringLiteral getPassName() {
return ::llvm::StringLiteral("ArithEmulateUnsupportedFloats");
}
::llvm::StringRef getName() const override { return "ArithEmulateUnsupportedFloats"; }
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<vector::VectorDialect>();
}
MLIR_DEFINE_EXPLICIT_INTERNAL_INLINE_TYPE_ID(ArithEmulateUnsupportedFloatsBase<DerivedT>)
ArithEmulateUnsupportedFloatsBase(ArithEmulateUnsupportedFloatsOptions options) : ArithEmulateUnsupportedFloatsBase() {
sourceTypeStrs = std::move(options.sourceTypeStrs);
targetTypeStr = std::move(options.targetTypeStr);
}
protected:
::mlir::Pass::ListOption<std::string> sourceTypeStrs{*this, "source-types", ::llvm::cl::desc("MLIR types without arithmetic support on a given target")};
::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> createArithEmulateUnsupportedFloats() {
return std::make_unique<DerivedT>();
}
friend std::unique_ptr<::mlir::Pass> createArithEmulateUnsupportedFloats(ArithEmulateUnsupportedFloatsOptions options) {
return std::make_unique<DerivedT>(std::move(options));
}
};
}
std::unique_ptr<::mlir::Pass> createArithEmulateUnsupportedFloats() {
return impl::createArithEmulateUnsupportedFloats();
}
std::unique_ptr<::mlir::Pass> createArithEmulateUnsupportedFloats(ArithEmulateUnsupportedFloatsOptions options) {
return impl::createArithEmulateUnsupportedFloats(std::move(options));
}
#undef GEN_PASS_DEF_ARITHEMULATEUNSUPPORTEDFLOATS
#endif
#ifdef GEN_PASS_DECL_ARITHEMULATEWIDEINT
struct ArithEmulateWideIntOptions { … };
std::unique_ptr<::mlir::Pass> createArithEmulateWideInt();
std::unique_ptr<::mlir::Pass> createArithEmulateWideInt(ArithEmulateWideIntOptions options);
#undef GEN_PASS_DECL_ARITHEMULATEWIDEINT
#endif
#ifdef GEN_PASS_DEF_ARITHEMULATEWIDEINT
namespace impl {
std::unique_ptr<::mlir::Pass> createArithEmulateWideInt();
}
namespace impl {
std::unique_ptr<::mlir::Pass> createArithEmulateWideInt(ArithEmulateWideIntOptions options);
}
namespace impl {
template <typename DerivedT>
class ArithEmulateWideIntBase : public ::mlir::OperationPass<> {
public:
using Base = ArithEmulateWideIntBase;
ArithEmulateWideIntBase() : ::mlir::OperationPass<>(::mlir::TypeID::get<DerivedT>()) {}
ArithEmulateWideIntBase(const ArithEmulateWideIntBase &other) : ::mlir::OperationPass<>(other) {}
ArithEmulateWideIntBase& operator=(const ArithEmulateWideIntBase &) = delete;
ArithEmulateWideIntBase(ArithEmulateWideIntBase &&) = delete;
ArithEmulateWideIntBase& operator=(ArithEmulateWideIntBase &&) = delete;
~ArithEmulateWideIntBase() = default;
static constexpr ::llvm::StringLiteral getArgumentName() {
return ::llvm::StringLiteral("arith-emulate-wide-int");
}
::llvm::StringRef getArgument() const override { return "arith-emulate-wide-int"; }
::llvm::StringRef getDescription() const override { return "Emulate 2*N-bit integer operations using N-bit operations"; }
static constexpr ::llvm::StringLiteral getPassName() {
return ::llvm::StringLiteral("ArithEmulateWideInt");
}
::llvm::StringRef getName() const override { return "ArithEmulateWideInt"; }
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<vector::VectorDialect>();
}
MLIR_DEFINE_EXPLICIT_INTERNAL_INLINE_TYPE_ID(ArithEmulateWideIntBase<DerivedT>)
ArithEmulateWideIntBase(ArithEmulateWideIntOptions options) : ArithEmulateWideIntBase() {
widestIntSupported = std::move(options.widestIntSupported);
}
protected:
::mlir::Pass::Option<unsigned> widestIntSupported{*this, "widest-int-supported", ::llvm::cl::desc("Widest integer type supported by the target"), ::llvm::cl::init(32)};
private:
friend std::unique_ptr<::mlir::Pass> createArithEmulateWideInt() {
return std::make_unique<DerivedT>();
}
friend std::unique_ptr<::mlir::Pass> createArithEmulateWideInt(ArithEmulateWideIntOptions options) {
return std::make_unique<DerivedT>(std::move(options));
}
};
}
std::unique_ptr<::mlir::Pass> createArithEmulateWideInt() {
return impl::createArithEmulateWideInt();
}
std::unique_ptr<::mlir::Pass> createArithEmulateWideInt(ArithEmulateWideIntOptions options) {
return impl::createArithEmulateWideInt(std::move(options));
}
#undef GEN_PASS_DEF_ARITHEMULATEWIDEINT
#endif
#ifdef GEN_PASS_DECL_ARITHEXPANDOPSPASS
struct ArithExpandOpsPassOptions { … };
std::unique_ptr<::mlir::Pass> createArithExpandOpsPass();
std::unique_ptr<::mlir::Pass> createArithExpandOpsPass(ArithExpandOpsPassOptions options);
#undef GEN_PASS_DECL_ARITHEXPANDOPSPASS
#endif
#ifdef GEN_PASS_DEF_ARITHEXPANDOPSPASS
namespace impl {
std::unique_ptr<::mlir::Pass> createArithExpandOpsPass();
}
namespace impl {
std::unique_ptr<::mlir::Pass> createArithExpandOpsPass(ArithExpandOpsPassOptions options);
}
namespace impl {
template <typename DerivedT>
class ArithExpandOpsPassBase : public ::mlir::OperationPass<> {
public:
using Base = ArithExpandOpsPassBase;
ArithExpandOpsPassBase() : ::mlir::OperationPass<>(::mlir::TypeID::get<DerivedT>()) {}
ArithExpandOpsPassBase(const ArithExpandOpsPassBase &other) : ::mlir::OperationPass<>(other) {}
ArithExpandOpsPassBase& operator=(const ArithExpandOpsPassBase &) = delete;
ArithExpandOpsPassBase(ArithExpandOpsPassBase &&) = delete;
ArithExpandOpsPassBase& operator=(ArithExpandOpsPassBase &&) = delete;
~ArithExpandOpsPassBase() = default;
static constexpr ::llvm::StringLiteral getArgumentName() {
return ::llvm::StringLiteral("arith-expand");
}
::llvm::StringRef getArgument() const override { return "arith-expand"; }
::llvm::StringRef getDescription() const override { return "Legalize Arith ops to be convertible to LLVM."; }
static constexpr ::llvm::StringLiteral getPassName() {
return ::llvm::StringLiteral("ArithExpandOpsPass");
}
::llvm::StringRef getName() const override { return "ArithExpandOpsPass"; }
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<vector::VectorDialect>();
}
MLIR_DEFINE_EXPLICIT_INTERNAL_INLINE_TYPE_ID(ArithExpandOpsPassBase<DerivedT>)
ArithExpandOpsPassBase(ArithExpandOpsPassOptions options) : ArithExpandOpsPassBase() {
includeBf16 = std::move(options.includeBf16);
}
protected:
::mlir::Pass::Option<bool> includeBf16{*this, "include-bf16", ::llvm::cl::desc("Enable the BF16 expansion patterns"), ::llvm::cl::init(false)};
private:
friend std::unique_ptr<::mlir::Pass> createArithExpandOpsPass() {
return std::make_unique<DerivedT>();
}
friend std::unique_ptr<::mlir::Pass> createArithExpandOpsPass(ArithExpandOpsPassOptions options) {
return std::make_unique<DerivedT>(std::move(options));
}
};
}
std::unique_ptr<::mlir::Pass> createArithExpandOpsPass() {
return impl::createArithExpandOpsPass();
}
std::unique_ptr<::mlir::Pass> createArithExpandOpsPass(ArithExpandOpsPassOptions options) {
return impl::createArithExpandOpsPass(std::move(options));
}
#undef GEN_PASS_DEF_ARITHEXPANDOPSPASS
#endif
#ifdef GEN_PASS_DECL_ARITHINTNARROWING
struct ArithIntNarrowingOptions { … };
std::unique_ptr<::mlir::Pass> createArithIntNarrowing();
std::unique_ptr<::mlir::Pass> createArithIntNarrowing(ArithIntNarrowingOptions options);
#undef GEN_PASS_DECL_ARITHINTNARROWING
#endif
#ifdef GEN_PASS_DEF_ARITHINTNARROWING
namespace impl {
std::unique_ptr<::mlir::Pass> createArithIntNarrowing();
}
namespace impl {
std::unique_ptr<::mlir::Pass> createArithIntNarrowing(ArithIntNarrowingOptions options);
}
namespace impl {
template <typename DerivedT>
class ArithIntNarrowingBase : public ::mlir::OperationPass<> {
public:
using Base = ArithIntNarrowingBase;
ArithIntNarrowingBase() : ::mlir::OperationPass<>(::mlir::TypeID::get<DerivedT>()) {}
ArithIntNarrowingBase(const ArithIntNarrowingBase &other) : ::mlir::OperationPass<>(other) {}
ArithIntNarrowingBase& operator=(const ArithIntNarrowingBase &) = delete;
ArithIntNarrowingBase(ArithIntNarrowingBase &&) = delete;
ArithIntNarrowingBase& operator=(ArithIntNarrowingBase &&) = delete;
~ArithIntNarrowingBase() = default;
static constexpr ::llvm::StringLiteral getArgumentName() {
return ::llvm::StringLiteral("arith-int-narrowing");
}
::llvm::StringRef getArgument() const override { return "arith-int-narrowing"; }
::llvm::StringRef getDescription() const override { return "Reduce integer operation bitwidth"; }
static constexpr ::llvm::StringLiteral getPassName() {
return ::llvm::StringLiteral("ArithIntNarrowing");
}
::llvm::StringRef getName() const override { return "ArithIntNarrowing"; }
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<vector::VectorDialect>();
}
MLIR_DEFINE_EXPLICIT_INTERNAL_INLINE_TYPE_ID(ArithIntNarrowingBase<DerivedT>)
ArithIntNarrowingBase(ArithIntNarrowingOptions options) : ArithIntNarrowingBase() {
bitwidthsSupported = std::move(options.bitwidthsSupported);
}
protected:
::mlir::Pass::ListOption<unsigned> bitwidthsSupported{*this, "int-bitwidths-supported", ::llvm::cl::desc("Integer bitwidths supported")};
private:
friend std::unique_ptr<::mlir::Pass> createArithIntNarrowing() {
return std::make_unique<DerivedT>();
}
friend std::unique_ptr<::mlir::Pass> createArithIntNarrowing(ArithIntNarrowingOptions options) {
return std::make_unique<DerivedT>(std::move(options));
}
};
}
std::unique_ptr<::mlir::Pass> createArithIntNarrowing() {
return impl::createArithIntNarrowing();
}
std::unique_ptr<::mlir::Pass> createArithIntNarrowing(ArithIntNarrowingOptions options) {
return impl::createArithIntNarrowing(std::move(options));
}
#undef GEN_PASS_DEF_ARITHINTNARROWING
#endif
#ifdef GEN_PASS_DECL_ARITHINTRANGEOPTS
std::unique_ptr<::mlir::Pass> createArithIntRangeOpts();
#undef GEN_PASS_DECL_ARITHINTRANGEOPTS
#endif
#ifdef GEN_PASS_DEF_ARITHINTRANGEOPTS
namespace impl {
std::unique_ptr<::mlir::Pass> createArithIntRangeOpts();
}
namespace impl {
template <typename DerivedT>
class ArithIntRangeOptsBase : public ::mlir::OperationPass<> {
public:
using Base = ArithIntRangeOptsBase;
ArithIntRangeOptsBase() : ::mlir::OperationPass<>(::mlir::TypeID::get<DerivedT>()) {}
ArithIntRangeOptsBase(const ArithIntRangeOptsBase &other) : ::mlir::OperationPass<>(other) {}
ArithIntRangeOptsBase& operator=(const ArithIntRangeOptsBase &) = delete;
ArithIntRangeOptsBase(ArithIntRangeOptsBase &&) = delete;
ArithIntRangeOptsBase& operator=(ArithIntRangeOptsBase &&) = delete;
~ArithIntRangeOptsBase() = default;
static constexpr ::llvm::StringLiteral getArgumentName() {
return ::llvm::StringLiteral("int-range-optimizations");
}
::llvm::StringRef getArgument() const override { return "int-range-optimizations"; }
::llvm::StringRef getDescription() const override { return "Do optimizations based on integer range analysis"; }
static constexpr ::llvm::StringLiteral getPassName() {
return ::llvm::StringLiteral("ArithIntRangeOpts");
}
::llvm::StringRef getName() const override { return "ArithIntRangeOpts"; }
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<::mlir::arith::ArithDialect>();
}
MLIR_DEFINE_EXPLICIT_INTERNAL_INLINE_TYPE_ID(ArithIntRangeOptsBase<DerivedT>)
protected:
private:
friend std::unique_ptr<::mlir::Pass> createArithIntRangeOpts() {
return std::make_unique<DerivedT>();
}
};
}
std::unique_ptr<::mlir::Pass> createArithIntRangeOpts() {
return impl::createArithIntRangeOpts();
}
#undef GEN_PASS_DEF_ARITHINTRANGEOPTS
#endif
#ifdef GEN_PASS_DECL_ARITHUNSIGNEDWHENEQUIVALENT
#undef GEN_PASS_DECL_ARITHUNSIGNEDWHENEQUIVALENT
#endif
#ifdef GEN_PASS_DEF_ARITHUNSIGNEDWHENEQUIVALENT
namespace impl {
template <typename DerivedT>
class ArithUnsignedWhenEquivalentBase : public ::mlir::OperationPass<> {
public:
using Base = ArithUnsignedWhenEquivalentBase;
ArithUnsignedWhenEquivalentBase() : ::mlir::OperationPass<>(::mlir::TypeID::get<DerivedT>()) {}
ArithUnsignedWhenEquivalentBase(const ArithUnsignedWhenEquivalentBase &other) : ::mlir::OperationPass<>(other) {}
ArithUnsignedWhenEquivalentBase& operator=(const ArithUnsignedWhenEquivalentBase &) = delete;
ArithUnsignedWhenEquivalentBase(ArithUnsignedWhenEquivalentBase &&) = delete;
ArithUnsignedWhenEquivalentBase& operator=(ArithUnsignedWhenEquivalentBase &&) = delete;
~ArithUnsignedWhenEquivalentBase() = default;
static constexpr ::llvm::StringLiteral getArgumentName() {
return ::llvm::StringLiteral("arith-unsigned-when-equivalent");
}
::llvm::StringRef getArgument() const override { return "arith-unsigned-when-equivalent"; }
::llvm::StringRef getDescription() const override { return "Replace signed ops with unsigned ones where they are proven equivalent"; }
static constexpr ::llvm::StringLiteral getPassName() {
return ::llvm::StringLiteral("ArithUnsignedWhenEquivalent");
}
::llvm::StringRef getName() const override { return "ArithUnsignedWhenEquivalent"; }
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(ArithUnsignedWhenEquivalentBase<DerivedT>)
protected:
private:
};
}
#undef GEN_PASS_DEF_ARITHUNSIGNEDWHENEQUIVALENT
#endif
#ifdef GEN_PASS_REGISTRATION
inline void registerArithEmulateUnsupportedFloats() {
::mlir::registerPass([]() -> std::unique_ptr<::mlir::Pass> {
return createArithEmulateUnsupportedFloats();
});
}
inline void registerArithEmulateUnsupportedFloatsPass() {
::mlir::registerPass([]() -> std::unique_ptr<::mlir::Pass> {
return createArithEmulateUnsupportedFloats();
});
}
inline void registerArithEmulateWideInt() {
::mlir::registerPass([]() -> std::unique_ptr<::mlir::Pass> {
return createArithEmulateWideInt();
});
}
inline void registerArithEmulateWideIntPass() {
::mlir::registerPass([]() -> std::unique_ptr<::mlir::Pass> {
return createArithEmulateWideInt();
});
}
inline void registerArithExpandOpsPass() {
::mlir::registerPass([]() -> std::unique_ptr<::mlir::Pass> {
return createArithExpandOpsPass();
});
}
inline void registerArithExpandOpsPassPass() {
::mlir::registerPass([]() -> std::unique_ptr<::mlir::Pass> {
return createArithExpandOpsPass();
});
}
inline void registerArithIntNarrowing() {
::mlir::registerPass([]() -> std::unique_ptr<::mlir::Pass> {
return createArithIntNarrowing();
});
}
inline void registerArithIntNarrowingPass() {
::mlir::registerPass([]() -> std::unique_ptr<::mlir::Pass> {
return createArithIntNarrowing();
});
}
inline void registerArithIntRangeOpts() {
::mlir::registerPass([]() -> std::unique_ptr<::mlir::Pass> {
return createArithIntRangeOpts();
});
}
inline void registerArithIntRangeOptsPass() {
::mlir::registerPass([]() -> std::unique_ptr<::mlir::Pass> {
return createArithIntRangeOpts();
});
}
inline void registerArithUnsignedWhenEquivalent() {
::mlir::registerPass([]() -> std::unique_ptr<::mlir::Pass> {
return mlir::arith::createArithUnsignedWhenEquivalentPass();
});
}
inline void registerArithUnsignedWhenEquivalentPass() {
::mlir::registerPass([]() -> std::unique_ptr<::mlir::Pass> {
return mlir::arith::createArithUnsignedWhenEquivalentPass();
});
}
inline void registerArithPasses() {
registerArithEmulateUnsupportedFloats();
registerArithEmulateWideInt();
registerArithExpandOpsPass();
registerArithIntNarrowing();
registerArithIntRangeOpts();
registerArithUnsignedWhenEquivalent();
}
#undef GEN_PASS_REGISTRATION
#endif
#ifdef GEN_PASS_CLASSES
template <typename DerivedT>
class ArithEmulateUnsupportedFloatsBase : public ::mlir::OperationPass<> {
public:
using Base = ArithEmulateUnsupportedFloatsBase;
ArithEmulateUnsupportedFloatsBase() : ::mlir::OperationPass<>(::mlir::TypeID::get<DerivedT>()) {}
ArithEmulateUnsupportedFloatsBase(const ArithEmulateUnsupportedFloatsBase &other) : ::mlir::OperationPass<>(other) {}
ArithEmulateUnsupportedFloatsBase& operator=(const ArithEmulateUnsupportedFloatsBase &) = delete;
ArithEmulateUnsupportedFloatsBase(ArithEmulateUnsupportedFloatsBase &&) = delete;
ArithEmulateUnsupportedFloatsBase& operator=(ArithEmulateUnsupportedFloatsBase &&) = delete;
~ArithEmulateUnsupportedFloatsBase() = default;
static constexpr ::llvm::StringLiteral getArgumentName() {
return ::llvm::StringLiteral("arith-emulate-unsupported-floats");
}
::llvm::StringRef getArgument() const override { return "arith-emulate-unsupported-floats"; }
::llvm::StringRef getDescription() const override { return "Emulate operations on unsupported floats with extf/truncf"; }
static constexpr ::llvm::StringLiteral getPassName() {
return ::llvm::StringLiteral("ArithEmulateUnsupportedFloats");
}
::llvm::StringRef getName() const override { return "ArithEmulateUnsupportedFloats"; }
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<vector::VectorDialect>();
}
MLIR_DEFINE_EXPLICIT_INTERNAL_INLINE_TYPE_ID(ArithEmulateUnsupportedFloatsBase<DerivedT>)
protected:
::mlir::Pass::ListOption<std::string> sourceTypeStrs{*this, "source-types", ::llvm::cl::desc("MLIR types without arithmetic support on a given target")};
::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 ArithEmulateWideIntBase : public ::mlir::OperationPass<> {
public:
using Base = ArithEmulateWideIntBase;
ArithEmulateWideIntBase() : ::mlir::OperationPass<>(::mlir::TypeID::get<DerivedT>()) {}
ArithEmulateWideIntBase(const ArithEmulateWideIntBase &other) : ::mlir::OperationPass<>(other) {}
ArithEmulateWideIntBase& operator=(const ArithEmulateWideIntBase &) = delete;
ArithEmulateWideIntBase(ArithEmulateWideIntBase &&) = delete;
ArithEmulateWideIntBase& operator=(ArithEmulateWideIntBase &&) = delete;
~ArithEmulateWideIntBase() = default;
static constexpr ::llvm::StringLiteral getArgumentName() {
return ::llvm::StringLiteral("arith-emulate-wide-int");
}
::llvm::StringRef getArgument() const override { return "arith-emulate-wide-int"; }
::llvm::StringRef getDescription() const override { return "Emulate 2*N-bit integer operations using N-bit operations"; }
static constexpr ::llvm::StringLiteral getPassName() {
return ::llvm::StringLiteral("ArithEmulateWideInt");
}
::llvm::StringRef getName() const override { return "ArithEmulateWideInt"; }
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<vector::VectorDialect>();
}
MLIR_DEFINE_EXPLICIT_INTERNAL_INLINE_TYPE_ID(ArithEmulateWideIntBase<DerivedT>)
protected:
::mlir::Pass::Option<unsigned> widestIntSupported{*this, "widest-int-supported", ::llvm::cl::desc("Widest integer type supported by the target"), ::llvm::cl::init(32)};
};
template <typename DerivedT>
class ArithExpandOpsPassBase : public ::mlir::OperationPass<> {
public:
using Base = ArithExpandOpsPassBase;
ArithExpandOpsPassBase() : ::mlir::OperationPass<>(::mlir::TypeID::get<DerivedT>()) {}
ArithExpandOpsPassBase(const ArithExpandOpsPassBase &other) : ::mlir::OperationPass<>(other) {}
ArithExpandOpsPassBase& operator=(const ArithExpandOpsPassBase &) = delete;
ArithExpandOpsPassBase(ArithExpandOpsPassBase &&) = delete;
ArithExpandOpsPassBase& operator=(ArithExpandOpsPassBase &&) = delete;
~ArithExpandOpsPassBase() = default;
static constexpr ::llvm::StringLiteral getArgumentName() {
return ::llvm::StringLiteral("arith-expand");
}
::llvm::StringRef getArgument() const override { return "arith-expand"; }
::llvm::StringRef getDescription() const override { return "Legalize Arith ops to be convertible to LLVM."; }
static constexpr ::llvm::StringLiteral getPassName() {
return ::llvm::StringLiteral("ArithExpandOpsPass");
}
::llvm::StringRef getName() const override { return "ArithExpandOpsPass"; }
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<vector::VectorDialect>();
}
MLIR_DEFINE_EXPLICIT_INTERNAL_INLINE_TYPE_ID(ArithExpandOpsPassBase<DerivedT>)
protected:
::mlir::Pass::Option<bool> includeBf16{*this, "include-bf16", ::llvm::cl::desc("Enable the BF16 expansion patterns"), ::llvm::cl::init(false)};
};
template <typename DerivedT>
class ArithIntNarrowingBase : public ::mlir::OperationPass<> {
public:
using Base = ArithIntNarrowingBase;
ArithIntNarrowingBase() : ::mlir::OperationPass<>(::mlir::TypeID::get<DerivedT>()) {}
ArithIntNarrowingBase(const ArithIntNarrowingBase &other) : ::mlir::OperationPass<>(other) {}
ArithIntNarrowingBase& operator=(const ArithIntNarrowingBase &) = delete;
ArithIntNarrowingBase(ArithIntNarrowingBase &&) = delete;
ArithIntNarrowingBase& operator=(ArithIntNarrowingBase &&) = delete;
~ArithIntNarrowingBase() = default;
static constexpr ::llvm::StringLiteral getArgumentName() {
return ::llvm::StringLiteral("arith-int-narrowing");
}
::llvm::StringRef getArgument() const override { return "arith-int-narrowing"; }
::llvm::StringRef getDescription() const override { return "Reduce integer operation bitwidth"; }
static constexpr ::llvm::StringLiteral getPassName() {
return ::llvm::StringLiteral("ArithIntNarrowing");
}
::llvm::StringRef getName() const override { return "ArithIntNarrowing"; }
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<vector::VectorDialect>();
}
MLIR_DEFINE_EXPLICIT_INTERNAL_INLINE_TYPE_ID(ArithIntNarrowingBase<DerivedT>)
protected:
::mlir::Pass::ListOption<unsigned> bitwidthsSupported{*this, "int-bitwidths-supported", ::llvm::cl::desc("Integer bitwidths supported")};
};
template <typename DerivedT>
class ArithIntRangeOptsBase : public ::mlir::OperationPass<> {
public:
using Base = ArithIntRangeOptsBase;
ArithIntRangeOptsBase() : ::mlir::OperationPass<>(::mlir::TypeID::get<DerivedT>()) {}
ArithIntRangeOptsBase(const ArithIntRangeOptsBase &other) : ::mlir::OperationPass<>(other) {}
ArithIntRangeOptsBase& operator=(const ArithIntRangeOptsBase &) = delete;
ArithIntRangeOptsBase(ArithIntRangeOptsBase &&) = delete;
ArithIntRangeOptsBase& operator=(ArithIntRangeOptsBase &&) = delete;
~ArithIntRangeOptsBase() = default;
static constexpr ::llvm::StringLiteral getArgumentName() {
return ::llvm::StringLiteral("int-range-optimizations");
}
::llvm::StringRef getArgument() const override { return "int-range-optimizations"; }
::llvm::StringRef getDescription() const override { return "Do optimizations based on integer range analysis"; }
static constexpr ::llvm::StringLiteral getPassName() {
return ::llvm::StringLiteral("ArithIntRangeOpts");
}
::llvm::StringRef getName() const override { return "ArithIntRangeOpts"; }
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<::mlir::arith::ArithDialect>();
}
MLIR_DEFINE_EXPLICIT_INTERNAL_INLINE_TYPE_ID(ArithIntRangeOptsBase<DerivedT>)
protected:
};
template <typename DerivedT>
class ArithUnsignedWhenEquivalentBase : public ::mlir::OperationPass<> {
public:
using Base = ArithUnsignedWhenEquivalentBase;
ArithUnsignedWhenEquivalentBase() : ::mlir::OperationPass<>(::mlir::TypeID::get<DerivedT>()) {}
ArithUnsignedWhenEquivalentBase(const ArithUnsignedWhenEquivalentBase &other) : ::mlir::OperationPass<>(other) {}
ArithUnsignedWhenEquivalentBase& operator=(const ArithUnsignedWhenEquivalentBase &) = delete;
ArithUnsignedWhenEquivalentBase(ArithUnsignedWhenEquivalentBase &&) = delete;
ArithUnsignedWhenEquivalentBase& operator=(ArithUnsignedWhenEquivalentBase &&) = delete;
~ArithUnsignedWhenEquivalentBase() = default;
static constexpr ::llvm::StringLiteral getArgumentName() {
return ::llvm::StringLiteral("arith-unsigned-when-equivalent");
}
::llvm::StringRef getArgument() const override { return "arith-unsigned-when-equivalent"; }
::llvm::StringRef getDescription() const override { return "Replace signed ops with unsigned ones where they are proven equivalent"; }
static constexpr ::llvm::StringLiteral getPassName() {
return ::llvm::StringLiteral("ArithUnsignedWhenEquivalent");
}
::llvm::StringRef getName() const override { return "ArithUnsignedWhenEquivalent"; }
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(ArithUnsignedWhenEquivalentBase<DerivedT>)
protected:
};
#undef GEN_PASS_CLASSES
#endif