#ifdef GEN_PASS_DECL
#define GEN_PASS_DECL_EXPANDOPS
#define GEN_PASS_DECL_EXPANDREALLOC
#define GEN_PASS_DECL_EXPANDSTRIDEDMETADATA
#define GEN_PASS_DECL_FOLDMEMREFALIASOPS
#define GEN_PASS_DECL_MEMREFEMULATEWIDEINT
#define GEN_PASS_DECL_NORMALIZEMEMREFS
#define GEN_PASS_DECL_RESOLVERANKEDSHAPETYPERESULTDIMS
#define GEN_PASS_DECL_RESOLVESHAPEDTYPERESULTDIMS
#undef GEN_PASS_DECL
#endif
#ifdef GEN_PASS_DECL_EXPANDOPS
#undef GEN_PASS_DECL_EXPANDOPS
#endif
#ifdef GEN_PASS_DEF_EXPANDOPS
namespace impl {
template <typename DerivedT>
class ExpandOpsBase : public ::mlir::OperationPass<> {
public:
using Base = ExpandOpsBase;
ExpandOpsBase() : ::mlir::OperationPass<>(::mlir::TypeID::get<DerivedT>()) {}
ExpandOpsBase(const ExpandOpsBase &other) : ::mlir::OperationPass<>(other) {}
ExpandOpsBase& operator=(const ExpandOpsBase &) = delete;
ExpandOpsBase(ExpandOpsBase &&) = delete;
ExpandOpsBase& operator=(ExpandOpsBase &&) = delete;
~ExpandOpsBase() = default;
static constexpr ::llvm::StringLiteral getArgumentName() {
return ::llvm::StringLiteral("memref-expand");
}
::llvm::StringRef getArgument() const override { return "memref-expand"; }
::llvm::StringRef getDescription() const override { return "Legalize memref operations to be convertible to LLVM."; }
static constexpr ::llvm::StringLiteral getPassName() {
return ::llvm::StringLiteral("ExpandOps");
}
::llvm::StringRef getName() const override { return "ExpandOps"; }
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(ExpandOpsBase<DerivedT>)
protected:
private:
};
}
#undef GEN_PASS_DEF_EXPANDOPS
#endif
#ifdef GEN_PASS_DECL_EXPANDREALLOC
struct ExpandReallocOptions { … };
#undef GEN_PASS_DECL_EXPANDREALLOC
#endif
#ifdef GEN_PASS_DEF_EXPANDREALLOC
namespace impl {
template <typename DerivedT>
class ExpandReallocBase : public ::mlir::OperationPass<> {
public:
using Base = ExpandReallocBase;
ExpandReallocBase() : ::mlir::OperationPass<>(::mlir::TypeID::get<DerivedT>()) {}
ExpandReallocBase(const ExpandReallocBase &other) : ::mlir::OperationPass<>(other) {}
ExpandReallocBase& operator=(const ExpandReallocBase &) = delete;
ExpandReallocBase(ExpandReallocBase &&) = delete;
ExpandReallocBase& operator=(ExpandReallocBase &&) = delete;
~ExpandReallocBase() = default;
static constexpr ::llvm::StringLiteral getArgumentName() {
return ::llvm::StringLiteral("expand-realloc");
}
::llvm::StringRef getArgument() const override { return "expand-realloc"; }
::llvm::StringRef getDescription() const override { return "Expand memref.realloc operations into its components"; }
static constexpr ::llvm::StringLiteral getPassName() {
return ::llvm::StringLiteral("ExpandRealloc");
}
::llvm::StringRef getName() const override { return "ExpandRealloc"; }
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<arith::ArithDialect>();
registry.insert<scf::SCFDialect>();
registry.insert<memref::MemRefDialect>();
}
MLIR_DEFINE_EXPLICIT_INTERNAL_INLINE_TYPE_ID(ExpandReallocBase<DerivedT>)
ExpandReallocBase(ExpandReallocOptions options) : ExpandReallocBase() {
emitDeallocs = std::move(options.emitDeallocs);
}
protected:
::mlir::Pass::Option<bool> emitDeallocs{*this, "emit-deallocs", ::llvm::cl::desc("Emit deallocation operations for the original MemRef"), ::llvm::cl::init(true)};
private:
};
}
#undef GEN_PASS_DEF_EXPANDREALLOC
#endif
#ifdef GEN_PASS_DECL_EXPANDSTRIDEDMETADATA
#undef GEN_PASS_DECL_EXPANDSTRIDEDMETADATA
#endif
#ifdef GEN_PASS_DEF_EXPANDSTRIDEDMETADATA
namespace impl {
template <typename DerivedT>
class ExpandStridedMetadataBase : public ::mlir::OperationPass<> {
public:
using Base = ExpandStridedMetadataBase;
ExpandStridedMetadataBase() : ::mlir::OperationPass<>(::mlir::TypeID::get<DerivedT>()) {}
ExpandStridedMetadataBase(const ExpandStridedMetadataBase &other) : ::mlir::OperationPass<>(other) {}
ExpandStridedMetadataBase& operator=(const ExpandStridedMetadataBase &) = delete;
ExpandStridedMetadataBase(ExpandStridedMetadataBase &&) = delete;
ExpandStridedMetadataBase& operator=(ExpandStridedMetadataBase &&) = delete;
~ExpandStridedMetadataBase() = default;
static constexpr ::llvm::StringLiteral getArgumentName() {
return ::llvm::StringLiteral("expand-strided-metadata");
}
::llvm::StringRef getArgument() const override { return "expand-strided-metadata"; }
::llvm::StringRef getDescription() const override { return "Expand memref operations into easier to analyze constructs"; }
static constexpr ::llvm::StringLiteral getPassName() {
return ::llvm::StringLiteral("ExpandStridedMetadata");
}
::llvm::StringRef getName() const override { return "ExpandStridedMetadata"; }
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<affine::AffineDialect>();
registry.insert<memref::MemRefDialect>();
}
MLIR_DEFINE_EXPLICIT_INTERNAL_INLINE_TYPE_ID(ExpandStridedMetadataBase<DerivedT>)
protected:
private:
};
}
#undef GEN_PASS_DEF_EXPANDSTRIDEDMETADATA
#endif
#ifdef GEN_PASS_DECL_FOLDMEMREFALIASOPS
#undef GEN_PASS_DECL_FOLDMEMREFALIASOPS
#endif
#ifdef GEN_PASS_DEF_FOLDMEMREFALIASOPS
namespace impl {
template <typename DerivedT>
class FoldMemRefAliasOpsBase : public ::mlir::OperationPass<> {
public:
using Base = FoldMemRefAliasOpsBase;
FoldMemRefAliasOpsBase() : ::mlir::OperationPass<>(::mlir::TypeID::get<DerivedT>()) {}
FoldMemRefAliasOpsBase(const FoldMemRefAliasOpsBase &other) : ::mlir::OperationPass<>(other) {}
FoldMemRefAliasOpsBase& operator=(const FoldMemRefAliasOpsBase &) = delete;
FoldMemRefAliasOpsBase(FoldMemRefAliasOpsBase &&) = delete;
FoldMemRefAliasOpsBase& operator=(FoldMemRefAliasOpsBase &&) = delete;
~FoldMemRefAliasOpsBase() = default;
static constexpr ::llvm::StringLiteral getArgumentName() {
return ::llvm::StringLiteral("fold-memref-alias-ops");
}
::llvm::StringRef getArgument() const override { return "fold-memref-alias-ops"; }
::llvm::StringRef getDescription() const override { return "Fold memref alias ops into consumer load/store ops"; }
static constexpr ::llvm::StringLiteral getPassName() {
return ::llvm::StringLiteral("FoldMemRefAliasOps");
}
::llvm::StringRef getName() const override { return "FoldMemRefAliasOps"; }
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<affine::AffineDialect>();
registry.insert<memref::MemRefDialect>();
registry.insert<vector::VectorDialect>();
}
MLIR_DEFINE_EXPLICIT_INTERNAL_INLINE_TYPE_ID(FoldMemRefAliasOpsBase<DerivedT>)
protected:
private:
};
}
#undef GEN_PASS_DEF_FOLDMEMREFALIASOPS
#endif
#ifdef GEN_PASS_DECL_MEMREFEMULATEWIDEINT
struct MemRefEmulateWideIntOptions { … };
std::unique_ptr<::mlir::Pass> createMemRefEmulateWideInt();
std::unique_ptr<::mlir::Pass> createMemRefEmulateWideInt(MemRefEmulateWideIntOptions options);
#undef GEN_PASS_DECL_MEMREFEMULATEWIDEINT
#endif
#ifdef GEN_PASS_DEF_MEMREFEMULATEWIDEINT
namespace impl {
std::unique_ptr<::mlir::Pass> createMemRefEmulateWideInt();
}
namespace impl {
std::unique_ptr<::mlir::Pass> createMemRefEmulateWideInt(MemRefEmulateWideIntOptions options);
}
namespace impl {
template <typename DerivedT>
class MemRefEmulateWideIntBase : public ::mlir::OperationPass<> {
public:
using Base = MemRefEmulateWideIntBase;
MemRefEmulateWideIntBase() : ::mlir::OperationPass<>(::mlir::TypeID::get<DerivedT>()) {}
MemRefEmulateWideIntBase(const MemRefEmulateWideIntBase &other) : ::mlir::OperationPass<>(other) {}
MemRefEmulateWideIntBase& operator=(const MemRefEmulateWideIntBase &) = delete;
MemRefEmulateWideIntBase(MemRefEmulateWideIntBase &&) = delete;
MemRefEmulateWideIntBase& operator=(MemRefEmulateWideIntBase &&) = delete;
~MemRefEmulateWideIntBase() = default;
static constexpr ::llvm::StringLiteral getArgumentName() {
return ::llvm::StringLiteral("memref-emulate-wide-int");
}
::llvm::StringRef getArgument() const override { return "memref-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("MemRefEmulateWideInt");
}
::llvm::StringRef getName() const override { return "MemRefEmulateWideInt"; }
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(MemRefEmulateWideIntBase<DerivedT>)
MemRefEmulateWideIntBase(MemRefEmulateWideIntOptions options) : MemRefEmulateWideIntBase() {
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> createMemRefEmulateWideInt() {
return std::make_unique<DerivedT>();
}
friend std::unique_ptr<::mlir::Pass> createMemRefEmulateWideInt(MemRefEmulateWideIntOptions options) {
return std::make_unique<DerivedT>(std::move(options));
}
};
}
std::unique_ptr<::mlir::Pass> createMemRefEmulateWideInt() {
return impl::createMemRefEmulateWideInt();
}
std::unique_ptr<::mlir::Pass> createMemRefEmulateWideInt(MemRefEmulateWideIntOptions options) {
return impl::createMemRefEmulateWideInt(std::move(options));
}
#undef GEN_PASS_DEF_MEMREFEMULATEWIDEINT
#endif
#ifdef GEN_PASS_DECL_NORMALIZEMEMREFS
#undef GEN_PASS_DECL_NORMALIZEMEMREFS
#endif
#ifdef GEN_PASS_DEF_NORMALIZEMEMREFS
namespace impl {
template <typename DerivedT>
class NormalizeMemRefsBase : public ::mlir::OperationPass<ModuleOp> {
public:
using Base = NormalizeMemRefsBase;
NormalizeMemRefsBase() : ::mlir::OperationPass<ModuleOp>(::mlir::TypeID::get<DerivedT>()) {}
NormalizeMemRefsBase(const NormalizeMemRefsBase &other) : ::mlir::OperationPass<ModuleOp>(other) {}
NormalizeMemRefsBase& operator=(const NormalizeMemRefsBase &) = delete;
NormalizeMemRefsBase(NormalizeMemRefsBase &&) = delete;
NormalizeMemRefsBase& operator=(NormalizeMemRefsBase &&) = delete;
~NormalizeMemRefsBase() = default;
static constexpr ::llvm::StringLiteral getArgumentName() {
return ::llvm::StringLiteral("normalize-memrefs");
}
::llvm::StringRef getArgument() const override { return "normalize-memrefs"; }
::llvm::StringRef getDescription() const override { return "Normalize memrefs"; }
static constexpr ::llvm::StringLiteral getPassName() {
return ::llvm::StringLiteral("NormalizeMemRefs");
}
::llvm::StringRef getName() const override { return "NormalizeMemRefs"; }
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<affine::AffineDialect>();
}
MLIR_DEFINE_EXPLICIT_INTERNAL_INLINE_TYPE_ID(NormalizeMemRefsBase<DerivedT>)
protected:
private:
};
}
#undef GEN_PASS_DEF_NORMALIZEMEMREFS
#endif
#ifdef GEN_PASS_DECL_RESOLVERANKEDSHAPETYPERESULTDIMS
#undef GEN_PASS_DECL_RESOLVERANKEDSHAPETYPERESULTDIMS
#endif
#ifdef GEN_PASS_DEF_RESOLVERANKEDSHAPETYPERESULTDIMS
namespace impl {
template <typename DerivedT>
class ResolveRankedShapeTypeResultDimsBase : public ::mlir::OperationPass<> {
public:
using Base = ResolveRankedShapeTypeResultDimsBase;
ResolveRankedShapeTypeResultDimsBase() : ::mlir::OperationPass<>(::mlir::TypeID::get<DerivedT>()) {}
ResolveRankedShapeTypeResultDimsBase(const ResolveRankedShapeTypeResultDimsBase &other) : ::mlir::OperationPass<>(other) {}
ResolveRankedShapeTypeResultDimsBase& operator=(const ResolveRankedShapeTypeResultDimsBase &) = delete;
ResolveRankedShapeTypeResultDimsBase(ResolveRankedShapeTypeResultDimsBase &&) = delete;
ResolveRankedShapeTypeResultDimsBase& operator=(ResolveRankedShapeTypeResultDimsBase &&) = delete;
~ResolveRankedShapeTypeResultDimsBase() = default;
static constexpr ::llvm::StringLiteral getArgumentName() {
return ::llvm::StringLiteral("resolve-ranked-shaped-type-result-dims");
}
::llvm::StringRef getArgument() const override { return "resolve-ranked-shaped-type-result-dims"; }
::llvm::StringRef getDescription() const override { return "Resolve memref.dim of result values of ranked shape type"; }
static constexpr ::llvm::StringLiteral getPassName() {
return ::llvm::StringLiteral("ResolveRankedShapeTypeResultDims");
}
::llvm::StringRef getName() const override { return "ResolveRankedShapeTypeResultDims"; }
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<memref::MemRefDialect>();
registry.insert<tensor::TensorDialect>();
}
MLIR_DEFINE_EXPLICIT_INTERNAL_INLINE_TYPE_ID(ResolveRankedShapeTypeResultDimsBase<DerivedT>)
protected:
private:
};
}
#undef GEN_PASS_DEF_RESOLVERANKEDSHAPETYPERESULTDIMS
#endif
#ifdef GEN_PASS_DECL_RESOLVESHAPEDTYPERESULTDIMS
#undef GEN_PASS_DECL_RESOLVESHAPEDTYPERESULTDIMS
#endif
#ifdef GEN_PASS_DEF_RESOLVESHAPEDTYPERESULTDIMS
namespace impl {
template <typename DerivedT>
class ResolveShapedTypeResultDimsBase : public ::mlir::OperationPass<> {
public:
using Base = ResolveShapedTypeResultDimsBase;
ResolveShapedTypeResultDimsBase() : ::mlir::OperationPass<>(::mlir::TypeID::get<DerivedT>()) {}
ResolveShapedTypeResultDimsBase(const ResolveShapedTypeResultDimsBase &other) : ::mlir::OperationPass<>(other) {}
ResolveShapedTypeResultDimsBase& operator=(const ResolveShapedTypeResultDimsBase &) = delete;
ResolveShapedTypeResultDimsBase(ResolveShapedTypeResultDimsBase &&) = delete;
ResolveShapedTypeResultDimsBase& operator=(ResolveShapedTypeResultDimsBase &&) = delete;
~ResolveShapedTypeResultDimsBase() = default;
static constexpr ::llvm::StringLiteral getArgumentName() {
return ::llvm::StringLiteral("resolve-shaped-type-result-dims");
}
::llvm::StringRef getArgument() const override { return "resolve-shaped-type-result-dims"; }
::llvm::StringRef getDescription() const override { return "Resolve memref.dim of result values"; }
static constexpr ::llvm::StringLiteral getPassName() {
return ::llvm::StringLiteral("ResolveShapedTypeResultDims");
}
::llvm::StringRef getName() const override { return "ResolveShapedTypeResultDims"; }
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<affine::AffineDialect>();
registry.insert<memref::MemRefDialect>();
registry.insert<tensor::TensorDialect>();
}
MLIR_DEFINE_EXPLICIT_INTERNAL_INLINE_TYPE_ID(ResolveShapedTypeResultDimsBase<DerivedT>)
protected:
private:
};
}
#undef GEN_PASS_DEF_RESOLVESHAPEDTYPERESULTDIMS
#endif
#ifdef GEN_PASS_REGISTRATION
inline void registerExpandOps() {
::mlir::registerPass([]() -> std::unique_ptr<::mlir::Pass> {
return mlir::memref::createExpandOpsPass();
});
}
inline void registerExpandOpsPass() {
::mlir::registerPass([]() -> std::unique_ptr<::mlir::Pass> {
return mlir::memref::createExpandOpsPass();
});
}
inline void registerExpandRealloc() {
::mlir::registerPass([]() -> std::unique_ptr<::mlir::Pass> {
return mlir::memref::createExpandReallocPass();
});
}
inline void registerExpandReallocPass() {
::mlir::registerPass([]() -> std::unique_ptr<::mlir::Pass> {
return mlir::memref::createExpandReallocPass();
});
}
inline void registerExpandStridedMetadata() {
::mlir::registerPass([]() -> std::unique_ptr<::mlir::Pass> {
return mlir::memref::createExpandStridedMetadataPass();
});
}
inline void registerExpandStridedMetadataPass() {
::mlir::registerPass([]() -> std::unique_ptr<::mlir::Pass> {
return mlir::memref::createExpandStridedMetadataPass();
});
}
inline void registerFoldMemRefAliasOps() {
::mlir::registerPass([]() -> std::unique_ptr<::mlir::Pass> {
return mlir::memref::createFoldMemRefAliasOpsPass();
});
}
inline void registerFoldMemRefAliasOpsPass() {
::mlir::registerPass([]() -> std::unique_ptr<::mlir::Pass> {
return mlir::memref::createFoldMemRefAliasOpsPass();
});
}
inline void registerMemRefEmulateWideInt() {
::mlir::registerPass([]() -> std::unique_ptr<::mlir::Pass> {
return createMemRefEmulateWideInt();
});
}
inline void registerMemRefEmulateWideIntPass() {
::mlir::registerPass([]() -> std::unique_ptr<::mlir::Pass> {
return createMemRefEmulateWideInt();
});
}
inline void registerNormalizeMemRefs() {
::mlir::registerPass([]() -> std::unique_ptr<::mlir::Pass> {
return mlir::memref::createNormalizeMemRefsPass();
});
}
inline void registerNormalizeMemRefsPass() {
::mlir::registerPass([]() -> std::unique_ptr<::mlir::Pass> {
return mlir::memref::createNormalizeMemRefsPass();
});
}
inline void registerResolveRankedShapeTypeResultDims() {
::mlir::registerPass([]() -> std::unique_ptr<::mlir::Pass> {
return mlir::memref::createResolveRankedShapeTypeResultDimsPass();
});
}
inline void registerResolveRankedShapeTypeResultDimsPass() {
::mlir::registerPass([]() -> std::unique_ptr<::mlir::Pass> {
return mlir::memref::createResolveRankedShapeTypeResultDimsPass();
});
}
inline void registerResolveShapedTypeResultDims() {
::mlir::registerPass([]() -> std::unique_ptr<::mlir::Pass> {
return mlir::memref::createResolveShapedTypeResultDimsPass();
});
}
inline void registerResolveShapedTypeResultDimsPass() {
::mlir::registerPass([]() -> std::unique_ptr<::mlir::Pass> {
return mlir::memref::createResolveShapedTypeResultDimsPass();
});
}
inline void registerMemRefPasses() {
registerExpandOps();
registerExpandRealloc();
registerExpandStridedMetadata();
registerFoldMemRefAliasOps();
registerMemRefEmulateWideInt();
registerNormalizeMemRefs();
registerResolveRankedShapeTypeResultDims();
registerResolveShapedTypeResultDims();
}
#undef GEN_PASS_REGISTRATION
#endif
#ifdef GEN_PASS_CLASSES
template <typename DerivedT>
class ExpandOpsBase : public ::mlir::OperationPass<> {
public:
using Base = ExpandOpsBase;
ExpandOpsBase() : ::mlir::OperationPass<>(::mlir::TypeID::get<DerivedT>()) {}
ExpandOpsBase(const ExpandOpsBase &other) : ::mlir::OperationPass<>(other) {}
ExpandOpsBase& operator=(const ExpandOpsBase &) = delete;
ExpandOpsBase(ExpandOpsBase &&) = delete;
ExpandOpsBase& operator=(ExpandOpsBase &&) = delete;
~ExpandOpsBase() = default;
static constexpr ::llvm::StringLiteral getArgumentName() {
return ::llvm::StringLiteral("memref-expand");
}
::llvm::StringRef getArgument() const override { return "memref-expand"; }
::llvm::StringRef getDescription() const override { return "Legalize memref operations to be convertible to LLVM."; }
static constexpr ::llvm::StringLiteral getPassName() {
return ::llvm::StringLiteral("ExpandOps");
}
::llvm::StringRef getName() const override { return "ExpandOps"; }
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(ExpandOpsBase<DerivedT>)
protected:
};
template <typename DerivedT>
class ExpandReallocBase : public ::mlir::OperationPass<> {
public:
using Base = ExpandReallocBase;
ExpandReallocBase() : ::mlir::OperationPass<>(::mlir::TypeID::get<DerivedT>()) {}
ExpandReallocBase(const ExpandReallocBase &other) : ::mlir::OperationPass<>(other) {}
ExpandReallocBase& operator=(const ExpandReallocBase &) = delete;
ExpandReallocBase(ExpandReallocBase &&) = delete;
ExpandReallocBase& operator=(ExpandReallocBase &&) = delete;
~ExpandReallocBase() = default;
static constexpr ::llvm::StringLiteral getArgumentName() {
return ::llvm::StringLiteral("expand-realloc");
}
::llvm::StringRef getArgument() const override { return "expand-realloc"; }
::llvm::StringRef getDescription() const override { return "Expand memref.realloc operations into its components"; }
static constexpr ::llvm::StringLiteral getPassName() {
return ::llvm::StringLiteral("ExpandRealloc");
}
::llvm::StringRef getName() const override { return "ExpandRealloc"; }
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<arith::ArithDialect>();
registry.insert<scf::SCFDialect>();
registry.insert<memref::MemRefDialect>();
}
MLIR_DEFINE_EXPLICIT_INTERNAL_INLINE_TYPE_ID(ExpandReallocBase<DerivedT>)
protected:
::mlir::Pass::Option<bool> emitDeallocs{*this, "emit-deallocs", ::llvm::cl::desc("Emit deallocation operations for the original MemRef"), ::llvm::cl::init(true)};
};
template <typename DerivedT>
class ExpandStridedMetadataBase : public ::mlir::OperationPass<> {
public:
using Base = ExpandStridedMetadataBase;
ExpandStridedMetadataBase() : ::mlir::OperationPass<>(::mlir::TypeID::get<DerivedT>()) {}
ExpandStridedMetadataBase(const ExpandStridedMetadataBase &other) : ::mlir::OperationPass<>(other) {}
ExpandStridedMetadataBase& operator=(const ExpandStridedMetadataBase &) = delete;
ExpandStridedMetadataBase(ExpandStridedMetadataBase &&) = delete;
ExpandStridedMetadataBase& operator=(ExpandStridedMetadataBase &&) = delete;
~ExpandStridedMetadataBase() = default;
static constexpr ::llvm::StringLiteral getArgumentName() {
return ::llvm::StringLiteral("expand-strided-metadata");
}
::llvm::StringRef getArgument() const override { return "expand-strided-metadata"; }
::llvm::StringRef getDescription() const override { return "Expand memref operations into easier to analyze constructs"; }
static constexpr ::llvm::StringLiteral getPassName() {
return ::llvm::StringLiteral("ExpandStridedMetadata");
}
::llvm::StringRef getName() const override { return "ExpandStridedMetadata"; }
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<affine::AffineDialect>();
registry.insert<memref::MemRefDialect>();
}
MLIR_DEFINE_EXPLICIT_INTERNAL_INLINE_TYPE_ID(ExpandStridedMetadataBase<DerivedT>)
protected:
};
template <typename DerivedT>
class FoldMemRefAliasOpsBase : public ::mlir::OperationPass<> {
public:
using Base = FoldMemRefAliasOpsBase;
FoldMemRefAliasOpsBase() : ::mlir::OperationPass<>(::mlir::TypeID::get<DerivedT>()) {}
FoldMemRefAliasOpsBase(const FoldMemRefAliasOpsBase &other) : ::mlir::OperationPass<>(other) {}
FoldMemRefAliasOpsBase& operator=(const FoldMemRefAliasOpsBase &) = delete;
FoldMemRefAliasOpsBase(FoldMemRefAliasOpsBase &&) = delete;
FoldMemRefAliasOpsBase& operator=(FoldMemRefAliasOpsBase &&) = delete;
~FoldMemRefAliasOpsBase() = default;
static constexpr ::llvm::StringLiteral getArgumentName() {
return ::llvm::StringLiteral("fold-memref-alias-ops");
}
::llvm::StringRef getArgument() const override { return "fold-memref-alias-ops"; }
::llvm::StringRef getDescription() const override { return "Fold memref alias ops into consumer load/store ops"; }
static constexpr ::llvm::StringLiteral getPassName() {
return ::llvm::StringLiteral("FoldMemRefAliasOps");
}
::llvm::StringRef getName() const override { return "FoldMemRefAliasOps"; }
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<affine::AffineDialect>();
registry.insert<memref::MemRefDialect>();
registry.insert<vector::VectorDialect>();
}
MLIR_DEFINE_EXPLICIT_INTERNAL_INLINE_TYPE_ID(FoldMemRefAliasOpsBase<DerivedT>)
protected:
};
template <typename DerivedT>
class MemRefEmulateWideIntBase : public ::mlir::OperationPass<> {
public:
using Base = MemRefEmulateWideIntBase;
MemRefEmulateWideIntBase() : ::mlir::OperationPass<>(::mlir::TypeID::get<DerivedT>()) {}
MemRefEmulateWideIntBase(const MemRefEmulateWideIntBase &other) : ::mlir::OperationPass<>(other) {}
MemRefEmulateWideIntBase& operator=(const MemRefEmulateWideIntBase &) = delete;
MemRefEmulateWideIntBase(MemRefEmulateWideIntBase &&) = delete;
MemRefEmulateWideIntBase& operator=(MemRefEmulateWideIntBase &&) = delete;
~MemRefEmulateWideIntBase() = default;
static constexpr ::llvm::StringLiteral getArgumentName() {
return ::llvm::StringLiteral("memref-emulate-wide-int");
}
::llvm::StringRef getArgument() const override { return "memref-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("MemRefEmulateWideInt");
}
::llvm::StringRef getName() const override { return "MemRefEmulateWideInt"; }
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(MemRefEmulateWideIntBase<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 NormalizeMemRefsBase : public ::mlir::OperationPass<ModuleOp> {
public:
using Base = NormalizeMemRefsBase;
NormalizeMemRefsBase() : ::mlir::OperationPass<ModuleOp>(::mlir::TypeID::get<DerivedT>()) {}
NormalizeMemRefsBase(const NormalizeMemRefsBase &other) : ::mlir::OperationPass<ModuleOp>(other) {}
NormalizeMemRefsBase& operator=(const NormalizeMemRefsBase &) = delete;
NormalizeMemRefsBase(NormalizeMemRefsBase &&) = delete;
NormalizeMemRefsBase& operator=(NormalizeMemRefsBase &&) = delete;
~NormalizeMemRefsBase() = default;
static constexpr ::llvm::StringLiteral getArgumentName() {
return ::llvm::StringLiteral("normalize-memrefs");
}
::llvm::StringRef getArgument() const override { return "normalize-memrefs"; }
::llvm::StringRef getDescription() const override { return "Normalize memrefs"; }
static constexpr ::llvm::StringLiteral getPassName() {
return ::llvm::StringLiteral("NormalizeMemRefs");
}
::llvm::StringRef getName() const override { return "NormalizeMemRefs"; }
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<affine::AffineDialect>();
}
MLIR_DEFINE_EXPLICIT_INTERNAL_INLINE_TYPE_ID(NormalizeMemRefsBase<DerivedT>)
protected:
};
template <typename DerivedT>
class ResolveRankedShapeTypeResultDimsBase : public ::mlir::OperationPass<> {
public:
using Base = ResolveRankedShapeTypeResultDimsBase;
ResolveRankedShapeTypeResultDimsBase() : ::mlir::OperationPass<>(::mlir::TypeID::get<DerivedT>()) {}
ResolveRankedShapeTypeResultDimsBase(const ResolveRankedShapeTypeResultDimsBase &other) : ::mlir::OperationPass<>(other) {}
ResolveRankedShapeTypeResultDimsBase& operator=(const ResolveRankedShapeTypeResultDimsBase &) = delete;
ResolveRankedShapeTypeResultDimsBase(ResolveRankedShapeTypeResultDimsBase &&) = delete;
ResolveRankedShapeTypeResultDimsBase& operator=(ResolveRankedShapeTypeResultDimsBase &&) = delete;
~ResolveRankedShapeTypeResultDimsBase() = default;
static constexpr ::llvm::StringLiteral getArgumentName() {
return ::llvm::StringLiteral("resolve-ranked-shaped-type-result-dims");
}
::llvm::StringRef getArgument() const override { return "resolve-ranked-shaped-type-result-dims"; }
::llvm::StringRef getDescription() const override { return "Resolve memref.dim of result values of ranked shape type"; }
static constexpr ::llvm::StringLiteral getPassName() {
return ::llvm::StringLiteral("ResolveRankedShapeTypeResultDims");
}
::llvm::StringRef getName() const override { return "ResolveRankedShapeTypeResultDims"; }
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<memref::MemRefDialect>();
registry.insert<tensor::TensorDialect>();
}
MLIR_DEFINE_EXPLICIT_INTERNAL_INLINE_TYPE_ID(ResolveRankedShapeTypeResultDimsBase<DerivedT>)
protected:
};
template <typename DerivedT>
class ResolveShapedTypeResultDimsBase : public ::mlir::OperationPass<> {
public:
using Base = ResolveShapedTypeResultDimsBase;
ResolveShapedTypeResultDimsBase() : ::mlir::OperationPass<>(::mlir::TypeID::get<DerivedT>()) {}
ResolveShapedTypeResultDimsBase(const ResolveShapedTypeResultDimsBase &other) : ::mlir::OperationPass<>(other) {}
ResolveShapedTypeResultDimsBase& operator=(const ResolveShapedTypeResultDimsBase &) = delete;
ResolveShapedTypeResultDimsBase(ResolveShapedTypeResultDimsBase &&) = delete;
ResolveShapedTypeResultDimsBase& operator=(ResolveShapedTypeResultDimsBase &&) = delete;
~ResolveShapedTypeResultDimsBase() = default;
static constexpr ::llvm::StringLiteral getArgumentName() {
return ::llvm::StringLiteral("resolve-shaped-type-result-dims");
}
::llvm::StringRef getArgument() const override { return "resolve-shaped-type-result-dims"; }
::llvm::StringRef getDescription() const override { return "Resolve memref.dim of result values"; }
static constexpr ::llvm::StringLiteral getPassName() {
return ::llvm::StringLiteral("ResolveShapedTypeResultDims");
}
::llvm::StringRef getName() const override { return "ResolveShapedTypeResultDims"; }
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<affine::AffineDialect>();
registry.insert<memref::MemRefDialect>();
registry.insert<tensor::TensorDialect>();
}
MLIR_DEFINE_EXPLICIT_INTERNAL_INLINE_TYPE_ID(ResolveShapedTypeResultDimsBase<DerivedT>)
protected:
};
#undef GEN_PASS_CLASSES
#endif