/*===- TableGen'erated file -------------------------------------*- C++ -*-===*\ |* *| |* Interface Declarations *| |* *| |* Automatically generated file, do not edit! *| |* *| \*===----------------------------------------------------------------------===*/ namespace mlir::arith { /// Access to operation fastmath flags. class ArithFastMathInterface; } // namespace mlir::arith namespace mlir::arith { /// Access to op integer overflow flags. class ArithIntegerOverflowFlagsInterface; } // namespace mlir::arith namespace mlir::arith { /// Access to op non-negative (nneg) flag. class ArithNonNegFlagInterface; } // namespace mlir::arith namespace mlir::arith { /// Access to op rounding mode. class ArithRoundingModeInterface; } // namespace mlir::arith namespace mlir::arith { /// Access to operation fastmath flags. namespace detail { struct ArithFastMathInterfaceInterfaceTraits { struct Concept { /// The methods defined by the interface. FastMathFlagsAttr (*getFastMathFlagsAttr)(const Concept *impl, ::mlir::Operation *); StringRef (*getFastMathAttrName)(); }; template class Model : public Concept { public: using Interface = ::mlir::arith::ArithFastMathInterface; Model() : Concept{getFastMathFlagsAttr, getFastMathAttrName} {} static inline FastMathFlagsAttr getFastMathFlagsAttr(const Concept *impl, ::mlir::Operation *tablegen_opaque_val); static inline StringRef getFastMathAttrName(); }; template class FallbackModel : public Concept { public: using Interface = ::mlir::arith::ArithFastMathInterface; FallbackModel() : Concept{getFastMathFlagsAttr, getFastMathAttrName} {} static inline FastMathFlagsAttr getFastMathFlagsAttr(const Concept *impl, ::mlir::Operation *tablegen_opaque_val); static inline StringRef getFastMathAttrName(); }; template class ExternalModel : public FallbackModel { public: using ConcreteEntity = ConcreteOp; FastMathFlagsAttr getFastMathFlagsAttr(::mlir::Operation *tablegen_opaque_val) const; static StringRef getFastMathAttrName(); }; }; template struct ArithFastMathInterfaceTrait; } // namespace detail class ArithFastMathInterface : public ::mlir::OpInterface { public: using ::mlir::OpInterface::OpInterface; template struct Trait : public detail::ArithFastMathInterfaceTrait {}; /// Returns a FastMathFlagsAttr attribute for the operation FastMathFlagsAttr getFastMathFlagsAttr(); /// Returns the name of the FastMathFlagsAttr attribute /// for the operation StringRef getFastMathAttrName(); }; } // namespace mlir::arith namespace mlir::arith { /// Access to op integer overflow flags. namespace detail { struct ArithIntegerOverflowFlagsInterfaceInterfaceTraits { struct Concept { /// The methods defined by the interface. IntegerOverflowFlagsAttr (*getOverflowAttr)(const Concept *impl, ::mlir::Operation *); bool (*hasNoUnsignedWrap)(const Concept *impl, ::mlir::Operation *); bool (*hasNoSignedWrap)(const Concept *impl, ::mlir::Operation *); StringRef (*getIntegerOverflowAttrName)(); }; template class Model : public Concept { public: using Interface = ::mlir::arith::ArithIntegerOverflowFlagsInterface; Model() : Concept{getOverflowAttr, hasNoUnsignedWrap, hasNoSignedWrap, getIntegerOverflowAttrName} {} static inline IntegerOverflowFlagsAttr getOverflowAttr(const Concept *impl, ::mlir::Operation *tablegen_opaque_val); static inline bool hasNoUnsignedWrap(const Concept *impl, ::mlir::Operation *tablegen_opaque_val); static inline bool hasNoSignedWrap(const Concept *impl, ::mlir::Operation *tablegen_opaque_val); static inline StringRef getIntegerOverflowAttrName(); }; template class FallbackModel : public Concept { public: using Interface = ::mlir::arith::ArithIntegerOverflowFlagsInterface; FallbackModel() : Concept{getOverflowAttr, hasNoUnsignedWrap, hasNoSignedWrap, getIntegerOverflowAttrName} {} static inline IntegerOverflowFlagsAttr getOverflowAttr(const Concept *impl, ::mlir::Operation *tablegen_opaque_val); static inline bool hasNoUnsignedWrap(const Concept *impl, ::mlir::Operation *tablegen_opaque_val); static inline bool hasNoSignedWrap(const Concept *impl, ::mlir::Operation *tablegen_opaque_val); static inline StringRef getIntegerOverflowAttrName(); }; template class ExternalModel : public FallbackModel { public: using ConcreteEntity = ConcreteOp; IntegerOverflowFlagsAttr getOverflowAttr(::mlir::Operation *tablegen_opaque_val) const; bool hasNoUnsignedWrap(::mlir::Operation *tablegen_opaque_val) const; bool hasNoSignedWrap(::mlir::Operation *tablegen_opaque_val) const; static StringRef getIntegerOverflowAttrName(); }; }; template struct ArithIntegerOverflowFlagsInterfaceTrait; } // namespace detail class ArithIntegerOverflowFlagsInterface : public ::mlir::OpInterface { public: using ::mlir::OpInterface::OpInterface; template struct Trait : public detail::ArithIntegerOverflowFlagsInterfaceTrait {}; /// Returns an IntegerOverflowFlagsAttr attribute for the operation IntegerOverflowFlagsAttr getOverflowAttr(); /// Returns whether the operation has the No Unsigned Wrap keyword bool hasNoUnsignedWrap(); /// Returns whether the operation has the No Signed Wrap keyword bool hasNoSignedWrap(); /// Returns the name of the IntegerOverflowFlagsAttr attribute /// for the operation StringRef getIntegerOverflowAttrName(); }; } // namespace mlir::arith namespace mlir::arith { /// Access to op non-negative (nneg) flag. namespace detail { struct ArithNonNegFlagInterfaceInterfaceTraits { struct Concept { /// The methods defined by the interface. bool (*getNonNeg)(const Concept *impl, ::mlir::Operation *); void (*setNonNeg)(const Concept *impl, ::mlir::Operation *, bool); StringRef (*getNonNegFlagAttrName)(); }; template class Model : public Concept { public: using Interface = ::mlir::arith::ArithNonNegFlagInterface; Model() : Concept{getNonNeg, setNonNeg, getNonNegFlagAttrName} {} static inline bool getNonNeg(const Concept *impl, ::mlir::Operation *tablegen_opaque_val); static inline void setNonNeg(const Concept *impl, ::mlir::Operation *tablegen_opaque_val, bool nonNeg); static inline StringRef getNonNegFlagAttrName(); }; template class FallbackModel : public Concept { public: using Interface = ::mlir::arith::ArithNonNegFlagInterface; FallbackModel() : Concept{getNonNeg, setNonNeg, getNonNegFlagAttrName} {} static inline bool getNonNeg(const Concept *impl, ::mlir::Operation *tablegen_opaque_val); static inline void setNonNeg(const Concept *impl, ::mlir::Operation *tablegen_opaque_val, bool nonNeg); static inline StringRef getNonNegFlagAttrName(); }; template class ExternalModel : public FallbackModel { public: using ConcreteEntity = ConcreteOp; bool getNonNeg(::mlir::Operation *tablegen_opaque_val) const; void setNonNeg(::mlir::Operation *tablegen_opaque_val, bool nonNeg) const; static StringRef getNonNegFlagAttrName(); }; }; template struct ArithNonNegFlagInterfaceTrait; } // namespace detail class ArithNonNegFlagInterface : public ::mlir::OpInterface { public: using ::mlir::OpInterface::OpInterface; template struct Trait : public detail::ArithNonNegFlagInterfaceTrait {}; /// Returns whether the operation has the nneg flag set bool getNonNeg(); /// Set the nneg flag for the operation void setNonNeg(bool nonNeg); /// Returns the name of the NonNeg flag attribute for /// the operation StringRef getNonNegFlagAttrName(); }; } // namespace mlir::arith namespace mlir::arith { /// Access to op rounding mode. namespace detail { struct ArithRoundingModeInterfaceInterfaceTraits { struct Concept { /// The methods defined by the interface. RoundingModeAttr (*getRoundingModeAttr)(const Concept *impl, ::mlir::Operation *); StringRef (*getRoundingModeAttrName)(); }; template class Model : public Concept { public: using Interface = ::mlir::arith::ArithRoundingModeInterface; Model() : Concept{getRoundingModeAttr, getRoundingModeAttrName} {} static inline RoundingModeAttr getRoundingModeAttr(const Concept *impl, ::mlir::Operation *tablegen_opaque_val); static inline StringRef getRoundingModeAttrName(); }; template class FallbackModel : public Concept { public: using Interface = ::mlir::arith::ArithRoundingModeInterface; FallbackModel() : Concept{getRoundingModeAttr, getRoundingModeAttrName} {} static inline RoundingModeAttr getRoundingModeAttr(const Concept *impl, ::mlir::Operation *tablegen_opaque_val); static inline StringRef getRoundingModeAttrName(); }; template class ExternalModel : public FallbackModel { public: using ConcreteEntity = ConcreteOp; RoundingModeAttr getRoundingModeAttr(::mlir::Operation *tablegen_opaque_val) const; static StringRef getRoundingModeAttrName(); }; }; template struct ArithRoundingModeInterfaceTrait; } // namespace detail class ArithRoundingModeInterface : public ::mlir::OpInterface { public: using ::mlir::OpInterface::OpInterface; template struct Trait : public detail::ArithRoundingModeInterfaceTrait {}; /// Returns a RoundingModeAttr attribute for the operation RoundingModeAttr getRoundingModeAttr(); /// Returns the name of the RoundingModeAttr attribute for /// the operation StringRef getRoundingModeAttrName(); }; } // namespace mlir::arith namespace mlir::arith::detail { template struct ArithFastMathInterfaceTrait : public ::mlir::OpInterface::Trait { /// Returns a FastMathFlagsAttr attribute for the operation FastMathFlagsAttr getFastMathFlagsAttr() { ConcreteOp op = cast(this->getOperation()); return op.getFastmathAttr(); } /// Returns the name of the FastMathFlagsAttr attribute /// for the operation static StringRef getFastMathAttrName() { return "fastmath"; } }; } // namespace mlir::arith::detail namespace mlir::arith::detail { template struct ArithIntegerOverflowFlagsInterfaceTrait : public ::mlir::OpInterface::Trait { /// Returns an IntegerOverflowFlagsAttr attribute for the operation IntegerOverflowFlagsAttr getOverflowAttr() { auto op = cast(this->getOperation()); return op.getOverflowFlagsAttr(); } /// Returns whether the operation has the No Unsigned Wrap keyword bool hasNoUnsignedWrap() { auto op = cast(this->getOperation()); IntegerOverflowFlags flags = op.getOverflowFlagsAttr().getValue(); return bitEnumContainsAll(flags, IntegerOverflowFlags::nuw); } /// Returns whether the operation has the No Signed Wrap keyword bool hasNoSignedWrap() { auto op = cast(this->getOperation()); IntegerOverflowFlags flags = op.getOverflowFlagsAttr().getValue(); return bitEnumContainsAll(flags, IntegerOverflowFlags::nsw); } /// Returns the name of the IntegerOverflowFlagsAttr attribute /// for the operation static StringRef getIntegerOverflowAttrName() { return "overflowFlags"; } }; } // namespace mlir::arith::detail namespace mlir::arith::detail { template struct ArithNonNegFlagInterfaceTrait : public ::mlir::OpInterface::Trait { /// Returns whether the operation has the nneg flag set bool getNonNeg() { auto op = cast(this->getOperation()); return op.getNonNegAttr() != nullptr; } /// Set the nneg flag for the operation void setNonNeg(bool nonNeg) { auto op = cast(this->getOperation()); if (nonNeg) op.setNonNegAttr(UnitAttr::get(op->getContext())); else op.removeNonNegAttr(); } /// Returns the name of the NonNeg flag attribute for /// the operation static StringRef getNonNegFlagAttrName() { return "nonNeg"; } }; } // namespace mlir::arith::detail namespace mlir::arith::detail { template struct ArithRoundingModeInterfaceTrait : public ::mlir::OpInterface::Trait { /// Returns a RoundingModeAttr attribute for the operation RoundingModeAttr getRoundingModeAttr() { auto op = cast(this->getOperation()); return op.getRoundingmodeAttr(); } /// Returns the name of the RoundingModeAttr attribute for /// the operation static StringRef getRoundingModeAttrName() { return "roundingmode"; } }; } // namespace mlir::arith::detail namespace mlir::arith { template FastMathFlagsAttr detail::ArithFastMathInterfaceInterfaceTraits::Model::getFastMathFlagsAttr(const Concept *impl, ::mlir::Operation *tablegen_opaque_val) { return (llvm::cast(tablegen_opaque_val)).getFastMathFlagsAttr(); } template StringRef detail::ArithFastMathInterfaceInterfaceTraits::Model::getFastMathAttrName() { return ConcreteOp::getFastMathAttrName(); } template FastMathFlagsAttr detail::ArithFastMathInterfaceInterfaceTraits::FallbackModel::getFastMathFlagsAttr(const Concept *impl, ::mlir::Operation *tablegen_opaque_val) { return static_cast(impl)->getFastMathFlagsAttr(tablegen_opaque_val); } template StringRef detail::ArithFastMathInterfaceInterfaceTraits::FallbackModel::getFastMathAttrName() { return ConcreteOp::getFastMathAttrName(); } template FastMathFlagsAttr detail::ArithFastMathInterfaceInterfaceTraits::ExternalModel::getFastMathFlagsAttr(::mlir::Operation *tablegen_opaque_val) const { ConcreteOp op = cast(this->getOperation()); return op.getFastmathAttr(); } template StringRef detail::ArithFastMathInterfaceInterfaceTraits::ExternalModel::getFastMathAttrName() { return "fastmath"; } } // namespace mlir::arith namespace mlir::arith { template IntegerOverflowFlagsAttr detail::ArithIntegerOverflowFlagsInterfaceInterfaceTraits::Model::getOverflowAttr(const Concept *impl, ::mlir::Operation *tablegen_opaque_val) { return (llvm::cast(tablegen_opaque_val)).getOverflowAttr(); } template bool detail::ArithIntegerOverflowFlagsInterfaceInterfaceTraits::Model::hasNoUnsignedWrap(const Concept *impl, ::mlir::Operation *tablegen_opaque_val) { return (llvm::cast(tablegen_opaque_val)).hasNoUnsignedWrap(); } template bool detail::ArithIntegerOverflowFlagsInterfaceInterfaceTraits::Model::hasNoSignedWrap(const Concept *impl, ::mlir::Operation *tablegen_opaque_val) { return (llvm::cast(tablegen_opaque_val)).hasNoSignedWrap(); } template StringRef detail::ArithIntegerOverflowFlagsInterfaceInterfaceTraits::Model::getIntegerOverflowAttrName() { return ConcreteOp::getIntegerOverflowAttrName(); } template IntegerOverflowFlagsAttr detail::ArithIntegerOverflowFlagsInterfaceInterfaceTraits::FallbackModel::getOverflowAttr(const Concept *impl, ::mlir::Operation *tablegen_opaque_val) { return static_cast(impl)->getOverflowAttr(tablegen_opaque_val); } template bool detail::ArithIntegerOverflowFlagsInterfaceInterfaceTraits::FallbackModel::hasNoUnsignedWrap(const Concept *impl, ::mlir::Operation *tablegen_opaque_val) { return static_cast(impl)->hasNoUnsignedWrap(tablegen_opaque_val); } template bool detail::ArithIntegerOverflowFlagsInterfaceInterfaceTraits::FallbackModel::hasNoSignedWrap(const Concept *impl, ::mlir::Operation *tablegen_opaque_val) { return static_cast(impl)->hasNoSignedWrap(tablegen_opaque_val); } template StringRef detail::ArithIntegerOverflowFlagsInterfaceInterfaceTraits::FallbackModel::getIntegerOverflowAttrName() { return ConcreteOp::getIntegerOverflowAttrName(); } template IntegerOverflowFlagsAttr detail::ArithIntegerOverflowFlagsInterfaceInterfaceTraits::ExternalModel::getOverflowAttr(::mlir::Operation *tablegen_opaque_val) const { auto op = cast(this->getOperation()); return op.getOverflowFlagsAttr(); } template bool detail::ArithIntegerOverflowFlagsInterfaceInterfaceTraits::ExternalModel::hasNoUnsignedWrap(::mlir::Operation *tablegen_opaque_val) const { auto op = cast(this->getOperation()); IntegerOverflowFlags flags = op.getOverflowFlagsAttr().getValue(); return bitEnumContainsAll(flags, IntegerOverflowFlags::nuw); } template bool detail::ArithIntegerOverflowFlagsInterfaceInterfaceTraits::ExternalModel::hasNoSignedWrap(::mlir::Operation *tablegen_opaque_val) const { auto op = cast(this->getOperation()); IntegerOverflowFlags flags = op.getOverflowFlagsAttr().getValue(); return bitEnumContainsAll(flags, IntegerOverflowFlags::nsw); } template StringRef detail::ArithIntegerOverflowFlagsInterfaceInterfaceTraits::ExternalModel::getIntegerOverflowAttrName() { return "overflowFlags"; } } // namespace mlir::arith namespace mlir::arith { template bool detail::ArithNonNegFlagInterfaceInterfaceTraits::Model::getNonNeg(const Concept *impl, ::mlir::Operation *tablegen_opaque_val) { return (llvm::cast(tablegen_opaque_val)).getNonNeg(); } template void detail::ArithNonNegFlagInterfaceInterfaceTraits::Model::setNonNeg(const Concept *impl, ::mlir::Operation *tablegen_opaque_val, bool nonNeg) { return (llvm::cast(tablegen_opaque_val)).setNonNeg(nonNeg); } template StringRef detail::ArithNonNegFlagInterfaceInterfaceTraits::Model::getNonNegFlagAttrName() { return ConcreteOp::getNonNegFlagAttrName(); } template bool detail::ArithNonNegFlagInterfaceInterfaceTraits::FallbackModel::getNonNeg(const Concept *impl, ::mlir::Operation *tablegen_opaque_val) { return static_cast(impl)->getNonNeg(tablegen_opaque_val); } template void detail::ArithNonNegFlagInterfaceInterfaceTraits::FallbackModel::setNonNeg(const Concept *impl, ::mlir::Operation *tablegen_opaque_val, bool nonNeg) { return static_cast(impl)->setNonNeg(tablegen_opaque_val, nonNeg); } template StringRef detail::ArithNonNegFlagInterfaceInterfaceTraits::FallbackModel::getNonNegFlagAttrName() { return ConcreteOp::getNonNegFlagAttrName(); } template bool detail::ArithNonNegFlagInterfaceInterfaceTraits::ExternalModel::getNonNeg(::mlir::Operation *tablegen_opaque_val) const { auto op = cast(this->getOperation()); return op.getNonNegAttr() != nullptr; } template void detail::ArithNonNegFlagInterfaceInterfaceTraits::ExternalModel::setNonNeg(::mlir::Operation *tablegen_opaque_val, bool nonNeg) const { auto op = cast(this->getOperation()); if (nonNeg) op.setNonNegAttr(UnitAttr::get(op->getContext())); else op.removeNonNegAttr(); } template StringRef detail::ArithNonNegFlagInterfaceInterfaceTraits::ExternalModel::getNonNegFlagAttrName() { return "nonNeg"; } } // namespace mlir::arith namespace mlir::arith { template RoundingModeAttr detail::ArithRoundingModeInterfaceInterfaceTraits::Model::getRoundingModeAttr(const Concept *impl, ::mlir::Operation *tablegen_opaque_val) { return (llvm::cast(tablegen_opaque_val)).getRoundingModeAttr(); } template StringRef detail::ArithRoundingModeInterfaceInterfaceTraits::Model::getRoundingModeAttrName() { return ConcreteOp::getRoundingModeAttrName(); } template RoundingModeAttr detail::ArithRoundingModeInterfaceInterfaceTraits::FallbackModel::getRoundingModeAttr(const Concept *impl, ::mlir::Operation *tablegen_opaque_val) { return static_cast(impl)->getRoundingModeAttr(tablegen_opaque_val); } template StringRef detail::ArithRoundingModeInterfaceInterfaceTraits::FallbackModel::getRoundingModeAttrName() { return ConcreteOp::getRoundingModeAttrName(); } template RoundingModeAttr detail::ArithRoundingModeInterfaceInterfaceTraits::ExternalModel::getRoundingModeAttr(::mlir::Operation *tablegen_opaque_val) const { auto op = cast(this->getOperation()); return op.getRoundingmodeAttr(); } template StringRef detail::ArithRoundingModeInterfaceInterfaceTraits::ExternalModel::getRoundingModeAttrName() { return "roundingmode"; } } // namespace mlir::arith