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

#ifdef GEN_PASS_DECL
// Generate declarations for all passes.
#define GEN_PASS_DECL_AMDGPUEMULATEATOMICSPASS
#undef GEN_PASS_DECL
#endif // GEN_PASS_DECL

//===----------------------------------------------------------------------===//
// AmdgpuEmulateAtomicsPass
//===----------------------------------------------------------------------===//
#ifdef GEN_PASS_DECL_AMDGPUEMULATEATOMICSPASS
struct AmdgpuEmulateAtomicsPassOptions {
  std::string chipset = "gfx000";
};
std::unique_ptr<::mlir::Pass> createAmdgpuEmulateAtomicsPass();
std::unique_ptr<::mlir::Pass> createAmdgpuEmulateAtomicsPass(const AmdgpuEmulateAtomicsPassOptions &options);
#undef GEN_PASS_DECL_AMDGPUEMULATEATOMICSPASS
#endif // GEN_PASS_DECL_AMDGPUEMULATEATOMICSPASS
#ifdef GEN_PASS_DEF_AMDGPUEMULATEATOMICSPASS

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

namespace impl {
  std::unique_ptr<::mlir::Pass> createAmdgpuEmulateAtomicsPass(const AmdgpuEmulateAtomicsPassOptions &options);
} // namespace impl
namespace impl {

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

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

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

  ::llvm::StringRef getDescription() const override { return "Emulate atomic operations on chipsets that do not support them"; }

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

  /// 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<cf::ControlFlowDialect>();
    registry.insert<arith::ArithDialect>();
  }

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

  AmdgpuEmulateAtomicsPassBase(const AmdgpuEmulateAtomicsPassOptions &options) : AmdgpuEmulateAtomicsPassBase() {
    chipset = options.chipset;
  }
protected:
  ::mlir::Pass::Option<std::string> chipset{*this, "chipset", ::llvm::cl::desc("Chipset that these operations will run on"), ::llvm::cl::init("gfx000")};
private:

  friend std::unique_ptr<::mlir::Pass> createAmdgpuEmulateAtomicsPass() {
    return std::make_unique<DerivedT>();
  }

  friend std::unique_ptr<::mlir::Pass> createAmdgpuEmulateAtomicsPass(const AmdgpuEmulateAtomicsPassOptions &options) {
    return std::make_unique<DerivedT>(options);
  }
};
} // namespace impl

std::unique_ptr<::mlir::Pass> createAmdgpuEmulateAtomicsPass() {
  return impl::createAmdgpuEmulateAtomicsPass();
}

std::unique_ptr<::mlir::Pass> createAmdgpuEmulateAtomicsPass(const AmdgpuEmulateAtomicsPassOptions &options) {
  return impl::createAmdgpuEmulateAtomicsPass(options);
}
#undef GEN_PASS_DEF_AMDGPUEMULATEATOMICSPASS
#endif // GEN_PASS_DEF_AMDGPUEMULATEATOMICSPASS
#ifdef GEN_PASS_REGISTRATION

//===----------------------------------------------------------------------===//
// AmdgpuEmulateAtomicsPass Registration
//===----------------------------------------------------------------------===//

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

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

//===----------------------------------------------------------------------===//
// AMDGPU Registration
//===----------------------------------------------------------------------===//

inline void registerAMDGPUPasses() {
  registerAmdgpuEmulateAtomicsPass();
}
#undef GEN_PASS_REGISTRATION
#endif // GEN_PASS_REGISTRATION
// Deprecated. Please use the new per-pass macros.
#ifdef GEN_PASS_CLASSES

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

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

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

  ::llvm::StringRef getDescription() const override { return "Emulate atomic operations on chipsets that do not support them"; }

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

  /// 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));
  }

  /// Register the dialects that must be loaded in the context before this pass.
  void getDependentDialects(::mlir::DialectRegistry &registry) const override {
    registry.insert<cf::ControlFlowDialect>();
    registry.insert<arith::ArithDialect>();
  }

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

protected:
  ::mlir::Pass::Option<std::string> chipset{*this, "chipset", ::llvm::cl::desc("Chipset that these operations will run on"), ::llvm::cl::init("gfx000")};
};
#undef GEN_PASS_CLASSES
#endif // GEN_PASS_CLASSES
