/* Autogenerated by mlir-tblgen; don't manually edit */

#ifdef GEN_PASS_DECL
// Generate declarations for all passes.
#define GEN_PASS_DECL_LOWERFOREACHTOSCF
#define GEN_PASS_DECL_LOWERSPARSEITERATIONTOSCF
#define GEN_PASS_DECL_LOWERSPARSEOPSTOFOREACH
#define GEN_PASS_DECL_PRESPARSIFICATIONREWRITE
#define GEN_PASS_DECL_SPARSEASSEMBLER
#define GEN_PASS_DECL_SPARSEBUFFERREWRITE
#define GEN_PASS_DECL_SPARSEGPUCODEGEN
#define GEN_PASS_DECL_SPARSEREINTERPRETMAP
#define GEN_PASS_DECL_SPARSESPACECOLLAPSE
#define GEN_PASS_DECL_SPARSETENSORCODEGEN
#define GEN_PASS_DECL_SPARSETENSORCONVERSIONPASS
#define GEN_PASS_DECL_SPARSEVECTORIZATION
#define GEN_PASS_DECL_SPARSIFICATIONANDBUFFERIZATION
#define GEN_PASS_DECL_SPARSIFICATIONPASS
#define GEN_PASS_DECL_STAGESPARSEOPERATIONS
#define GEN_PASS_DECL_STORAGESPECIFIERTOLLVM
#undef GEN_PASS_DECL
#endif // GEN_PASS_DECL

//===----------------------------------------------------------------------===//
// LowerForeachToSCF
//===----------------------------------------------------------------------===//
#ifdef GEN_PASS_DECL_LOWERFOREACHTOSCF
#undef GEN_PASS_DECL_LOWERFOREACHTOSCF
#endif // GEN_PASS_DECL_LOWERFOREACHTOSCF
#ifdef GEN_PASS_DEF_LOWERFOREACHTOSCF
namespace impl {

template <typename DerivedT>
class LowerForeachToSCFBase : public ::mlir::OperationPass<func::FuncOp> {
public:
  using Base = LowerForeachToSCFBase;

  LowerForeachToSCFBase() : ::mlir::OperationPass<func::FuncOp>(::mlir::TypeID::get<DerivedT>()) {}
  LowerForeachToSCFBase(const LowerForeachToSCFBase &other) : ::mlir::OperationPass<func::FuncOp>(other) {}
  LowerForeachToSCFBase& operator=(const LowerForeachToSCFBase &) = delete;
  LowerForeachToSCFBase(LowerForeachToSCFBase &&) = delete;
  LowerForeachToSCFBase& operator=(LowerForeachToSCFBase &&) = delete;
  ~LowerForeachToSCFBase() = default;

  /// Returns the command-line argument attached to this pass.
  static constexpr ::llvm::StringLiteral getArgumentName() {
    return ::llvm::StringLiteral("lower-sparse-foreach-to-scf");
  }
  ::llvm::StringRef getArgument() const override { return "lower-sparse-foreach-to-scf"; }

  ::llvm::StringRef getDescription() const override { return R"PD(Decompose a complex sparse operation into multiple stages)PD"; }

  /// Returns the derived pass name.
  static constexpr ::llvm::StringLiteral getPassName() {
    return ::llvm::StringLiteral("LowerForeachToSCF");
  }
  ::llvm::StringRef getName() const override { return "LowerForeachToSCF"; }

  /// Support isa/dyn_cast functionality for the derived pass class.
  static bool classof(const ::mlir::Pass *pass) {
    return pass->getTypeID() == ::mlir::TypeID::get<DerivedT>();
  }

  /// A clone method to create a copy of this pass.
  std::unique_ptr<::mlir::Pass> clonePass() const override {
    return std::make_unique<DerivedT>(*static_cast<const DerivedT *>(this));
  }

  /// Return the dialect that must be loaded in the context before this pass.
  void getDependentDialects(::mlir::DialectRegistry &registry) const override {
    registry.insert<memref::MemRefDialect>();
    registry.insert<scf::SCFDialect>();
    registry.insert<sparse_tensor::SparseTensorDialect>();
  }

  /// Explicitly declare the TypeID for this class. We declare an explicit private
  /// instantiation because Pass classes should only be visible by the current
  /// library.
  MLIR_DEFINE_EXPLICIT_INTERNAL_INLINE_TYPE_ID(LowerForeachToSCFBase<DerivedT>)

protected:
private:
};
} // namespace impl
#undef GEN_PASS_DEF_LOWERFOREACHTOSCF
#endif // GEN_PASS_DEF_LOWERFOREACHTOSCF

//===----------------------------------------------------------------------===//
// LowerSparseIterationToSCF
//===----------------------------------------------------------------------===//
#ifdef GEN_PASS_DECL_LOWERSPARSEITERATIONTOSCF
#undef GEN_PASS_DECL_LOWERSPARSEITERATIONTOSCF
#endif // GEN_PASS_DECL_LOWERSPARSEITERATIONTOSCF
#ifdef GEN_PASS_DEF_LOWERSPARSEITERATIONTOSCF
namespace impl {

template <typename DerivedT>
class LowerSparseIterationToSCFBase : public ::mlir::OperationPass<func::FuncOp> {
public:
  using Base = LowerSparseIterationToSCFBase;

  LowerSparseIterationToSCFBase() : ::mlir::OperationPass<func::FuncOp>(::mlir::TypeID::get<DerivedT>()) {}
  LowerSparseIterationToSCFBase(const LowerSparseIterationToSCFBase &other) : ::mlir::OperationPass<func::FuncOp>(other) {}
  LowerSparseIterationToSCFBase& operator=(const LowerSparseIterationToSCFBase &) = delete;
  LowerSparseIterationToSCFBase(LowerSparseIterationToSCFBase &&) = delete;
  LowerSparseIterationToSCFBase& operator=(LowerSparseIterationToSCFBase &&) = delete;
  ~LowerSparseIterationToSCFBase() = default;

  /// Returns the command-line argument attached to this pass.
  static constexpr ::llvm::StringLiteral getArgumentName() {
    return ::llvm::StringLiteral("lower-sparse-iteration-to-scf");
  }
  ::llvm::StringRef getArgument() const override { return "lower-sparse-iteration-to-scf"; }

  ::llvm::StringRef getDescription() const override { return R"PD(lower sparse_tensor.iterate/coiterate into scf loops)PD"; }

  /// Returns the derived pass name.
  static constexpr ::llvm::StringLiteral getPassName() {
    return ::llvm::StringLiteral("LowerSparseIterationToSCF");
  }
  ::llvm::StringRef getName() const override { return "LowerSparseIterationToSCF"; }

  /// Support isa/dyn_cast functionality for the derived pass class.
  static bool classof(const ::mlir::Pass *pass) {
    return pass->getTypeID() == ::mlir::TypeID::get<DerivedT>();
  }

  /// A clone method to create a copy of this pass.
  std::unique_ptr<::mlir::Pass> clonePass() const override {
    return std::make_unique<DerivedT>(*static_cast<const DerivedT *>(this));
  }

  /// Return the dialect that must be loaded in the context before this pass.
  void getDependentDialects(::mlir::DialectRegistry &registry) const override {
    registry.insert<memref::MemRefDialect>();
    registry.insert<scf::SCFDialect>();
    registry.insert<sparse_tensor::SparseTensorDialect>();
  }

  /// Explicitly declare the TypeID for this class. We declare an explicit private
  /// instantiation because Pass classes should only be visible by the current
  /// library.
  MLIR_DEFINE_EXPLICIT_INTERNAL_INLINE_TYPE_ID(LowerSparseIterationToSCFBase<DerivedT>)

protected:
private:
};
} // namespace impl
#undef GEN_PASS_DEF_LOWERSPARSEITERATIONTOSCF
#endif // GEN_PASS_DEF_LOWERSPARSEITERATIONTOSCF

//===----------------------------------------------------------------------===//
// LowerSparseOpsToForeach
//===----------------------------------------------------------------------===//
#ifdef GEN_PASS_DECL_LOWERSPARSEOPSTOFOREACH
struct LowerSparseOpsToForeachOptions {
  bool enableRuntimeLibrary = true;
  bool enableConvert = true;
};
#undef GEN_PASS_DECL_LOWERSPARSEOPSTOFOREACH
#endif // GEN_PASS_DECL_LOWERSPARSEOPSTOFOREACH
#ifdef GEN_PASS_DEF_LOWERSPARSEOPSTOFOREACH
namespace impl {

template <typename DerivedT>
class LowerSparseOpsToForeachBase : public ::mlir::OperationPass<ModuleOp> {
public:
  using Base = LowerSparseOpsToForeachBase;

  LowerSparseOpsToForeachBase() : ::mlir::OperationPass<ModuleOp>(::mlir::TypeID::get<DerivedT>()) {}
  LowerSparseOpsToForeachBase(const LowerSparseOpsToForeachBase &other) : ::mlir::OperationPass<ModuleOp>(other) {}
  LowerSparseOpsToForeachBase& operator=(const LowerSparseOpsToForeachBase &) = delete;
  LowerSparseOpsToForeachBase(LowerSparseOpsToForeachBase &&) = delete;
  LowerSparseOpsToForeachBase& operator=(LowerSparseOpsToForeachBase &&) = delete;
  ~LowerSparseOpsToForeachBase() = default;

  /// Returns the command-line argument attached to this pass.
  static constexpr ::llvm::StringLiteral getArgumentName() {
    return ::llvm::StringLiteral("lower-sparse-ops-to-foreach");
  }
  ::llvm::StringRef getArgument() const override { return "lower-sparse-ops-to-foreach"; }

  ::llvm::StringRef getDescription() const override { return R"PD(Applies sparse tensor rewriting rules after sparsification)PD"; }

  /// Returns the derived pass name.
  static constexpr ::llvm::StringLiteral getPassName() {
    return ::llvm::StringLiteral("LowerSparseOpsToForeach");
  }
  ::llvm::StringRef getName() const override { return "LowerSparseOpsToForeach"; }

  /// Support isa/dyn_cast functionality for the derived pass class.
  static bool classof(const ::mlir::Pass *pass) {
    return pass->getTypeID() == ::mlir::TypeID::get<DerivedT>();
  }

  /// A clone method to create a copy of this pass.
  std::unique_ptr<::mlir::Pass> clonePass() const override {
    return std::make_unique<DerivedT>(*static_cast<const DerivedT *>(this));
  }

  /// Return the dialect that must be loaded in the context before this pass.
  void getDependentDialects(::mlir::DialectRegistry &registry) const override {
    registry.insert<affine::AffineDialect>();
    registry.insert<arith::ArithDialect>();
    registry.insert<bufferization::BufferizationDialect>();
    registry.insert<linalg::LinalgDialect>();
    registry.insert<memref::MemRefDialect>();
    registry.insert<scf::SCFDialect>();
    registry.insert<sparse_tensor::SparseTensorDialect>();
  }

  /// Explicitly declare the TypeID for this class. We declare an explicit private
  /// instantiation because Pass classes should only be visible by the current
  /// library.
  MLIR_DEFINE_EXPLICIT_INTERNAL_INLINE_TYPE_ID(LowerSparseOpsToForeachBase<DerivedT>)

  LowerSparseOpsToForeachBase(LowerSparseOpsToForeachOptions options) : LowerSparseOpsToForeachBase() {
    enableRuntimeLibrary = std::move(options.enableRuntimeLibrary);
    enableConvert = std::move(options.enableConvert);
  }
protected:
  ::mlir::Pass::Option<bool> enableRuntimeLibrary{*this, "enable-runtime-library", ::llvm::cl::desc(R"PO(Enable runtime library for manipulating sparse tensors)PO"), ::llvm::cl::init(true)};
  ::mlir::Pass::Option<bool> enableConvert{*this, "enable-convert", ::llvm::cl::desc(R"PO(Enable rewriting rules for the convert operator)PO"), ::llvm::cl::init(true)};
private:
};
} // namespace impl
#undef GEN_PASS_DEF_LOWERSPARSEOPSTOFOREACH
#endif // GEN_PASS_DEF_LOWERSPARSEOPSTOFOREACH

//===----------------------------------------------------------------------===//
// PreSparsificationRewrite
//===----------------------------------------------------------------------===//
#ifdef GEN_PASS_DECL_PRESPARSIFICATIONREWRITE
#undef GEN_PASS_DECL_PRESPARSIFICATIONREWRITE
#endif // GEN_PASS_DECL_PRESPARSIFICATIONREWRITE
#ifdef GEN_PASS_DEF_PRESPARSIFICATIONREWRITE
namespace impl {

template <typename DerivedT>
class PreSparsificationRewriteBase : public ::mlir::OperationPass<ModuleOp> {
public:
  using Base = PreSparsificationRewriteBase;

  PreSparsificationRewriteBase() : ::mlir::OperationPass<ModuleOp>(::mlir::TypeID::get<DerivedT>()) {}
  PreSparsificationRewriteBase(const PreSparsificationRewriteBase &other) : ::mlir::OperationPass<ModuleOp>(other) {}
  PreSparsificationRewriteBase& operator=(const PreSparsificationRewriteBase &) = delete;
  PreSparsificationRewriteBase(PreSparsificationRewriteBase &&) = delete;
  PreSparsificationRewriteBase& operator=(PreSparsificationRewriteBase &&) = delete;
  ~PreSparsificationRewriteBase() = default;

  /// Returns the command-line argument attached to this pass.
  static constexpr ::llvm::StringLiteral getArgumentName() {
    return ::llvm::StringLiteral("pre-sparsification-rewrite");
  }
  ::llvm::StringRef getArgument() const override { return "pre-sparsification-rewrite"; }

  ::llvm::StringRef getDescription() const override { return R"PD(Applies sparse tensor rewriting rules prior to sparsification)PD"; }

  /// Returns the derived pass name.
  static constexpr ::llvm::StringLiteral getPassName() {
    return ::llvm::StringLiteral("PreSparsificationRewrite");
  }
  ::llvm::StringRef getName() const override { return "PreSparsificationRewrite"; }

  /// Support isa/dyn_cast functionality for the derived pass class.
  static bool classof(const ::mlir::Pass *pass) {
    return pass->getTypeID() == ::mlir::TypeID::get<DerivedT>();
  }

  /// A clone method to create a copy of this pass.
  std::unique_ptr<::mlir::Pass> clonePass() const override {
    return std::make_unique<DerivedT>(*static_cast<const DerivedT *>(this));
  }

  /// Return the dialect that must be loaded in the context before this pass.
  void getDependentDialects(::mlir::DialectRegistry &registry) const override {
    registry.insert<arith::ArithDialect>();
    registry.insert<bufferization::BufferizationDialect>();
    registry.insert<linalg::LinalgDialect>();
    registry.insert<memref::MemRefDialect>();
    registry.insert<scf::SCFDialect>();
    registry.insert<sparse_tensor::SparseTensorDialect>();
  }

  /// Explicitly declare the TypeID for this class. We declare an explicit private
  /// instantiation because Pass classes should only be visible by the current
  /// library.
  MLIR_DEFINE_EXPLICIT_INTERNAL_INLINE_TYPE_ID(PreSparsificationRewriteBase<DerivedT>)

protected:
private:
};
} // namespace impl
#undef GEN_PASS_DEF_PRESPARSIFICATIONREWRITE
#endif // GEN_PASS_DEF_PRESPARSIFICATIONREWRITE

//===----------------------------------------------------------------------===//
// SparseAssembler
//===----------------------------------------------------------------------===//
#ifdef GEN_PASS_DECL_SPARSEASSEMBLER
struct SparseAssemblerOptions {
  bool directOut = false;
};
#undef GEN_PASS_DECL_SPARSEASSEMBLER
#endif // GEN_PASS_DECL_SPARSEASSEMBLER
#ifdef GEN_PASS_DEF_SPARSEASSEMBLER
namespace impl {

template <typename DerivedT>
class SparseAssemblerBase : public ::mlir::OperationPass<ModuleOp> {
public:
  using Base = SparseAssemblerBase;

  SparseAssemblerBase() : ::mlir::OperationPass<ModuleOp>(::mlir::TypeID::get<DerivedT>()) {}
  SparseAssemblerBase(const SparseAssemblerBase &other) : ::mlir::OperationPass<ModuleOp>(other) {}
  SparseAssemblerBase& operator=(const SparseAssemblerBase &) = delete;
  SparseAssemblerBase(SparseAssemblerBase &&) = delete;
  SparseAssemblerBase& operator=(SparseAssemblerBase &&) = delete;
  ~SparseAssemblerBase() = default;

  /// Returns the command-line argument attached to this pass.
  static constexpr ::llvm::StringLiteral getArgumentName() {
    return ::llvm::StringLiteral("sparse-assembler");
  }
  ::llvm::StringRef getArgument() const override { return "sparse-assembler"; }

  ::llvm::StringRef getDescription() const override { return R"PD(Add [dis]assemble operations on external sparse tensors)PD"; }

  /// Returns the derived pass name.
  static constexpr ::llvm::StringLiteral getPassName() {
    return ::llvm::StringLiteral("SparseAssembler");
  }
  ::llvm::StringRef getName() const override { return "SparseAssembler"; }

  /// Support isa/dyn_cast functionality for the derived pass class.
  static bool classof(const ::mlir::Pass *pass) {
    return pass->getTypeID() == ::mlir::TypeID::get<DerivedT>();
  }

  /// A clone method to create a copy of this pass.
  std::unique_ptr<::mlir::Pass> clonePass() const override {
    return std::make_unique<DerivedT>(*static_cast<const DerivedT *>(this));
  }

  /// Return the dialect that must be loaded in the context before this pass.
  void getDependentDialects(::mlir::DialectRegistry &registry) const override {
    registry.insert<bufferization::BufferizationDialect>();
    registry.insert<sparse_tensor::SparseTensorDialect>();
    registry.insert<tensor::TensorDialect>();
  }

  /// Explicitly declare the TypeID for this class. We declare an explicit private
  /// instantiation because Pass classes should only be visible by the current
  /// library.
  MLIR_DEFINE_EXPLICIT_INTERNAL_INLINE_TYPE_ID(SparseAssemblerBase<DerivedT>)

  SparseAssemblerBase(SparseAssemblerOptions options) : SparseAssemblerBase() {
    directOut = std::move(options.directOut);
  }
protected:
  ::mlir::Pass::Option<bool> directOut{*this, "direct-out", ::llvm::cl::desc(R"PO(Directly returns buffers externally)PO"), ::llvm::cl::init(false)};
private:
};
} // namespace impl
#undef GEN_PASS_DEF_SPARSEASSEMBLER
#endif // GEN_PASS_DEF_SPARSEASSEMBLER

//===----------------------------------------------------------------------===//
// SparseBufferRewrite
//===----------------------------------------------------------------------===//
#ifdef GEN_PASS_DECL_SPARSEBUFFERREWRITE
struct SparseBufferRewriteOptions {
  bool enableBufferInitialization = false;
};
#undef GEN_PASS_DECL_SPARSEBUFFERREWRITE
#endif // GEN_PASS_DECL_SPARSEBUFFERREWRITE
#ifdef GEN_PASS_DEF_SPARSEBUFFERREWRITE
namespace impl {

template <typename DerivedT>
class SparseBufferRewriteBase : public ::mlir::OperationPass<ModuleOp> {
public:
  using Base = SparseBufferRewriteBase;

  SparseBufferRewriteBase() : ::mlir::OperationPass<ModuleOp>(::mlir::TypeID::get<DerivedT>()) {}
  SparseBufferRewriteBase(const SparseBufferRewriteBase &other) : ::mlir::OperationPass<ModuleOp>(other) {}
  SparseBufferRewriteBase& operator=(const SparseBufferRewriteBase &) = delete;
  SparseBufferRewriteBase(SparseBufferRewriteBase &&) = delete;
  SparseBufferRewriteBase& operator=(SparseBufferRewriteBase &&) = delete;
  ~SparseBufferRewriteBase() = default;

  /// Returns the command-line argument attached to this pass.
  static constexpr ::llvm::StringLiteral getArgumentName() {
    return ::llvm::StringLiteral("sparse-buffer-rewrite");
  }
  ::llvm::StringRef getArgument() const override { return "sparse-buffer-rewrite"; }

  ::llvm::StringRef getDescription() const override { return R"PD(Rewrite sparse primitives on buffers to actual code)PD"; }

  /// Returns the derived pass name.
  static constexpr ::llvm::StringLiteral getPassName() {
    return ::llvm::StringLiteral("SparseBufferRewrite");
  }
  ::llvm::StringRef getName() const override { return "SparseBufferRewrite"; }

  /// Support isa/dyn_cast functionality for the derived pass class.
  static bool classof(const ::mlir::Pass *pass) {
    return pass->getTypeID() == ::mlir::TypeID::get<DerivedT>();
  }

  /// A clone method to create a copy of this pass.
  std::unique_ptr<::mlir::Pass> clonePass() const override {
    return std::make_unique<DerivedT>(*static_cast<const DerivedT *>(this));
  }

  /// Return the dialect that must be loaded in the context before this pass.
  void getDependentDialects(::mlir::DialectRegistry &registry) const override {
    registry.insert<arith::ArithDialect>();
    registry.insert<linalg::LinalgDialect>();
    registry.insert<memref::MemRefDialect>();
    registry.insert<scf::SCFDialect>();
    registry.insert<sparse_tensor::SparseTensorDialect>();
  }

  /// Explicitly declare the TypeID for this class. We declare an explicit private
  /// instantiation because Pass classes should only be visible by the current
  /// library.
  MLIR_DEFINE_EXPLICIT_INTERNAL_INLINE_TYPE_ID(SparseBufferRewriteBase<DerivedT>)

  SparseBufferRewriteBase(SparseBufferRewriteOptions options) : SparseBufferRewriteBase() {
    enableBufferInitialization = std::move(options.enableBufferInitialization);
  }
protected:
  ::mlir::Pass::Option<bool> enableBufferInitialization{*this, "enable-buffer-initialization", ::llvm::cl::desc(R"PO(Enable zero-initialization of the memory buffers)PO"), ::llvm::cl::init(false)};
private:
};
} // namespace impl
#undef GEN_PASS_DEF_SPARSEBUFFERREWRITE
#endif // GEN_PASS_DEF_SPARSEBUFFERREWRITE

//===----------------------------------------------------------------------===//
// SparseGPUCodegen
//===----------------------------------------------------------------------===//
#ifdef GEN_PASS_DECL_SPARSEGPUCODEGEN
struct SparseGPUCodegenOptions {
  int32_t numThreads = 1024;
  bool enableRuntimeLibrary = true;
};
#undef GEN_PASS_DECL_SPARSEGPUCODEGEN
#endif // GEN_PASS_DECL_SPARSEGPUCODEGEN
#ifdef GEN_PASS_DEF_SPARSEGPUCODEGEN
namespace impl {

template <typename DerivedT>
class SparseGPUCodegenBase : public ::mlir::OperationPass<ModuleOp> {
public:
  using Base = SparseGPUCodegenBase;

  SparseGPUCodegenBase() : ::mlir::OperationPass<ModuleOp>(::mlir::TypeID::get<DerivedT>()) {}
  SparseGPUCodegenBase(const SparseGPUCodegenBase &other) : ::mlir::OperationPass<ModuleOp>(other) {}
  SparseGPUCodegenBase& operator=(const SparseGPUCodegenBase &) = delete;
  SparseGPUCodegenBase(SparseGPUCodegenBase &&) = delete;
  SparseGPUCodegenBase& operator=(SparseGPUCodegenBase &&) = delete;
  ~SparseGPUCodegenBase() = default;

  /// Returns the command-line argument attached to this pass.
  static constexpr ::llvm::StringLiteral getArgumentName() {
    return ::llvm::StringLiteral("sparse-gpu-codegen");
  }
  ::llvm::StringRef getArgument() const override { return "sparse-gpu-codegen"; }

  ::llvm::StringRef getDescription() const override { return R"PD(Generates GPU code during sparsification)PD"; }

  /// Returns the derived pass name.
  static constexpr ::llvm::StringLiteral getPassName() {
    return ::llvm::StringLiteral("SparseGPUCodegen");
  }
  ::llvm::StringRef getName() const override { return "SparseGPUCodegen"; }

  /// Support isa/dyn_cast functionality for the derived pass class.
  static bool classof(const ::mlir::Pass *pass) {
    return pass->getTypeID() == ::mlir::TypeID::get<DerivedT>();
  }

  /// A clone method to create a copy of this pass.
  std::unique_ptr<::mlir::Pass> clonePass() const override {
    return std::make_unique<DerivedT>(*static_cast<const DerivedT *>(this));
  }

  /// Return the dialect that must be loaded in the context before this pass.
  void getDependentDialects(::mlir::DialectRegistry &registry) const override {
    registry.insert<arith::ArithDialect>();
    registry.insert<bufferization::BufferizationDialect>();
    registry.insert<gpu::GPUDialect>();
    registry.insert<linalg::LinalgDialect>();
    registry.insert<memref::MemRefDialect>();
    registry.insert<scf::SCFDialect>();
    registry.insert<sparse_tensor::SparseTensorDialect>();
  }

  /// Explicitly declare the TypeID for this class. We declare an explicit private
  /// instantiation because Pass classes should only be visible by the current
  /// library.
  MLIR_DEFINE_EXPLICIT_INTERNAL_INLINE_TYPE_ID(SparseGPUCodegenBase<DerivedT>)

  SparseGPUCodegenBase(SparseGPUCodegenOptions options) : SparseGPUCodegenBase() {
    numThreads = std::move(options.numThreads);
    enableRuntimeLibrary = std::move(options.enableRuntimeLibrary);
  }
protected:
  ::mlir::Pass::Option<int32_t> numThreads{*this, "num-threads", ::llvm::cl::desc(R"PO(Sets the number of GPU threads)PO"), ::llvm::cl::init(1024)};
  ::mlir::Pass::Option<bool> enableRuntimeLibrary{*this, "enable-runtime-library", ::llvm::cl::desc(R"PO(Enable runtime library for manipulating sparse tensors)PO"), ::llvm::cl::init(true)};
private:
};
} // namespace impl
#undef GEN_PASS_DEF_SPARSEGPUCODEGEN
#endif // GEN_PASS_DEF_SPARSEGPUCODEGEN

//===----------------------------------------------------------------------===//
// SparseReinterpretMap
//===----------------------------------------------------------------------===//
#ifdef GEN_PASS_DECL_SPARSEREINTERPRETMAP
struct SparseReinterpretMapOptions {
  mlir::ReinterpretMapScope scope = mlir::ReinterpretMapScope::kAll;
  mlir::sparse_tensor::LoopOrderingStrategy loopOrderingStrategy = mlir::sparse_tensor::LoopOrderingStrategy::kDefault;
};
#undef GEN_PASS_DECL_SPARSEREINTERPRETMAP
#endif // GEN_PASS_DECL_SPARSEREINTERPRETMAP
#ifdef GEN_PASS_DEF_SPARSEREINTERPRETMAP
namespace impl {

template <typename DerivedT>
class SparseReinterpretMapBase : public ::mlir::OperationPass<ModuleOp> {
public:
  using Base = SparseReinterpretMapBase;

  SparseReinterpretMapBase() : ::mlir::OperationPass<ModuleOp>(::mlir::TypeID::get<DerivedT>()) {}
  SparseReinterpretMapBase(const SparseReinterpretMapBase &other) : ::mlir::OperationPass<ModuleOp>(other) {}
  SparseReinterpretMapBase& operator=(const SparseReinterpretMapBase &) = delete;
  SparseReinterpretMapBase(SparseReinterpretMapBase &&) = delete;
  SparseReinterpretMapBase& operator=(SparseReinterpretMapBase &&) = delete;
  ~SparseReinterpretMapBase() = default;

  /// Returns the command-line argument attached to this pass.
  static constexpr ::llvm::StringLiteral getArgumentName() {
    return ::llvm::StringLiteral("sparse-reinterpret-map");
  }
  ::llvm::StringRef getArgument() const override { return "sparse-reinterpret-map"; }

  ::llvm::StringRef getDescription() const override { return R"PD(Reinterprets sparse tensor type mappings)PD"; }

  /// Returns the derived pass name.
  static constexpr ::llvm::StringLiteral getPassName() {
    return ::llvm::StringLiteral("SparseReinterpretMap");
  }
  ::llvm::StringRef getName() const override { return "SparseReinterpretMap"; }

  /// Support isa/dyn_cast functionality for the derived pass class.
  static bool classof(const ::mlir::Pass *pass) {
    return pass->getTypeID() == ::mlir::TypeID::get<DerivedT>();
  }

  /// A clone method to create a copy of this pass.
  std::unique_ptr<::mlir::Pass> clonePass() const override {
    return std::make_unique<DerivedT>(*static_cast<const DerivedT *>(this));
  }

  /// Return the dialect that must be loaded in the context before this pass.
  void getDependentDialects(::mlir::DialectRegistry &registry) const override {
    registry.insert<affine::AffineDialect>();
    registry.insert<linalg::LinalgDialect>();
    registry.insert<sparse_tensor::SparseTensorDialect>();
  }

  /// Explicitly declare the TypeID for this class. We declare an explicit private
  /// instantiation because Pass classes should only be visible by the current
  /// library.
  MLIR_DEFINE_EXPLICIT_INTERNAL_INLINE_TYPE_ID(SparseReinterpretMapBase<DerivedT>)

  SparseReinterpretMapBase(SparseReinterpretMapOptions options) : SparseReinterpretMapBase() {
    scope = std::move(options.scope);
    loopOrderingStrategy = std::move(options.loopOrderingStrategy);
  }
protected:
  ::mlir::Pass::Option<mlir::ReinterpretMapScope> scope{*this, "scope", ::llvm::cl::desc(R"PO(Set the reiterpretation scope)PO"), ::llvm::cl::init(mlir::ReinterpretMapScope::kAll), llvm::cl::values(
         clEnumValN(mlir::ReinterpretMapScope::kAll, "all",
                    "Run on every applicable operations."),
         clEnumValN(mlir::ReinterpretMapScope::kGenericOnly,
                    "only-generic",
                    "Run only on linalg.generic operations."),
         clEnumValN(mlir::ReinterpretMapScope::kExceptGeneric,
                    "except-generic",
                    "Run on operations expect linalg.generic (e.g., foreach)"))};
  ::mlir::Pass::Option<mlir::sparse_tensor::LoopOrderingStrategy> loopOrderingStrategy{*this, "loop-ordering-strategy", ::llvm::cl::desc(R"PO(Set the loop ordering strategy for sparse code generation)PO"), ::llvm::cl::init(mlir::sparse_tensor::LoopOrderingStrategy::kDefault), llvm::cl::values(
         clEnumValN(mlir::sparse_tensor::LoopOrderingStrategy::kDefault, "default",
                    "Default strategy (eagerly selects last loop in topological sort)"),
         clEnumValN(mlir::sparse_tensor::LoopOrderingStrategy::kDenseOuter, "dense-outer",
                    "Prefer dense, then compressed, then singleton dimensions outermost"))};
private:
};
} // namespace impl
#undef GEN_PASS_DEF_SPARSEREINTERPRETMAP
#endif // GEN_PASS_DEF_SPARSEREINTERPRETMAP

//===----------------------------------------------------------------------===//
// SparseSpaceCollapse
//===----------------------------------------------------------------------===//
#ifdef GEN_PASS_DECL_SPARSESPACECOLLAPSE
#undef GEN_PASS_DECL_SPARSESPACECOLLAPSE
#endif // GEN_PASS_DECL_SPARSESPACECOLLAPSE
#ifdef GEN_PASS_DEF_SPARSESPACECOLLAPSE
namespace impl {

template <typename DerivedT>
class SparseSpaceCollapseBase : public ::mlir::OperationPass<func::FuncOp> {
public:
  using Base = SparseSpaceCollapseBase;

  SparseSpaceCollapseBase() : ::mlir::OperationPass<func::FuncOp>(::mlir::TypeID::get<DerivedT>()) {}
  SparseSpaceCollapseBase(const SparseSpaceCollapseBase &other) : ::mlir::OperationPass<func::FuncOp>(other) {}
  SparseSpaceCollapseBase& operator=(const SparseSpaceCollapseBase &) = delete;
  SparseSpaceCollapseBase(SparseSpaceCollapseBase &&) = delete;
  SparseSpaceCollapseBase& operator=(SparseSpaceCollapseBase &&) = delete;
  ~SparseSpaceCollapseBase() = default;

  /// Returns the command-line argument attached to this pass.
  static constexpr ::llvm::StringLiteral getArgumentName() {
    return ::llvm::StringLiteral("sparse-space-collapse");
  }
  ::llvm::StringRef getArgument() const override { return "sparse-space-collapse"; }

  ::llvm::StringRef getDescription() const override { return R"PD(sparse space collapsing pass)PD"; }

  /// Returns the derived pass name.
  static constexpr ::llvm::StringLiteral getPassName() {
    return ::llvm::StringLiteral("SparseSpaceCollapse");
  }
  ::llvm::StringRef getName() const override { return "SparseSpaceCollapse"; }

  /// Support isa/dyn_cast functionality for the derived pass class.
  static bool classof(const ::mlir::Pass *pass) {
    return pass->getTypeID() == ::mlir::TypeID::get<DerivedT>();
  }

  /// A clone method to create a copy of this pass.
  std::unique_ptr<::mlir::Pass> clonePass() const override {
    return std::make_unique<DerivedT>(*static_cast<const DerivedT *>(this));
  }

  /// Return the dialect that must be loaded in the context before this pass.
  void getDependentDialects(::mlir::DialectRegistry &registry) const override {
    registry.insert<sparse_tensor::SparseTensorDialect>();
  }

  /// Explicitly declare the TypeID for this class. We declare an explicit private
  /// instantiation because Pass classes should only be visible by the current
  /// library.
  MLIR_DEFINE_EXPLICIT_INTERNAL_INLINE_TYPE_ID(SparseSpaceCollapseBase<DerivedT>)

protected:
private:
};
} // namespace impl
#undef GEN_PASS_DEF_SPARSESPACECOLLAPSE
#endif // GEN_PASS_DEF_SPARSESPACECOLLAPSE

//===----------------------------------------------------------------------===//
// SparseTensorCodegen
//===----------------------------------------------------------------------===//
#ifdef GEN_PASS_DECL_SPARSETENSORCODEGEN
struct SparseTensorCodegenOptions {
  bool enableBufferInitialization = false;
  bool createSparseDeallocs = true;
};
#undef GEN_PASS_DECL_SPARSETENSORCODEGEN
#endif // GEN_PASS_DECL_SPARSETENSORCODEGEN
#ifdef GEN_PASS_DEF_SPARSETENSORCODEGEN
namespace impl {

template <typename DerivedT>
class SparseTensorCodegenBase : public ::mlir::OperationPass<ModuleOp> {
public:
  using Base = SparseTensorCodegenBase;

  SparseTensorCodegenBase() : ::mlir::OperationPass<ModuleOp>(::mlir::TypeID::get<DerivedT>()) {}
  SparseTensorCodegenBase(const SparseTensorCodegenBase &other) : ::mlir::OperationPass<ModuleOp>(other) {}
  SparseTensorCodegenBase& operator=(const SparseTensorCodegenBase &) = delete;
  SparseTensorCodegenBase(SparseTensorCodegenBase &&) = delete;
  SparseTensorCodegenBase& operator=(SparseTensorCodegenBase &&) = delete;
  ~SparseTensorCodegenBase() = default;

  /// Returns the command-line argument attached to this pass.
  static constexpr ::llvm::StringLiteral getArgumentName() {
    return ::llvm::StringLiteral("sparse-tensor-codegen");
  }
  ::llvm::StringRef getArgument() const override { return "sparse-tensor-codegen"; }

  ::llvm::StringRef getDescription() const override { return R"PD(Convert sparse tensors and primitives to actual code)PD"; }

  /// Returns the derived pass name.
  static constexpr ::llvm::StringLiteral getPassName() {
    return ::llvm::StringLiteral("SparseTensorCodegen");
  }
  ::llvm::StringRef getName() const override { return "SparseTensorCodegen"; }

  /// Support isa/dyn_cast functionality for the derived pass class.
  static bool classof(const ::mlir::Pass *pass) {
    return pass->getTypeID() == ::mlir::TypeID::get<DerivedT>();
  }

  /// A clone method to create a copy of this pass.
  std::unique_ptr<::mlir::Pass> clonePass() const override {
    return std::make_unique<DerivedT>(*static_cast<const DerivedT *>(this));
  }

  /// Return the dialect that must be loaded in the context before this pass.
  void getDependentDialects(::mlir::DialectRegistry &registry) const override {
    registry.insert<arith::ArithDialect>();
    registry.insert<bufferization::BufferizationDialect>();
    registry.insert<linalg::LinalgDialect>();
    registry.insert<memref::MemRefDialect>();
    registry.insert<scf::SCFDialect>();
    registry.insert<sparse_tensor::SparseTensorDialect>();
  }

  /// Explicitly declare the TypeID for this class. We declare an explicit private
  /// instantiation because Pass classes should only be visible by the current
  /// library.
  MLIR_DEFINE_EXPLICIT_INTERNAL_INLINE_TYPE_ID(SparseTensorCodegenBase<DerivedT>)

  SparseTensorCodegenBase(SparseTensorCodegenOptions options) : SparseTensorCodegenBase() {
    enableBufferInitialization = std::move(options.enableBufferInitialization);
    createSparseDeallocs = std::move(options.createSparseDeallocs);
  }
protected:
  ::mlir::Pass::Option<bool> enableBufferInitialization{*this, "enable-buffer-initialization", ::llvm::cl::desc(R"PO(Enable zero-initialization of the memory buffers)PO"), ::llvm::cl::init(false)};
  ::mlir::Pass::Option<bool> createSparseDeallocs{*this, "create-sparse-deallocs", ::llvm::cl::desc(R"PO(Specify if the temporary buffers created by the sparse compiler should be deallocated. For compatibility with core bufferization passes. This option is only used when enable-runtime-library=false. See also create-deallocs for BufferizationOption.)PO"), ::llvm::cl::init(true)};
private:
};
} // namespace impl
#undef GEN_PASS_DEF_SPARSETENSORCODEGEN
#endif // GEN_PASS_DEF_SPARSETENSORCODEGEN

//===----------------------------------------------------------------------===//
// SparseTensorConversionPass
//===----------------------------------------------------------------------===//
#ifdef GEN_PASS_DECL_SPARSETENSORCONVERSIONPASS
#undef GEN_PASS_DECL_SPARSETENSORCONVERSIONPASS
#endif // GEN_PASS_DECL_SPARSETENSORCONVERSIONPASS
#ifdef GEN_PASS_DEF_SPARSETENSORCONVERSIONPASS
namespace impl {

template <typename DerivedT>
class SparseTensorConversionPassBase : public ::mlir::OperationPass<ModuleOp> {
public:
  using Base = SparseTensorConversionPassBase;

  SparseTensorConversionPassBase() : ::mlir::OperationPass<ModuleOp>(::mlir::TypeID::get<DerivedT>()) {}
  SparseTensorConversionPassBase(const SparseTensorConversionPassBase &other) : ::mlir::OperationPass<ModuleOp>(other) {}
  SparseTensorConversionPassBase& operator=(const SparseTensorConversionPassBase &) = delete;
  SparseTensorConversionPassBase(SparseTensorConversionPassBase &&) = delete;
  SparseTensorConversionPassBase& operator=(SparseTensorConversionPassBase &&) = delete;
  ~SparseTensorConversionPassBase() = default;

  /// Returns the command-line argument attached to this pass.
  static constexpr ::llvm::StringLiteral getArgumentName() {
    return ::llvm::StringLiteral("sparse-tensor-conversion");
  }
  ::llvm::StringRef getArgument() const override { return "sparse-tensor-conversion"; }

  ::llvm::StringRef getDescription() const override { return R"PD(Convert sparse tensors and primitives to library calls)PD"; }

  /// Returns the derived pass name.
  static constexpr ::llvm::StringLiteral getPassName() {
    return ::llvm::StringLiteral("SparseTensorConversionPass");
  }
  ::llvm::StringRef getName() const override { return "SparseTensorConversionPass"; }

  /// Support isa/dyn_cast functionality for the derived pass class.
  static bool classof(const ::mlir::Pass *pass) {
    return pass->getTypeID() == ::mlir::TypeID::get<DerivedT>();
  }

  /// A clone method to create a copy of this pass.
  std::unique_ptr<::mlir::Pass> clonePass() const override {
    return std::make_unique<DerivedT>(*static_cast<const DerivedT *>(this));
  }

  /// Return the dialect that must be loaded in the context before this pass.
  void getDependentDialects(::mlir::DialectRegistry &registry) const override {
    registry.insert<arith::ArithDialect>();
    registry.insert<bufferization::BufferizationDialect>();
    registry.insert<LLVM::LLVMDialect>();
    registry.insert<linalg::LinalgDialect>();
    registry.insert<memref::MemRefDialect>();
    registry.insert<scf::SCFDialect>();
    registry.insert<sparse_tensor::SparseTensorDialect>();
  }

  /// Explicitly declare the TypeID for this class. We declare an explicit private
  /// instantiation because Pass classes should only be visible by the current
  /// library.
  MLIR_DEFINE_EXPLICIT_INTERNAL_INLINE_TYPE_ID(SparseTensorConversionPassBase<DerivedT>)

protected:
private:
};
} // namespace impl
#undef GEN_PASS_DEF_SPARSETENSORCONVERSIONPASS
#endif // GEN_PASS_DEF_SPARSETENSORCONVERSIONPASS

//===----------------------------------------------------------------------===//
// SparseVectorization
//===----------------------------------------------------------------------===//
#ifdef GEN_PASS_DECL_SPARSEVECTORIZATION
struct SparseVectorizationOptions {
  int32_t vectorLength = 0;
  bool enableVLAVectorization = false;
  bool enableSIMDIndex32 = false;
};
#undef GEN_PASS_DECL_SPARSEVECTORIZATION
#endif // GEN_PASS_DECL_SPARSEVECTORIZATION
#ifdef GEN_PASS_DEF_SPARSEVECTORIZATION
namespace impl {

template <typename DerivedT>
class SparseVectorizationBase : public ::mlir::OperationPass<ModuleOp> {
public:
  using Base = SparseVectorizationBase;

  SparseVectorizationBase() : ::mlir::OperationPass<ModuleOp>(::mlir::TypeID::get<DerivedT>()) {}
  SparseVectorizationBase(const SparseVectorizationBase &other) : ::mlir::OperationPass<ModuleOp>(other) {}
  SparseVectorizationBase& operator=(const SparseVectorizationBase &) = delete;
  SparseVectorizationBase(SparseVectorizationBase &&) = delete;
  SparseVectorizationBase& operator=(SparseVectorizationBase &&) = delete;
  ~SparseVectorizationBase() = default;

  /// Returns the command-line argument attached to this pass.
  static constexpr ::llvm::StringLiteral getArgumentName() {
    return ::llvm::StringLiteral("sparse-vectorization");
  }
  ::llvm::StringRef getArgument() const override { return "sparse-vectorization"; }

  ::llvm::StringRef getDescription() const override { return R"PD(Vectorizes loops after sparsification)PD"; }

  /// Returns the derived pass name.
  static constexpr ::llvm::StringLiteral getPassName() {
    return ::llvm::StringLiteral("SparseVectorization");
  }
  ::llvm::StringRef getName() const override { return "SparseVectorization"; }

  /// Support isa/dyn_cast functionality for the derived pass class.
  static bool classof(const ::mlir::Pass *pass) {
    return pass->getTypeID() == ::mlir::TypeID::get<DerivedT>();
  }

  /// A clone method to create a copy of this pass.
  std::unique_ptr<::mlir::Pass> clonePass() const override {
    return std::make_unique<DerivedT>(*static_cast<const DerivedT *>(this));
  }

  /// Return the dialect that must be loaded in the context before this pass.
  void getDependentDialects(::mlir::DialectRegistry &registry) const override {
    registry.insert<arith::ArithDialect>();
    registry.insert<memref::MemRefDialect>();
    registry.insert<scf::SCFDialect>();
    registry.insert<sparse_tensor::SparseTensorDialect>();
    registry.insert<vector::VectorDialect>();
  }

  /// Explicitly declare the TypeID for this class. We declare an explicit private
  /// instantiation because Pass classes should only be visible by the current
  /// library.
  MLIR_DEFINE_EXPLICIT_INTERNAL_INLINE_TYPE_ID(SparseVectorizationBase<DerivedT>)

  SparseVectorizationBase(SparseVectorizationOptions options) : SparseVectorizationBase() {
    vectorLength = std::move(options.vectorLength);
    enableVLAVectorization = std::move(options.enableVLAVectorization);
    enableSIMDIndex32 = std::move(options.enableSIMDIndex32);
  }
protected:
  ::mlir::Pass::Option<int32_t> vectorLength{*this, "vl", ::llvm::cl::desc(R"PO(Set the vector length (use 0 to disable vectorization))PO"), ::llvm::cl::init(0)};
  ::mlir::Pass::Option<bool> enableVLAVectorization{*this, "enable-vla-vectorization", ::llvm::cl::desc(R"PO(Enable vector length agnostic vectorization)PO"), ::llvm::cl::init(false)};
  ::mlir::Pass::Option<bool> enableSIMDIndex32{*this, "enable-simd-index32", ::llvm::cl::desc(R"PO(Enable i32 indexing into vectors (for efficient gather/scatter))PO"), ::llvm::cl::init(false)};
private:
};
} // namespace impl
#undef GEN_PASS_DEF_SPARSEVECTORIZATION
#endif // GEN_PASS_DEF_SPARSEVECTORIZATION

//===----------------------------------------------------------------------===//
// SparsificationAndBufferization
//===----------------------------------------------------------------------===//
#ifdef GEN_PASS_DECL_SPARSIFICATIONANDBUFFERIZATION
struct SparsificationAndBufferizationOptions {
  int32_t vectorLength = 0;
  bool enableVLAVectorization = false;
  bool enableSIMDIndex32 = false;
  bool enableGPULibgen = false;
  mlir::SparseEmitStrategy sparseEmitStrategy = mlir::SparseEmitStrategy::kFunctional;
  mlir::SparseParallelizationStrategy parallelization = mlir::SparseParallelizationStrategy::kNone;
};
#undef GEN_PASS_DECL_SPARSIFICATIONANDBUFFERIZATION
#endif // GEN_PASS_DECL_SPARSIFICATIONANDBUFFERIZATION
#ifdef GEN_PASS_DEF_SPARSIFICATIONANDBUFFERIZATION
namespace impl {

template <typename DerivedT>
class SparsificationAndBufferizationBase : public ::mlir::OperationPass<ModuleOp> {
public:
  using Base = SparsificationAndBufferizationBase;

  SparsificationAndBufferizationBase() : ::mlir::OperationPass<ModuleOp>(::mlir::TypeID::get<DerivedT>()) {}
  SparsificationAndBufferizationBase(const SparsificationAndBufferizationBase &other) : ::mlir::OperationPass<ModuleOp>(other) {}
  SparsificationAndBufferizationBase& operator=(const SparsificationAndBufferizationBase &) = delete;
  SparsificationAndBufferizationBase(SparsificationAndBufferizationBase &&) = delete;
  SparsificationAndBufferizationBase& operator=(SparsificationAndBufferizationBase &&) = delete;
  ~SparsificationAndBufferizationBase() = default;

  /// Returns the command-line argument attached to this pass.
  static constexpr ::llvm::StringLiteral getArgumentName() {
    return ::llvm::StringLiteral("sparsification-and-bufferization");
  }
  ::llvm::StringRef getArgument() const override { return "sparsification-and-bufferization"; }

  ::llvm::StringRef getDescription() const override { return R"PD(Mini-pipeline that combines bufferization and sparsifiation)PD"; }

  /// Returns the derived pass name.
  static constexpr ::llvm::StringLiteral getPassName() {
    return ::llvm::StringLiteral("SparsificationAndBufferization");
  }
  ::llvm::StringRef getName() const override { return "SparsificationAndBufferization"; }

  /// Support isa/dyn_cast functionality for the derived pass class.
  static bool classof(const ::mlir::Pass *pass) {
    return pass->getTypeID() == ::mlir::TypeID::get<DerivedT>();
  }

  /// A clone method to create a copy of this pass.
  std::unique_ptr<::mlir::Pass> clonePass() const override {
    return std::make_unique<DerivedT>(*static_cast<const DerivedT *>(this));
  }

  /// Return the dialect that must be loaded in the context before this pass.
  void getDependentDialects(::mlir::DialectRegistry &registry) const override {
    registry.insert<affine::AffineDialect>();
    registry.insert<arith::ArithDialect>();
    registry.insert<bufferization::BufferizationDialect>();
    registry.insert<gpu::GPUDialect>();
    registry.insert<LLVM::LLVMDialect>();
    registry.insert<linalg::LinalgDialect>();
    registry.insert<memref::MemRefDialect>();
    registry.insert<scf::SCFDialect>();
    registry.insert<sparse_tensor::SparseTensorDialect>();
    registry.insert<vector::VectorDialect>();
  }

  /// Explicitly declare the TypeID for this class. We declare an explicit private
  /// instantiation because Pass classes should only be visible by the current
  /// library.
  MLIR_DEFINE_EXPLICIT_INTERNAL_INLINE_TYPE_ID(SparsificationAndBufferizationBase<DerivedT>)

  SparsificationAndBufferizationBase(SparsificationAndBufferizationOptions options) : SparsificationAndBufferizationBase() {
    vectorLength = std::move(options.vectorLength);
    enableVLAVectorization = std::move(options.enableVLAVectorization);
    enableSIMDIndex32 = std::move(options.enableSIMDIndex32);
    enableGPULibgen = std::move(options.enableGPULibgen);
    sparseEmitStrategy = std::move(options.sparseEmitStrategy);
    parallelization = std::move(options.parallelization);
  }
protected:
  ::mlir::Pass::Option<int32_t> vectorLength{*this, "vl", ::llvm::cl::desc(R"PO(Set the vector length (use 0 to disable vectorization))PO"), ::llvm::cl::init(0)};
  ::mlir::Pass::Option<bool> enableVLAVectorization{*this, "enable-vla-vectorization", ::llvm::cl::desc(R"PO(Enable vector length agnostic vectorization)PO"), ::llvm::cl::init(false)};
  ::mlir::Pass::Option<bool> enableSIMDIndex32{*this, "enable-simd-index32", ::llvm::cl::desc(R"PO(Enable i32 indexing into vectors (for efficient gather/scatter))PO"), ::llvm::cl::init(false)};
  ::mlir::Pass::Option<bool> enableGPULibgen{*this, "enable-gpu-libgen", ::llvm::cl::desc(R"PO(Enable GPU acceleration by means of direct library calls)PO"), ::llvm::cl::init(false)};
  ::mlir::Pass::Option<mlir::SparseEmitStrategy> sparseEmitStrategy{*this, "sparse-emit-strategy", ::llvm::cl::desc(R"PO(Emit functional code or interfaces (to debug) for sparse loops)PO"), ::llvm::cl::init(mlir::SparseEmitStrategy::kFunctional), llvm::cl::values(
             clEnumValN(mlir::SparseEmitStrategy::kFunctional, "functional",
                        "Emit functional code (with scf.for/while)."),
             clEnumValN(mlir::SparseEmitStrategy::kSparseIterator, "sparse-iterator",
                        "Emit (experimental) loops (with sparse.iterate)."),
             clEnumValN(mlir::SparseEmitStrategy::kDebugInterface, "debug-interface",
                        "Emit non-functional but easy-to-read interfaces to debug."))};
  ::mlir::Pass::Option<mlir::SparseParallelizationStrategy> parallelization{*this, "parallelization-strategy", ::llvm::cl::desc(R"PO(Set the parallelization strategy)PO"), ::llvm::cl::init(mlir::SparseParallelizationStrategy::kNone), llvm::cl::values(
             clEnumValN(mlir::SparseParallelizationStrategy::kNone, "none",
                        "Turn off sparse parallelization."),
             clEnumValN(mlir::SparseParallelizationStrategy::kDenseOuterLoop,
                        "dense-outer-loop",
                        "Enable dense outer loop sparse parallelization."),
             clEnumValN(mlir::SparseParallelizationStrategy::kAnyStorageOuterLoop,
                        "any-storage-outer-loop",
                        "Enable sparse parallelization regardless of storage for the outer loop."),
             clEnumValN(mlir::SparseParallelizationStrategy::kDenseAnyLoop,
                        "dense-any-loop",
                        "Enable dense parallelization for any loop."),
             clEnumValN(mlir::SparseParallelizationStrategy::kAnyStorageAnyLoop,
                        "any-storage-any-loop",
                        "Enable sparse parallelization for any storage and loop."))};
private:
};
} // namespace impl
#undef GEN_PASS_DEF_SPARSIFICATIONANDBUFFERIZATION
#endif // GEN_PASS_DEF_SPARSIFICATIONANDBUFFERIZATION

//===----------------------------------------------------------------------===//
// SparsificationPass
//===----------------------------------------------------------------------===//
#ifdef GEN_PASS_DECL_SPARSIFICATIONPASS
struct SparsificationPassOptions {
  mlir::SparseParallelizationStrategy parallelization = mlir::SparseParallelizationStrategy::kNone;
  mlir::SparseEmitStrategy sparseEmitStrategy = mlir::SparseEmitStrategy::kFunctional;
  bool enableRuntimeLibrary = true;
};
#undef GEN_PASS_DECL_SPARSIFICATIONPASS
#endif // GEN_PASS_DECL_SPARSIFICATIONPASS
#ifdef GEN_PASS_DEF_SPARSIFICATIONPASS
namespace impl {

template <typename DerivedT>
class SparsificationPassBase : public ::mlir::OperationPass<ModuleOp> {
public:
  using Base = SparsificationPassBase;

  SparsificationPassBase() : ::mlir::OperationPass<ModuleOp>(::mlir::TypeID::get<DerivedT>()) {}
  SparsificationPassBase(const SparsificationPassBase &other) : ::mlir::OperationPass<ModuleOp>(other) {}
  SparsificationPassBase& operator=(const SparsificationPassBase &) = delete;
  SparsificationPassBase(SparsificationPassBase &&) = delete;
  SparsificationPassBase& operator=(SparsificationPassBase &&) = delete;
  ~SparsificationPassBase() = default;

  /// Returns the command-line argument attached to this pass.
  static constexpr ::llvm::StringLiteral getArgumentName() {
    return ::llvm::StringLiteral("sparsification");
  }
  ::llvm::StringRef getArgument() const override { return "sparsification"; }

  ::llvm::StringRef getDescription() const override { return R"PD(Automatically generate sparse tensor code from sparse tensor types)PD"; }

  /// Returns the derived pass name.
  static constexpr ::llvm::StringLiteral getPassName() {
    return ::llvm::StringLiteral("SparsificationPass");
  }
  ::llvm::StringRef getName() const override { return "SparsificationPass"; }

  /// Support isa/dyn_cast functionality for the derived pass class.
  static bool classof(const ::mlir::Pass *pass) {
    return pass->getTypeID() == ::mlir::TypeID::get<DerivedT>();
  }

  /// A clone method to create a copy of this pass.
  std::unique_ptr<::mlir::Pass> clonePass() const override {
    return std::make_unique<DerivedT>(*static_cast<const DerivedT *>(this));
  }

  /// Return the dialect that must be loaded in the context before this pass.
  void getDependentDialects(::mlir::DialectRegistry &registry) const override {
    registry.insert<affine::AffineDialect>();
    registry.insert<arith::ArithDialect>();
    registry.insert<bufferization::BufferizationDialect>();
    registry.insert<LLVM::LLVMDialect>();
    registry.insert<linalg::LinalgDialect>();
    registry.insert<memref::MemRefDialect>();
    registry.insert<scf::SCFDialect>();
    registry.insert<sparse_tensor::SparseTensorDialect>();
  }

  /// Explicitly declare the TypeID for this class. We declare an explicit private
  /// instantiation because Pass classes should only be visible by the current
  /// library.
  MLIR_DEFINE_EXPLICIT_INTERNAL_INLINE_TYPE_ID(SparsificationPassBase<DerivedT>)

  SparsificationPassBase(SparsificationPassOptions options) : SparsificationPassBase() {
    parallelization = std::move(options.parallelization);
    sparseEmitStrategy = std::move(options.sparseEmitStrategy);
    enableRuntimeLibrary = std::move(options.enableRuntimeLibrary);
  }
protected:
  ::mlir::Pass::Option<mlir::SparseParallelizationStrategy> parallelization{*this, "parallelization-strategy", ::llvm::cl::desc(R"PO(Set the parallelization strategy)PO"), ::llvm::cl::init(mlir::SparseParallelizationStrategy::kNone), llvm::cl::values(
             clEnumValN(mlir::SparseParallelizationStrategy::kNone, "none",
                        "Turn off sparse parallelization."),
             clEnumValN(mlir::SparseParallelizationStrategy::kDenseOuterLoop,
                        "dense-outer-loop",
                        "Enable dense outer loop sparse parallelization."),
             clEnumValN(mlir::SparseParallelizationStrategy::kAnyStorageOuterLoop,
                        "any-storage-outer-loop",
                        "Enable sparse parallelization regardless of storage for the outer loop."),
             clEnumValN(mlir::SparseParallelizationStrategy::kDenseAnyLoop,
                        "dense-any-loop",
                        "Enable dense parallelization for any loop."),
             clEnumValN(mlir::SparseParallelizationStrategy::kAnyStorageAnyLoop,
                        "any-storage-any-loop",
                        "Enable sparse parallelization for any storage and loop."))};
  ::mlir::Pass::Option<mlir::SparseEmitStrategy> sparseEmitStrategy{*this, "sparse-emit-strategy", ::llvm::cl::desc(R"PO(Emit functional code or interfaces (to debug) for sparse loops)PO"), ::llvm::cl::init(mlir::SparseEmitStrategy::kFunctional), llvm::cl::values(
             clEnumValN(mlir::SparseEmitStrategy::kFunctional, "functional",
                        "Emit functional code (with scf.for/while)."),
             clEnumValN(mlir::SparseEmitStrategy::kSparseIterator, "sparse-iterator",
                        "Emit (experimental) loops (with sparse.iterate)."),
             clEnumValN(mlir::SparseEmitStrategy::kDebugInterface, "debug-interface",
                        "Emit non-functional but easy-to-read interfaces to debug."))};
  ::mlir::Pass::Option<bool> enableRuntimeLibrary{*this, "enable-runtime-library", ::llvm::cl::desc(R"PO(Enable runtime library for manipulating sparse tensors)PO"), ::llvm::cl::init(true)};
private:
};
} // namespace impl
#undef GEN_PASS_DEF_SPARSIFICATIONPASS
#endif // GEN_PASS_DEF_SPARSIFICATIONPASS

//===----------------------------------------------------------------------===//
// StageSparseOperations
//===----------------------------------------------------------------------===//
#ifdef GEN_PASS_DECL_STAGESPARSEOPERATIONS
#undef GEN_PASS_DECL_STAGESPARSEOPERATIONS
#endif // GEN_PASS_DECL_STAGESPARSEOPERATIONS
#ifdef GEN_PASS_DEF_STAGESPARSEOPERATIONS
namespace impl {

template <typename DerivedT>
class StageSparseOperationsBase : public ::mlir::OperationPass<func::FuncOp> {
public:
  using Base = StageSparseOperationsBase;

  StageSparseOperationsBase() : ::mlir::OperationPass<func::FuncOp>(::mlir::TypeID::get<DerivedT>()) {}
  StageSparseOperationsBase(const StageSparseOperationsBase &other) : ::mlir::OperationPass<func::FuncOp>(other) {}
  StageSparseOperationsBase& operator=(const StageSparseOperationsBase &) = delete;
  StageSparseOperationsBase(StageSparseOperationsBase &&) = delete;
  StageSparseOperationsBase& operator=(StageSparseOperationsBase &&) = delete;
  ~StageSparseOperationsBase() = default;

  /// Returns the command-line argument attached to this pass.
  static constexpr ::llvm::StringLiteral getArgumentName() {
    return ::llvm::StringLiteral("stage-sparse-ops");
  }
  ::llvm::StringRef getArgument() const override { return "stage-sparse-ops"; }

  ::llvm::StringRef getDescription() const override { return R"PD(Decompose a complex sparse operation into multiple stages)PD"; }

  /// Returns the derived pass name.
  static constexpr ::llvm::StringLiteral getPassName() {
    return ::llvm::StringLiteral("StageSparseOperations");
  }
  ::llvm::StringRef getName() const override { return "StageSparseOperations"; }

  /// Support isa/dyn_cast functionality for the derived pass class.
  static bool classof(const ::mlir::Pass *pass) {
    return pass->getTypeID() == ::mlir::TypeID::get<DerivedT>();
  }

  /// A clone method to create a copy of this pass.
  std::unique_ptr<::mlir::Pass> clonePass() const override {
    return std::make_unique<DerivedT>(*static_cast<const DerivedT *>(this));
  }

  /// Return the dialect that must be loaded in the context before this pass.
  void getDependentDialects(::mlir::DialectRegistry &registry) const override {
    registry.insert<sparse_tensor::SparseTensorDialect>();
  }

  /// Explicitly declare the TypeID for this class. We declare an explicit private
  /// instantiation because Pass classes should only be visible by the current
  /// library.
  MLIR_DEFINE_EXPLICIT_INTERNAL_INLINE_TYPE_ID(StageSparseOperationsBase<DerivedT>)

protected:
private:
};
} // namespace impl
#undef GEN_PASS_DEF_STAGESPARSEOPERATIONS
#endif // GEN_PASS_DEF_STAGESPARSEOPERATIONS

//===----------------------------------------------------------------------===//
// StorageSpecifierToLLVM
//===----------------------------------------------------------------------===//
#ifdef GEN_PASS_DECL_STORAGESPECIFIERTOLLVM
#undef GEN_PASS_DECL_STORAGESPECIFIERTOLLVM
#endif // GEN_PASS_DECL_STORAGESPECIFIERTOLLVM
#ifdef GEN_PASS_DEF_STORAGESPECIFIERTOLLVM
namespace impl {

template <typename DerivedT>
class StorageSpecifierToLLVMBase : public ::mlir::OperationPass<ModuleOp> {
public:
  using Base = StorageSpecifierToLLVMBase;

  StorageSpecifierToLLVMBase() : ::mlir::OperationPass<ModuleOp>(::mlir::TypeID::get<DerivedT>()) {}
  StorageSpecifierToLLVMBase(const StorageSpecifierToLLVMBase &other) : ::mlir::OperationPass<ModuleOp>(other) {}
  StorageSpecifierToLLVMBase& operator=(const StorageSpecifierToLLVMBase &) = delete;
  StorageSpecifierToLLVMBase(StorageSpecifierToLLVMBase &&) = delete;
  StorageSpecifierToLLVMBase& operator=(StorageSpecifierToLLVMBase &&) = delete;
  ~StorageSpecifierToLLVMBase() = default;

  /// Returns the command-line argument attached to this pass.
  static constexpr ::llvm::StringLiteral getArgumentName() {
    return ::llvm::StringLiteral("sparse-storage-specifier-to-llvm");
  }
  ::llvm::StringRef getArgument() const override { return "sparse-storage-specifier-to-llvm"; }

  ::llvm::StringRef getDescription() const override { return R"PD(Lower sparse storage specifer to llvm structure)PD"; }

  /// Returns the derived pass name.
  static constexpr ::llvm::StringLiteral getPassName() {
    return ::llvm::StringLiteral("StorageSpecifierToLLVM");
  }
  ::llvm::StringRef getName() const override { return "StorageSpecifierToLLVM"; }

  /// Support isa/dyn_cast functionality for the derived pass class.
  static bool classof(const ::mlir::Pass *pass) {
    return pass->getTypeID() == ::mlir::TypeID::get<DerivedT>();
  }

  /// A clone method to create a copy of this pass.
  std::unique_ptr<::mlir::Pass> clonePass() const override {
    return std::make_unique<DerivedT>(*static_cast<const DerivedT *>(this));
  }

  /// Return the dialect that must be loaded in the context before this pass.
  void getDependentDialects(::mlir::DialectRegistry &registry) const override {
    registry.insert<arith::ArithDialect>();
    registry.insert<LLVM::LLVMDialect>();
    registry.insert<sparse_tensor::SparseTensorDialect>();
  }

  /// Explicitly declare the TypeID for this class. We declare an explicit private
  /// instantiation because Pass classes should only be visible by the current
  /// library.
  MLIR_DEFINE_EXPLICIT_INTERNAL_INLINE_TYPE_ID(StorageSpecifierToLLVMBase<DerivedT>)

protected:
private:
};
} // namespace impl
#undef GEN_PASS_DEF_STORAGESPECIFIERTOLLVM
#endif // GEN_PASS_DEF_STORAGESPECIFIERTOLLVM
#ifdef GEN_PASS_REGISTRATION
// Generate registrations for all passes.
#define GEN_PASS_REGISTRATION_LOWERFOREACHTOSCF
#define GEN_PASS_REGISTRATION_LOWERSPARSEITERATIONTOSCF
#define GEN_PASS_REGISTRATION_LOWERSPARSEOPSTOFOREACH
#define GEN_PASS_REGISTRATION_PRESPARSIFICATIONREWRITE
#define GEN_PASS_REGISTRATION_SPARSEASSEMBLER
#define GEN_PASS_REGISTRATION_SPARSEBUFFERREWRITE
#define GEN_PASS_REGISTRATION_SPARSEGPUCODEGEN
#define GEN_PASS_REGISTRATION_SPARSEREINTERPRETMAP
#define GEN_PASS_REGISTRATION_SPARSESPACECOLLAPSE
#define GEN_PASS_REGISTRATION_SPARSETENSORCODEGEN
#define GEN_PASS_REGISTRATION_SPARSETENSORCONVERSIONPASS
#define GEN_PASS_REGISTRATION_SPARSEVECTORIZATION
#define GEN_PASS_REGISTRATION_SPARSIFICATIONANDBUFFERIZATION
#define GEN_PASS_REGISTRATION_SPARSIFICATIONPASS
#define GEN_PASS_REGISTRATION_STAGESPARSEOPERATIONS
#define GEN_PASS_REGISTRATION_STORAGESPECIFIERTOLLVM
#endif // GEN_PASS_REGISTRATION

//===----------------------------------------------------------------------===//
// LowerForeachToSCF Registration
//===----------------------------------------------------------------------===//
#ifdef GEN_PASS_REGISTRATION_LOWERFOREACHTOSCF

inline void registerLowerForeachToSCF() {
  ::mlir::registerPass([]() -> std::unique_ptr<::mlir::Pass> {
    return mlir::createLowerForeachToSCFPass();
  });
}

// Old registration code, kept for temporary backwards compatibility.
inline void registerLowerForeachToSCFPass() {
  ::mlir::registerPass([]() -> std::unique_ptr<::mlir::Pass> {
    return mlir::createLowerForeachToSCFPass();
  });
}

#undef GEN_PASS_REGISTRATION_LOWERFOREACHTOSCF
#endif // GEN_PASS_REGISTRATION_LOWERFOREACHTOSCF

//===----------------------------------------------------------------------===//
// LowerSparseIterationToSCF Registration
//===----------------------------------------------------------------------===//
#ifdef GEN_PASS_REGISTRATION_LOWERSPARSEITERATIONTOSCF

inline void registerLowerSparseIterationToSCF() {
  ::mlir::registerPass([]() -> std::unique_ptr<::mlir::Pass> {
    return mlir::createLowerSparseIterationToSCFPass();
  });
}

// Old registration code, kept for temporary backwards compatibility.
inline void registerLowerSparseIterationToSCFPass() {
  ::mlir::registerPass([]() -> std::unique_ptr<::mlir::Pass> {
    return mlir::createLowerSparseIterationToSCFPass();
  });
}

#undef GEN_PASS_REGISTRATION_LOWERSPARSEITERATIONTOSCF
#endif // GEN_PASS_REGISTRATION_LOWERSPARSEITERATIONTOSCF

//===----------------------------------------------------------------------===//
// LowerSparseOpsToForeach Registration
//===----------------------------------------------------------------------===//
#ifdef GEN_PASS_REGISTRATION_LOWERSPARSEOPSTOFOREACH

inline void registerLowerSparseOpsToForeach() {
  ::mlir::registerPass([]() -> std::unique_ptr<::mlir::Pass> {
    return mlir::createLowerSparseOpsToForeachPass();
  });
}

// Old registration code, kept for temporary backwards compatibility.
inline void registerLowerSparseOpsToForeachPass() {
  ::mlir::registerPass([]() -> std::unique_ptr<::mlir::Pass> {
    return mlir::createLowerSparseOpsToForeachPass();
  });
}

#undef GEN_PASS_REGISTRATION_LOWERSPARSEOPSTOFOREACH
#endif // GEN_PASS_REGISTRATION_LOWERSPARSEOPSTOFOREACH

//===----------------------------------------------------------------------===//
// PreSparsificationRewrite Registration
//===----------------------------------------------------------------------===//
#ifdef GEN_PASS_REGISTRATION_PRESPARSIFICATIONREWRITE

inline void registerPreSparsificationRewrite() {
  ::mlir::registerPass([]() -> std::unique_ptr<::mlir::Pass> {
    return mlir::createPreSparsificationRewritePass();
  });
}

// Old registration code, kept for temporary backwards compatibility.
inline void registerPreSparsificationRewritePass() {
  ::mlir::registerPass([]() -> std::unique_ptr<::mlir::Pass> {
    return mlir::createPreSparsificationRewritePass();
  });
}

#undef GEN_PASS_REGISTRATION_PRESPARSIFICATIONREWRITE
#endif // GEN_PASS_REGISTRATION_PRESPARSIFICATIONREWRITE

//===----------------------------------------------------------------------===//
// SparseAssembler Registration
//===----------------------------------------------------------------------===//
#ifdef GEN_PASS_REGISTRATION_SPARSEASSEMBLER

inline void registerSparseAssembler() {
  ::mlir::registerPass([]() -> std::unique_ptr<::mlir::Pass> {
    return mlir::createSparseAssembler();
  });
}

// Old registration code, kept for temporary backwards compatibility.
inline void registerSparseAssemblerPass() {
  ::mlir::registerPass([]() -> std::unique_ptr<::mlir::Pass> {
    return mlir::createSparseAssembler();
  });
}

#undef GEN_PASS_REGISTRATION_SPARSEASSEMBLER
#endif // GEN_PASS_REGISTRATION_SPARSEASSEMBLER

//===----------------------------------------------------------------------===//
// SparseBufferRewrite Registration
//===----------------------------------------------------------------------===//
#ifdef GEN_PASS_REGISTRATION_SPARSEBUFFERREWRITE

inline void registerSparseBufferRewrite() {
  ::mlir::registerPass([]() -> std::unique_ptr<::mlir::Pass> {
    return mlir::createSparseBufferRewritePass();
  });
}

// Old registration code, kept for temporary backwards compatibility.
inline void registerSparseBufferRewritePass() {
  ::mlir::registerPass([]() -> std::unique_ptr<::mlir::Pass> {
    return mlir::createSparseBufferRewritePass();
  });
}

#undef GEN_PASS_REGISTRATION_SPARSEBUFFERREWRITE
#endif // GEN_PASS_REGISTRATION_SPARSEBUFFERREWRITE

//===----------------------------------------------------------------------===//
// SparseGPUCodegen Registration
//===----------------------------------------------------------------------===//
#ifdef GEN_PASS_REGISTRATION_SPARSEGPUCODEGEN

inline void registerSparseGPUCodegen() {
  ::mlir::registerPass([]() -> std::unique_ptr<::mlir::Pass> {
    return mlir::createSparseGPUCodegenPass();
  });
}

// Old registration code, kept for temporary backwards compatibility.
inline void registerSparseGPUCodegenPass() {
  ::mlir::registerPass([]() -> std::unique_ptr<::mlir::Pass> {
    return mlir::createSparseGPUCodegenPass();
  });
}

#undef GEN_PASS_REGISTRATION_SPARSEGPUCODEGEN
#endif // GEN_PASS_REGISTRATION_SPARSEGPUCODEGEN

//===----------------------------------------------------------------------===//
// SparseReinterpretMap Registration
//===----------------------------------------------------------------------===//
#ifdef GEN_PASS_REGISTRATION_SPARSEREINTERPRETMAP

inline void registerSparseReinterpretMap() {
  ::mlir::registerPass([]() -> std::unique_ptr<::mlir::Pass> {
    return mlir::createSparseReinterpretMapPass();
  });
}

// Old registration code, kept for temporary backwards compatibility.
inline void registerSparseReinterpretMapPass() {
  ::mlir::registerPass([]() -> std::unique_ptr<::mlir::Pass> {
    return mlir::createSparseReinterpretMapPass();
  });
}

#undef GEN_PASS_REGISTRATION_SPARSEREINTERPRETMAP
#endif // GEN_PASS_REGISTRATION_SPARSEREINTERPRETMAP

//===----------------------------------------------------------------------===//
// SparseSpaceCollapse Registration
//===----------------------------------------------------------------------===//
#ifdef GEN_PASS_REGISTRATION_SPARSESPACECOLLAPSE

inline void registerSparseSpaceCollapse() {
  ::mlir::registerPass([]() -> std::unique_ptr<::mlir::Pass> {
    return mlir::createSparseSpaceCollapsePass();
  });
}

// Old registration code, kept for temporary backwards compatibility.
inline void registerSparseSpaceCollapsePass() {
  ::mlir::registerPass([]() -> std::unique_ptr<::mlir::Pass> {
    return mlir::createSparseSpaceCollapsePass();
  });
}

#undef GEN_PASS_REGISTRATION_SPARSESPACECOLLAPSE
#endif // GEN_PASS_REGISTRATION_SPARSESPACECOLLAPSE

//===----------------------------------------------------------------------===//
// SparseTensorCodegen Registration
//===----------------------------------------------------------------------===//
#ifdef GEN_PASS_REGISTRATION_SPARSETENSORCODEGEN

inline void registerSparseTensorCodegen() {
  ::mlir::registerPass([]() -> std::unique_ptr<::mlir::Pass> {
    return mlir::createSparseTensorCodegenPass();
  });
}

// Old registration code, kept for temporary backwards compatibility.
inline void registerSparseTensorCodegenPass() {
  ::mlir::registerPass([]() -> std::unique_ptr<::mlir::Pass> {
    return mlir::createSparseTensorCodegenPass();
  });
}

#undef GEN_PASS_REGISTRATION_SPARSETENSORCODEGEN
#endif // GEN_PASS_REGISTRATION_SPARSETENSORCODEGEN

//===----------------------------------------------------------------------===//
// SparseTensorConversionPass Registration
//===----------------------------------------------------------------------===//
#ifdef GEN_PASS_REGISTRATION_SPARSETENSORCONVERSIONPASS

inline void registerSparseTensorConversionPass() {
  ::mlir::registerPass([]() -> std::unique_ptr<::mlir::Pass> {
    return mlir::createSparseTensorConversionPass();
  });
}

// Old registration code, kept for temporary backwards compatibility.
inline void registerSparseTensorConversionPassPass() {
  ::mlir::registerPass([]() -> std::unique_ptr<::mlir::Pass> {
    return mlir::createSparseTensorConversionPass();
  });
}

#undef GEN_PASS_REGISTRATION_SPARSETENSORCONVERSIONPASS
#endif // GEN_PASS_REGISTRATION_SPARSETENSORCONVERSIONPASS

//===----------------------------------------------------------------------===//
// SparseVectorization Registration
//===----------------------------------------------------------------------===//
#ifdef GEN_PASS_REGISTRATION_SPARSEVECTORIZATION

inline void registerSparseVectorization() {
  ::mlir::registerPass([]() -> std::unique_ptr<::mlir::Pass> {
    return mlir::createSparseVectorizationPass();
  });
}

// Old registration code, kept for temporary backwards compatibility.
inline void registerSparseVectorizationPass() {
  ::mlir::registerPass([]() -> std::unique_ptr<::mlir::Pass> {
    return mlir::createSparseVectorizationPass();
  });
}

#undef GEN_PASS_REGISTRATION_SPARSEVECTORIZATION
#endif // GEN_PASS_REGISTRATION_SPARSEVECTORIZATION

//===----------------------------------------------------------------------===//
// SparsificationAndBufferization Registration
//===----------------------------------------------------------------------===//
#ifdef GEN_PASS_REGISTRATION_SPARSIFICATIONANDBUFFERIZATION

inline void registerSparsificationAndBufferization() {
  ::mlir::registerPass([]() -> std::unique_ptr<::mlir::Pass> {
    return mlir::createSparsificationAndBufferizationPass();
  });
}

// Old registration code, kept for temporary backwards compatibility.
inline void registerSparsificationAndBufferizationPass() {
  ::mlir::registerPass([]() -> std::unique_ptr<::mlir::Pass> {
    return mlir::createSparsificationAndBufferizationPass();
  });
}

#undef GEN_PASS_REGISTRATION_SPARSIFICATIONANDBUFFERIZATION
#endif // GEN_PASS_REGISTRATION_SPARSIFICATIONANDBUFFERIZATION

//===----------------------------------------------------------------------===//
// SparsificationPass Registration
//===----------------------------------------------------------------------===//
#ifdef GEN_PASS_REGISTRATION_SPARSIFICATIONPASS

inline void registerSparsificationPass() {
  ::mlir::registerPass([]() -> std::unique_ptr<::mlir::Pass> {
    return mlir::createSparsificationPass();
  });
}

// Old registration code, kept for temporary backwards compatibility.
inline void registerSparsificationPassPass() {
  ::mlir::registerPass([]() -> std::unique_ptr<::mlir::Pass> {
    return mlir::createSparsificationPass();
  });
}

#undef GEN_PASS_REGISTRATION_SPARSIFICATIONPASS
#endif // GEN_PASS_REGISTRATION_SPARSIFICATIONPASS

//===----------------------------------------------------------------------===//
// StageSparseOperations Registration
//===----------------------------------------------------------------------===//
#ifdef GEN_PASS_REGISTRATION_STAGESPARSEOPERATIONS

inline void registerStageSparseOperations() {
  ::mlir::registerPass([]() -> std::unique_ptr<::mlir::Pass> {
    return mlir::createStageSparseOperationsPass();
  });
}

// Old registration code, kept for temporary backwards compatibility.
inline void registerStageSparseOperationsPass() {
  ::mlir::registerPass([]() -> std::unique_ptr<::mlir::Pass> {
    return mlir::createStageSparseOperationsPass();
  });
}

#undef GEN_PASS_REGISTRATION_STAGESPARSEOPERATIONS
#endif // GEN_PASS_REGISTRATION_STAGESPARSEOPERATIONS

//===----------------------------------------------------------------------===//
// StorageSpecifierToLLVM Registration
//===----------------------------------------------------------------------===//
#ifdef GEN_PASS_REGISTRATION_STORAGESPECIFIERTOLLVM

inline void registerStorageSpecifierToLLVM() {
  ::mlir::registerPass([]() -> std::unique_ptr<::mlir::Pass> {
    return mlir::createStorageSpecifierToLLVMPass();
  });
}

// Old registration code, kept for temporary backwards compatibility.
inline void registerStorageSpecifierToLLVMPass() {
  ::mlir::registerPass([]() -> std::unique_ptr<::mlir::Pass> {
    return mlir::createStorageSpecifierToLLVMPass();
  });
}

#undef GEN_PASS_REGISTRATION_STORAGESPECIFIERTOLLVM
#endif // GEN_PASS_REGISTRATION_STORAGESPECIFIERTOLLVM
#ifdef GEN_PASS_REGISTRATION

//===----------------------------------------------------------------------===//
// SparseTensor Registration
//===----------------------------------------------------------------------===//

inline void registerSparseTensorPasses() {
  registerLowerForeachToSCF();
  registerLowerSparseIterationToSCF();
  registerLowerSparseOpsToForeach();
  registerPreSparsificationRewrite();
  registerSparseAssembler();
  registerSparseBufferRewrite();
  registerSparseGPUCodegen();
  registerSparseReinterpretMap();
  registerSparseSpaceCollapse();
  registerSparseTensorCodegen();
  registerSparseTensorConversionPass();
  registerSparseVectorization();
  registerSparsificationAndBufferization();
  registerSparsificationPass();
  registerStageSparseOperations();
  registerStorageSpecifierToLLVM();
}
#undef GEN_PASS_REGISTRATION
#endif // GEN_PASS_REGISTRATION
#ifdef GEN_PASS_CLASSES
#error "GEN_PASS_CLASSES is deprecated; use per-pass macros"
#undef GEN_PASS_CLASSES
#endif // GEN_PASS_CLASSES
