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

#ifdef GEN_PASS_DECL
// Generate declarations for all passes.
#define GEN_PASS_DECL_MARKDECLARETARGETPASS
#define GEN_PASS_DECL_PREPAREFOROMPOFFLOADPRIVATIZATIONPASS
#define GEN_PASS_DECL_STACKTOSHAREDPASS
#undef GEN_PASS_DECL
#endif // GEN_PASS_DECL

//===----------------------------------------------------------------------===//
// MarkDeclareTargetPass
//===----------------------------------------------------------------------===//
#ifdef GEN_PASS_DECL_MARKDECLARETARGETPASS
std::unique_ptr<::mlir::Pass> createMarkDeclareTargetPass();
#undef GEN_PASS_DECL_MARKDECLARETARGETPASS
#endif // GEN_PASS_DECL_MARKDECLARETARGETPASS
#ifdef GEN_PASS_DEF_MARKDECLARETARGETPASS

namespace impl {
  std::unique_ptr<::mlir::Pass> createMarkDeclareTargetPass();
} // namespace impl
namespace impl {

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

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

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

  ::llvm::StringRef getDescription() const override { return R"PD(Marks all functions called by an OpenMP declare target function as declare target)PD"; }

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

  /// 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<mlir::omp::OpenMPDialect>();
  }

  /// 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(MarkDeclareTargetPassBase<DerivedT>)

protected:
private:

  friend std::unique_ptr<::mlir::Pass> createMarkDeclareTargetPass() {
    return std::make_unique<DerivedT>();
  }
};
} // namespace impl

std::unique_ptr<::mlir::Pass> createMarkDeclareTargetPass() {
  return impl::createMarkDeclareTargetPass();
}
#undef GEN_PASS_DEF_MARKDECLARETARGETPASS
#endif // GEN_PASS_DEF_MARKDECLARETARGETPASS

//===----------------------------------------------------------------------===//
// PrepareForOMPOffloadPrivatizationPass
//===----------------------------------------------------------------------===//
#ifdef GEN_PASS_DECL_PREPAREFOROMPOFFLOADPRIVATIZATIONPASS
std::unique_ptr<::mlir::Pass> createPrepareForOMPOffloadPrivatizationPass();
#undef GEN_PASS_DECL_PREPAREFOROMPOFFLOADPRIVATIZATIONPASS
#endif // GEN_PASS_DECL_PREPAREFOROMPOFFLOADPRIVATIZATIONPASS
#ifdef GEN_PASS_DEF_PREPAREFOROMPOFFLOADPRIVATIZATIONPASS

namespace impl {
  std::unique_ptr<::mlir::Pass> createPrepareForOMPOffloadPrivatizationPass();
} // namespace impl
namespace impl {

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

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

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

  ::llvm::StringRef getDescription() const override { return R"PD(Prepare OpenMP maps for privatization for deferred target tasks)PD"; }

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

  /// 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<LLVM::LLVMDialect>();
  }

  /// 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(PrepareForOMPOffloadPrivatizationPassBase<DerivedT>)

protected:
private:

  friend std::unique_ptr<::mlir::Pass> createPrepareForOMPOffloadPrivatizationPass() {
    return std::make_unique<DerivedT>();
  }
};
} // namespace impl

std::unique_ptr<::mlir::Pass> createPrepareForOMPOffloadPrivatizationPass() {
  return impl::createPrepareForOMPOffloadPrivatizationPass();
}
#undef GEN_PASS_DEF_PREPAREFOROMPOFFLOADPRIVATIZATIONPASS
#endif // GEN_PASS_DEF_PREPAREFOROMPOFFLOADPRIVATIZATIONPASS

//===----------------------------------------------------------------------===//
// StackToSharedPass
//===----------------------------------------------------------------------===//
#ifdef GEN_PASS_DECL_STACKTOSHAREDPASS
std::unique_ptr<::mlir::Pass> createStackToSharedPass();
#undef GEN_PASS_DECL_STACKTOSHAREDPASS
#endif // GEN_PASS_DECL_STACKTOSHAREDPASS
#ifdef GEN_PASS_DEF_STACKTOSHAREDPASS

namespace impl {
  std::unique_ptr<::mlir::Pass> createStackToSharedPass();
} // namespace impl
namespace impl {

template <typename DerivedT>
class StackToSharedPassBase : public ::mlir::OperationPass<mlir::LLVM::LLVMFuncOp> {
public:
  using Base = StackToSharedPassBase;

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

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

  ::llvm::StringRef getDescription() const override { return R"PD(Replaces stack allocations target devices with shared memory.)PD"; }

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

  /// 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<mlir::omp::OpenMPDialect>();
  }

  /// 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(StackToSharedPassBase<DerivedT>)

protected:
private:

  friend std::unique_ptr<::mlir::Pass> createStackToSharedPass() {
    return std::make_unique<DerivedT>();
  }
};
} // namespace impl

std::unique_ptr<::mlir::Pass> createStackToSharedPass() {
  return impl::createStackToSharedPass();
}
#undef GEN_PASS_DEF_STACKTOSHAREDPASS
#endif // GEN_PASS_DEF_STACKTOSHAREDPASS
#ifdef GEN_PASS_REGISTRATION
// Generate registrations for all passes.
#define GEN_PASS_REGISTRATION_MARKDECLARETARGETPASS
#define GEN_PASS_REGISTRATION_PREPAREFOROMPOFFLOADPRIVATIZATIONPASS
#define GEN_PASS_REGISTRATION_STACKTOSHAREDPASS
#endif // GEN_PASS_REGISTRATION

//===----------------------------------------------------------------------===//
// MarkDeclareTargetPass Registration
//===----------------------------------------------------------------------===//
#ifdef GEN_PASS_REGISTRATION_MARKDECLARETARGETPASS

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

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

#undef GEN_PASS_REGISTRATION_MARKDECLARETARGETPASS
#endif // GEN_PASS_REGISTRATION_MARKDECLARETARGETPASS

//===----------------------------------------------------------------------===//
// PrepareForOMPOffloadPrivatizationPass Registration
//===----------------------------------------------------------------------===//
#ifdef GEN_PASS_REGISTRATION_PREPAREFOROMPOFFLOADPRIVATIZATIONPASS

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

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

#undef GEN_PASS_REGISTRATION_PREPAREFOROMPOFFLOADPRIVATIZATIONPASS
#endif // GEN_PASS_REGISTRATION_PREPAREFOROMPOFFLOADPRIVATIZATIONPASS

//===----------------------------------------------------------------------===//
// StackToSharedPass Registration
//===----------------------------------------------------------------------===//
#ifdef GEN_PASS_REGISTRATION_STACKTOSHAREDPASS

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

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

#undef GEN_PASS_REGISTRATION_STACKTOSHAREDPASS
#endif // GEN_PASS_REGISTRATION_STACKTOSHAREDPASS
#ifdef GEN_PASS_REGISTRATION

//===----------------------------------------------------------------------===//
// OpenMP Registration
//===----------------------------------------------------------------------===//

inline void registerOpenMPPasses() {
  registerMarkDeclareTargetPass();
  registerPrepareForOMPOffloadPrivatizationPass();
  registerStackToSharedPass();
}
#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
