#ifdef GEN_PASS_DECL
#define GEN_PASS_DECL_OUTLINESHAPECOMPUTATION
#define GEN_PASS_DECL_REMOVESHAPECONSTRAINTS
#define GEN_PASS_DECL_SHAPETOSHAPELOWERING
#undef GEN_PASS_DECL
#endif
#ifdef GEN_PASS_DECL_OUTLINESHAPECOMPUTATION
#undef GEN_PASS_DECL_OUTLINESHAPECOMPUTATION
#endif
#ifdef GEN_PASS_DEF_OUTLINESHAPECOMPUTATION
namespace impl {
template <typename DerivedT>
class OutlineShapeComputationBase : public ::mlir::OperationPass<ModuleOp> {
public:
using Base = OutlineShapeComputationBase;
OutlineShapeComputationBase() : ::mlir::OperationPass<ModuleOp>(::mlir::TypeID::get<DerivedT>()) {}
OutlineShapeComputationBase(const OutlineShapeComputationBase &other) : ::mlir::OperationPass<ModuleOp>(other) {}
OutlineShapeComputationBase& operator=(const OutlineShapeComputationBase &) = delete;
OutlineShapeComputationBase(OutlineShapeComputationBase &&) = delete;
OutlineShapeComputationBase& operator=(OutlineShapeComputationBase &&) = delete;
~OutlineShapeComputationBase() = default;
static constexpr ::llvm::StringLiteral getArgumentName() {
return ::llvm::StringLiteral("outline-shape-computation");
}
::llvm::StringRef getArgument() const override { return "outline-shape-computation"; }
::llvm::StringRef getDescription() const override { return "Using shape.func to preserve shape computation"; }
static constexpr ::llvm::StringLiteral getPassName() {
return ::llvm::StringLiteral("OutlineShapeComputation");
}
::llvm::StringRef getName() const override { return "OutlineShapeComputation"; }
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<shape::ShapeDialect>();
}
MLIR_DEFINE_EXPLICIT_INTERNAL_INLINE_TYPE_ID(OutlineShapeComputationBase<DerivedT>)
protected:
private:
};
}
#undef GEN_PASS_DEF_OUTLINESHAPECOMPUTATION
#endif
#ifdef GEN_PASS_DECL_REMOVESHAPECONSTRAINTS
#undef GEN_PASS_DECL_REMOVESHAPECONSTRAINTS
#endif
#ifdef GEN_PASS_DEF_REMOVESHAPECONSTRAINTS
namespace impl {
template <typename DerivedT>
class RemoveShapeConstraintsBase : public ::mlir::OperationPass<func::FuncOp> {
public:
using Base = RemoveShapeConstraintsBase;
RemoveShapeConstraintsBase() : ::mlir::OperationPass<func::FuncOp>(::mlir::TypeID::get<DerivedT>()) {}
RemoveShapeConstraintsBase(const RemoveShapeConstraintsBase &other) : ::mlir::OperationPass<func::FuncOp>(other) {}
RemoveShapeConstraintsBase& operator=(const RemoveShapeConstraintsBase &) = delete;
RemoveShapeConstraintsBase(RemoveShapeConstraintsBase &&) = delete;
RemoveShapeConstraintsBase& operator=(RemoveShapeConstraintsBase &&) = delete;
~RemoveShapeConstraintsBase() = default;
static constexpr ::llvm::StringLiteral getArgumentName() {
return ::llvm::StringLiteral("remove-shape-constraints");
}
::llvm::StringRef getArgument() const override { return "remove-shape-constraints"; }
::llvm::StringRef getDescription() const override { return "Replace all cstr_ ops with a true witness"; }
static constexpr ::llvm::StringLiteral getPassName() {
return ::llvm::StringLiteral("RemoveShapeConstraints");
}
::llvm::StringRef getName() const override { return "RemoveShapeConstraints"; }
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(RemoveShapeConstraintsBase<DerivedT>)
protected:
private:
};
}
#undef GEN_PASS_DEF_REMOVESHAPECONSTRAINTS
#endif
#ifdef GEN_PASS_DECL_SHAPETOSHAPELOWERING
#undef GEN_PASS_DECL_SHAPETOSHAPELOWERING
#endif
#ifdef GEN_PASS_DEF_SHAPETOSHAPELOWERING
namespace impl {
template <typename DerivedT>
class ShapeToShapeLoweringBase : public ::mlir::OperationPass<func::FuncOp> {
public:
using Base = ShapeToShapeLoweringBase;
ShapeToShapeLoweringBase() : ::mlir::OperationPass<func::FuncOp>(::mlir::TypeID::get<DerivedT>()) {}
ShapeToShapeLoweringBase(const ShapeToShapeLoweringBase &other) : ::mlir::OperationPass<func::FuncOp>(other) {}
ShapeToShapeLoweringBase& operator=(const ShapeToShapeLoweringBase &) = delete;
ShapeToShapeLoweringBase(ShapeToShapeLoweringBase &&) = delete;
ShapeToShapeLoweringBase& operator=(ShapeToShapeLoweringBase &&) = delete;
~ShapeToShapeLoweringBase() = default;
static constexpr ::llvm::StringLiteral getArgumentName() {
return ::llvm::StringLiteral("shape-to-shape-lowering");
}
::llvm::StringRef getArgument() const override { return "shape-to-shape-lowering"; }
::llvm::StringRef getDescription() const override { return "Legalize Shape dialect to be convertible to Arith"; }
static constexpr ::llvm::StringLiteral getPassName() {
return ::llvm::StringLiteral("ShapeToShapeLowering");
}
::llvm::StringRef getName() const override { return "ShapeToShapeLowering"; }
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(ShapeToShapeLoweringBase<DerivedT>)
protected:
private:
};
}
#undef GEN_PASS_DEF_SHAPETOSHAPELOWERING
#endif
#ifdef GEN_PASS_REGISTRATION
inline void registerOutlineShapeComputation() {
::mlir::registerPass([]() -> std::unique_ptr<::mlir::Pass> {
return mlir::createOutlineShapeComputationPass();
});
}
inline void registerOutlineShapeComputationPass() {
::mlir::registerPass([]() -> std::unique_ptr<::mlir::Pass> {
return mlir::createOutlineShapeComputationPass();
});
}
inline void registerRemoveShapeConstraints() {
::mlir::registerPass([]() -> std::unique_ptr<::mlir::Pass> {
return mlir::createRemoveShapeConstraintsPass();
});
}
inline void registerRemoveShapeConstraintsPass() {
::mlir::registerPass([]() -> std::unique_ptr<::mlir::Pass> {
return mlir::createRemoveShapeConstraintsPass();
});
}
inline void registerShapeToShapeLowering() {
::mlir::registerPass([]() -> std::unique_ptr<::mlir::Pass> {
return mlir::createShapeToShapeLowering();
});
}
inline void registerShapeToShapeLoweringPass() {
::mlir::registerPass([]() -> std::unique_ptr<::mlir::Pass> {
return mlir::createShapeToShapeLowering();
});
}
inline void registerShapePasses() {
registerOutlineShapeComputation();
registerRemoveShapeConstraints();
registerShapeToShapeLowering();
}
#undef GEN_PASS_REGISTRATION
#endif
#ifdef GEN_PASS_CLASSES
template <typename DerivedT>
class OutlineShapeComputationBase : public ::mlir::OperationPass<ModuleOp> {
public:
using Base = OutlineShapeComputationBase;
OutlineShapeComputationBase() : ::mlir::OperationPass<ModuleOp>(::mlir::TypeID::get<DerivedT>()) {}
OutlineShapeComputationBase(const OutlineShapeComputationBase &other) : ::mlir::OperationPass<ModuleOp>(other) {}
OutlineShapeComputationBase& operator=(const OutlineShapeComputationBase &) = delete;
OutlineShapeComputationBase(OutlineShapeComputationBase &&) = delete;
OutlineShapeComputationBase& operator=(OutlineShapeComputationBase &&) = delete;
~OutlineShapeComputationBase() = default;
static constexpr ::llvm::StringLiteral getArgumentName() {
return ::llvm::StringLiteral("outline-shape-computation");
}
::llvm::StringRef getArgument() const override { return "outline-shape-computation"; }
::llvm::StringRef getDescription() const override { return "Using shape.func to preserve shape computation"; }
static constexpr ::llvm::StringLiteral getPassName() {
return ::llvm::StringLiteral("OutlineShapeComputation");
}
::llvm::StringRef getName() const override { return "OutlineShapeComputation"; }
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<shape::ShapeDialect>();
}
MLIR_DEFINE_EXPLICIT_INTERNAL_INLINE_TYPE_ID(OutlineShapeComputationBase<DerivedT>)
protected:
};
template <typename DerivedT>
class RemoveShapeConstraintsBase : public ::mlir::OperationPass<func::FuncOp> {
public:
using Base = RemoveShapeConstraintsBase;
RemoveShapeConstraintsBase() : ::mlir::OperationPass<func::FuncOp>(::mlir::TypeID::get<DerivedT>()) {}
RemoveShapeConstraintsBase(const RemoveShapeConstraintsBase &other) : ::mlir::OperationPass<func::FuncOp>(other) {}
RemoveShapeConstraintsBase& operator=(const RemoveShapeConstraintsBase &) = delete;
RemoveShapeConstraintsBase(RemoveShapeConstraintsBase &&) = delete;
RemoveShapeConstraintsBase& operator=(RemoveShapeConstraintsBase &&) = delete;
~RemoveShapeConstraintsBase() = default;
static constexpr ::llvm::StringLiteral getArgumentName() {
return ::llvm::StringLiteral("remove-shape-constraints");
}
::llvm::StringRef getArgument() const override { return "remove-shape-constraints"; }
::llvm::StringRef getDescription() const override { return "Replace all cstr_ ops with a true witness"; }
static constexpr ::llvm::StringLiteral getPassName() {
return ::llvm::StringLiteral("RemoveShapeConstraints");
}
::llvm::StringRef getName() const override { return "RemoveShapeConstraints"; }
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(RemoveShapeConstraintsBase<DerivedT>)
protected:
};
template <typename DerivedT>
class ShapeToShapeLoweringBase : public ::mlir::OperationPass<func::FuncOp> {
public:
using Base = ShapeToShapeLoweringBase;
ShapeToShapeLoweringBase() : ::mlir::OperationPass<func::FuncOp>(::mlir::TypeID::get<DerivedT>()) {}
ShapeToShapeLoweringBase(const ShapeToShapeLoweringBase &other) : ::mlir::OperationPass<func::FuncOp>(other) {}
ShapeToShapeLoweringBase& operator=(const ShapeToShapeLoweringBase &) = delete;
ShapeToShapeLoweringBase(ShapeToShapeLoweringBase &&) = delete;
ShapeToShapeLoweringBase& operator=(ShapeToShapeLoweringBase &&) = delete;
~ShapeToShapeLoweringBase() = default;
static constexpr ::llvm::StringLiteral getArgumentName() {
return ::llvm::StringLiteral("shape-to-shape-lowering");
}
::llvm::StringRef getArgument() const override { return "shape-to-shape-lowering"; }
::llvm::StringRef getDescription() const override { return "Legalize Shape dialect to be convertible to Arith"; }
static constexpr ::llvm::StringLiteral getPassName() {
return ::llvm::StringLiteral("ShapeToShapeLowering");
}
::llvm::StringRef getName() const override { return "ShapeToShapeLowering"; }
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(ShapeToShapeLoweringBase<DerivedT>)
protected:
};
#undef GEN_PASS_CLASSES
#endif