/*===- TableGen'erated file -------------------------------------*- C++ -*-===*\ |* *| |* Op Declarations *| |* *| |* Automatically generated file, do not edit! *| |* From: ComplexOps.td *| |* *| \*===----------------------------------------------------------------------===*/ namespace mlir::complex { /// computes absolute value of a complex number /// The `abs` op takes a single complex number and computes its absolute value. /// /// Example: /// /// ```mlir /// %a = complex.abs %b : complex /// ``` class AbsOp; } // namespace mlir::complex namespace mlir::complex { /// complex addition /// The `add` operation takes two complex numbers and returns their sum. /// /// Example: /// /// ```mlir /// %a = complex.add %b, %c : complex /// ``` class AddOp; } // namespace mlir::complex namespace mlir::complex { /// computes argument value of a complex number /// The `angle` op takes a single complex number and computes its argument value with a branch cut along the negative real axis. /// /// Example: /// /// ```mlir /// %a = complex.angle %b : complex /// ``` class AngleOp; } // namespace mlir::complex namespace mlir::complex { /// complex 2-argument arctangent /// For complex numbers it is expressed using complex logarithm /// atan2(y, x) = -i * log((x + i * y) / sqrt(x**2 + y**2)) /// /// Example: /// /// ```mlir /// %a = complex.atan2 %b, %c : complex /// ``` class Atan2Op; } // namespace mlir::complex namespace mlir::complex { /// computes bitcast between complex and equal arith types /// Example: /// /// ```mlir /// %a = complex.bitcast %b : complex -> i64 /// ``` class BitcastOp; } // namespace mlir::complex namespace mlir::complex { /// Calculate the complex conjugate /// The `conj` op takes a single complex number and computes the /// complex conjugate. /// /// Example: /// /// ```mlir /// %a = complex.conj %b: complex /// ``` class ConjOp; } // namespace mlir::complex namespace mlir::complex { /// complex number constant operation /// The `complex.constant` operation creates a constant complex number from an /// attribute containing the real and imaginary parts. /// /// Example: /// /// ```mlir /// %a = complex.constant [0.1, -1.0] : complex /// ``` class ConstantOp; } // namespace mlir::complex namespace mlir::complex { /// computes cosine of a complex number /// The `cos` op takes a single complex number and computes the cosine of /// it, i.e. `cos(x)`, where `x` is the input value. /// /// Example: /// /// ```mlir /// %a = complex.cos %b : complex /// ``` class CosOp; } // namespace mlir::complex namespace mlir::complex { /// complex number creation operation /// The `complex.create` operation creates a complex number from two /// floating-point operands, the real and the imaginary part. /// /// Example: /// /// ```mlir /// %a = complex.create %b, %c : complex /// ``` class CreateOp; } // namespace mlir::complex namespace mlir::complex { /// complex division /// The `div` operation takes two complex numbers and returns result of their /// division: /// /// ```mlir /// %a = complex.div %b, %c : complex /// ``` class DivOp; } // namespace mlir::complex namespace mlir::complex { /// computes whether two complex values are equal /// The `eq` op takes two complex numbers and returns whether they are equal. /// /// Example: /// /// ```mlir /// %a = complex.eq %b, %c : complex /// ``` class EqualOp; } // namespace mlir::complex namespace mlir::complex { /// computes exponential of a complex number /// The `exp` op takes a single complex number and computes the exponential of /// it, i.e. `exp(x)` or `e^(x)`, where `x` is the input value. /// `e` denotes Euler's number and is approximately equal to 2.718281. /// /// Example: /// /// ```mlir /// %a = complex.exp %b : complex /// ``` class ExpOp; } // namespace mlir::complex namespace mlir::complex { /// computes exponential of a complex number minus 1 /// complex.expm1(x) := complex.exp(x) - 1 /// /// Example: /// /// ```mlir /// %a = complex.expm1 %b : complex /// ``` class Expm1Op; } // namespace mlir::complex namespace mlir::complex { /// extracts the imaginary part of a complex number /// The `im` op takes a single complex number and extracts the imaginary part. /// /// Example: /// /// ```mlir /// %a = complex.im %b : complex /// ``` class ImOp; } // namespace mlir::complex namespace mlir::complex { /// computes natural logarithm of a complex number /// The `log` op takes a single complex number and computes the natural /// logarithm of one plus the given value, i.e. `log(1 + x)` or `log_e(1 + x)`, /// where `x` is the input value. `e` denotes Euler's number and is /// approximately equal to 2.718281. /// /// Example: /// /// ```mlir /// %a = complex.log1p %b : complex /// ``` class Log1pOp; } // namespace mlir::complex namespace mlir::complex { /// computes natural logarithm of a complex number /// The `log` op takes a single complex number and computes the natural /// logarithm of it, i.e. `log(x)` or `log_e(x)`, where `x` is the input value. /// `e` denotes Euler's number and is approximately equal to 2.718281. /// /// Example: /// /// ```mlir /// %a = complex.log %b : complex /// ``` class LogOp; } // namespace mlir::complex namespace mlir::complex { /// complex multiplication /// The `mul` operation takes two complex numbers and returns their product: /// /// ```mlir /// %a = complex.mul %b, %c : complex /// ``` class MulOp; } // namespace mlir::complex namespace mlir::complex { /// Negation operator /// The `neg` op takes a single complex number `complex` and returns `-complex`. /// /// Example: /// /// ```mlir /// %a = complex.neg %b : complex /// ``` class NegOp; } // namespace mlir::complex namespace mlir::complex { /// computes whether two complex values are not equal /// The `neq` op takes two complex numbers and returns whether they are not /// equal. /// /// Example: /// /// ```mlir /// %a = complex.neq %b, %c : complex /// ``` class NotEqualOp; } // namespace mlir::complex namespace mlir::complex { /// complex power function /// The `pow` operation takes a complex number raises it to the given complex /// exponent. /// /// Example: /// /// ```mlir /// %a = complex.pow %b, %c : complex /// ``` class PowOp; } // namespace mlir::complex namespace mlir::complex { /// complex number raised to signed integer power /// The `powi` operation takes a `base` operand of complex type and a `power` /// operand of signed integer type and returns one result of the same type /// as `base`. The result is `base` raised to the power of `power`. /// /// Example: /// /// ```mlir /// %a = complex.powi %b, %c : complex, i32 /// ``` class PowiOp; } // namespace mlir::complex namespace mlir::complex { /// extracts the real part of a complex number /// The `re` op takes a single complex number and extracts the real part. /// /// Example: /// /// ```mlir /// %a = complex.re %b : complex /// ``` class ReOp; } // namespace mlir::complex namespace mlir::complex { /// complex reciprocal of square root /// The `rsqrt` operation computes reciprocal of square root. /// /// Example: /// /// ```mlir /// %a = complex.rsqrt %b : complex /// ``` class RsqrtOp; } // namespace mlir::complex namespace mlir::complex { /// computes sign of a complex number /// The `sign` op takes a single complex number and computes the sign of /// it, i.e. `y = sign(x) = x / |x|` if `x != 0`, otherwise `y = 0`. /// /// Example: /// /// ```mlir /// %a = complex.sign %b : complex /// ``` class SignOp; } // namespace mlir::complex namespace mlir::complex { /// computes sine of a complex number /// The `sin` op takes a single complex number and computes the sine of /// it, i.e. `sin(x)`, where `x` is the input value. /// /// Example: /// /// ```mlir /// %a = complex.sin %b : complex /// ``` class SinOp; } // namespace mlir::complex namespace mlir::complex { /// complex square root /// The `sqrt` operation takes a complex number and returns its square root. /// /// Example: /// /// ```mlir /// %a = complex.sqrt %b : complex /// ``` class SqrtOp; } // namespace mlir::complex namespace mlir::complex { /// complex subtraction /// The `sub` operation takes two complex numbers and returns their difference. /// /// Example: /// /// ```mlir /// %a = complex.sub %b, %c : complex /// ``` class SubOp; } // namespace mlir::complex namespace mlir::complex { /// computes tangent of a complex number /// The `tan` op takes a single complex number and computes the tangent of /// it, i.e. `tan(x)`, where `x` is the input value. /// /// Example: /// /// ```mlir /// %a = complex.tan %b : complex /// ``` class TanOp; } // namespace mlir::complex namespace mlir::complex { /// complex hyperbolic tangent /// The `tanh` operation takes a complex number and returns its hyperbolic /// tangent. /// /// Example: /// /// ```mlir /// %a = complex.tanh %b : complex /// ``` class TanhOp; } // namespace mlir::complex #ifdef GET_OP_CLASSES #undef GET_OP_CLASSES namespace mlir::complex { //===----------------------------------------------------------------------===// // ::mlir::complex::AbsOp declarations //===----------------------------------------------------------------------===// namespace detail { class AbsOpGenericAdaptorBase { public: struct Properties { using fastmathTy = ::mlir::arith::FastMathFlagsAttr; fastmathTy fastmath; auto getFastmath() const { auto &propStorage = this->fastmath; return ::llvm::dyn_cast_or_null<::mlir::arith::FastMathFlagsAttr>(propStorage); } void setFastmath(const ::mlir::arith::FastMathFlagsAttr &propValue) { this->fastmath = propValue; } bool operator==(const Properties &rhs) const { return rhs.fastmath == this->fastmath && true; } bool operator!=(const Properties &rhs) const { return !(*this == rhs); } }; protected: ::mlir::DictionaryAttr odsAttrs; ::std::optional<::mlir::OperationName> odsOpName; Properties properties; ::mlir::RegionRange odsRegions; public: AbsOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : odsAttrs(attrs), properties(properties), odsRegions(regions) { if (odsAttrs) odsOpName.emplace("complex.abs", odsAttrs.getContext()); } AbsOpGenericAdaptorBase(AbsOp op); std::pair getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize) { return {index, 1}; } const Properties &getProperties() { return properties; } ::mlir::DictionaryAttr getAttributes() { return odsAttrs; } ::mlir::arith::FastMathFlagsAttr getFastmathAttr(); ::mlir::arith::FastMathFlags getFastmath(); }; } // namespace detail template class AbsOpGenericAdaptor : public detail::AbsOpGenericAdaptorBase { using ValueT = ::llvm::detail::ValueOfRange; using Base = detail::AbsOpGenericAdaptorBase; static constexpr int odsIndex_complex = 0; public: AbsOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {} AbsOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::PropertyRef properties, ::mlir::RegionRange regions = {}) : AbsOpGenericAdaptor(values, attrs, (properties ? *properties.as() : Properties{}), regions) {} AbsOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs = nullptr) : AbsOpGenericAdaptor(values, attrs, Properties{}, {}) {} AbsOpGenericAdaptor(RangeT values, const AbsOpGenericAdaptorBase &base) : Base(base), odsOperands(values) {} template >> AbsOpGenericAdaptor(RangeT values, LateInst op) : Base(op), odsOperands(values) {} std::pair getODSOperandIndexAndLength(unsigned index) { return Base::getODSOperandIndexAndLength(index, odsOperands.size()); } RangeT getODSOperands(unsigned index) { auto valueRange = getODSOperandIndexAndLength(index); return {std::next(odsOperands.begin(), valueRange.first), std::next(odsOperands.begin(), valueRange.first + valueRange.second)}; } ValueT getComplex() { return (*getODSOperands(0).begin()); } RangeT getOperands() { return odsOperands; } private: RangeT odsOperands; }; class AbsOpAdaptor : public AbsOpGenericAdaptor<::mlir::ValueRange> { public: using AbsOpGenericAdaptor::AbsOpGenericAdaptor; AbsOpAdaptor(AbsOp op); ::llvm::LogicalResult verify(::mlir::Location loc); }; class AbsOp : public ::mlir::Op::Impl, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::OneOperand, ::mlir::OpTrait::OpInvariants, ::mlir::BytecodeOpInterface::Trait, ::mlir::ConditionallySpeculatable::Trait, ::mlir::OpTrait::AlwaysSpeculatableImplTrait, ::mlir::MemoryEffectOpInterface::Trait, ::mlir::OpTrait::Elementwise, ::mlir::arith::ArithFastMathInterface::Trait, ::mlir::InferTypeOpInterface::Trait> { public: using Op::Op; using Op::print; using Adaptor = AbsOpAdaptor; template using GenericAdaptor = AbsOpGenericAdaptor; using FoldAdaptor = GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute>>; static constexpr int odsIndex_complex = 0; using Properties = FoldAdaptor::Properties; using ::mlir::arith::ArithFastMathInterface::Trait::getFastMathFlagsAttr; using ::mlir::arith::ArithFastMathInterface::Trait::getFastMathAttrName; static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() { static ::llvm::StringRef attrNames[] = {::llvm::StringRef("fastmath")}; return ::llvm::ArrayRef(attrNames); } ::mlir::StringAttr getFastmathAttrName() { return getAttributeNameForIndex(0); } static ::mlir::StringAttr getFastmathAttrName(::mlir::OperationName name) { return getAttributeNameForIndex(name, 0); } static constexpr ::llvm::StringLiteral getOperationName() { return ::llvm::StringLiteral("complex.abs"); } std::pair getODSOperandIndexAndLength(unsigned index) { return {index, 1}; } ::mlir::Operation::operand_range getODSOperands(unsigned index) { auto valueRange = getODSOperandIndexAndLength(index); return {std::next(getOperation()->operand_begin(), valueRange.first), std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)}; } ::mlir::TypedValue<::mlir::ComplexType> getComplex() { return ::llvm::cast<::mlir::TypedValue<::mlir::ComplexType>>(*getODSOperands(0).begin()); } ::mlir::OpOperand &getComplexMutable() { auto range = getODSOperandIndexAndLength(0); return getOperation()->getOpOperand(range.first); } std::pair getODSResultIndexAndLength(unsigned index) { return {index, 1}; } ::mlir::Operation::result_range getODSResults(unsigned index) { auto valueRange = getODSResultIndexAndLength(index); return {std::next(getOperation()->result_begin(), valueRange.first), std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)}; } ::mlir::TypedValue<::mlir::FloatType> getResult() { return ::llvm::cast<::mlir::TypedValue<::mlir::FloatType>>(*getODSResults(0).begin()); } static ::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); static ::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop); static llvm::hash_code computePropertiesHash(const Properties &prop); static std::optional getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name); static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value); static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs); static ::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); static ::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state); void writeProperties(::mlir::DialectBytecodeWriter &writer); ::mlir::arith::FastMathFlagsAttr getFastmathAttr() { return ::llvm::dyn_cast_or_null<::mlir::arith::FastMathFlagsAttr>(getProperties().fastmath); } ::mlir::arith::FastMathFlags getFastmath(); void setFastmathAttr(::mlir::arith::FastMathFlagsAttr attr) { getProperties().fastmath = attr; } void setFastmath(::mlir::arith::FastMathFlags attrValue); static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value complex, ::mlir::arith::FastMathFlagsAttr fastmath); static AbsOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::Value complex, ::mlir::arith::FastMathFlagsAttr fastmath); static AbsOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type result, ::mlir::Value complex, ::mlir::arith::FastMathFlagsAttr fastmath); static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value complex, ::mlir::arith::FastMathFlagsAttr fastmath); static AbsOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value complex, ::mlir::arith::FastMathFlagsAttr fastmath); static AbsOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value complex, ::mlir::arith::FastMathFlagsAttr fastmath); static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value complex, ::mlir::arith::FastMathFlagsAttr fastmath); static AbsOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value complex, ::mlir::arith::FastMathFlagsAttr fastmath); static AbsOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value complex, ::mlir::arith::FastMathFlagsAttr fastmath); static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value complex, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); static AbsOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::Value complex, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); static AbsOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type result, ::mlir::Value complex, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value complex, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); static AbsOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value complex, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); static AbsOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value complex, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value complex, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); static AbsOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value complex, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); static AbsOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value complex, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); static AbsOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); static AbsOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); static AbsOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); static AbsOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); static AbsOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); static AbsOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); static AbsOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); static AbsOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); static void populateDefaultProperties(::mlir::OperationName opName, Properties &properties); ::llvm::LogicalResult verifyInvariantsImpl(); ::llvm::LogicalResult verifyInvariants(); static ::llvm::LogicalResult inferReturnTypes(::mlir::MLIRContext *context, ::std::optional<::mlir::Location> location, ::mlir::ValueRange operands, ::mlir::DictionaryAttr attributes, ::mlir::PropertyRef properties, ::mlir::RegionRange regions, ::llvm::SmallVectorImpl<::mlir::Type>&inferredReturnTypes); static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result); void print(::mlir::OpAsmPrinter &_odsPrinter); void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects); private: ::mlir::StringAttr getAttributeNameForIndex(unsigned index) { return getAttributeNameForIndex((*this)->getName(), index); } static ::mlir::StringAttr getAttributeNameForIndex(::mlir::OperationName name, unsigned index) { assert(index < 1 && "invalid attribute index"); assert(name.getStringRef() == getOperationName() && "invalid operation name"); assert(name.isRegistered() && "Operation isn't registered, missing a " "dependent dialect loading?"); return name.getAttributeNames()[index]; } public: }; } // namespace mlir::complex MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::complex::AbsOp) MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::complex::detail::AbsOpGenericAdaptorBase::Properties) namespace mlir::complex { //===----------------------------------------------------------------------===// // ::mlir::complex::AddOp declarations //===----------------------------------------------------------------------===// namespace detail { class AddOpGenericAdaptorBase { public: struct Properties { using fastmathTy = ::mlir::arith::FastMathFlagsAttr; fastmathTy fastmath; auto getFastmath() const { auto &propStorage = this->fastmath; return ::llvm::dyn_cast_or_null<::mlir::arith::FastMathFlagsAttr>(propStorage); } void setFastmath(const ::mlir::arith::FastMathFlagsAttr &propValue) { this->fastmath = propValue; } bool operator==(const Properties &rhs) const { return rhs.fastmath == this->fastmath && true; } bool operator!=(const Properties &rhs) const { return !(*this == rhs); } }; protected: ::mlir::DictionaryAttr odsAttrs; ::std::optional<::mlir::OperationName> odsOpName; Properties properties; ::mlir::RegionRange odsRegions; public: AddOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : odsAttrs(attrs), properties(properties), odsRegions(regions) { if (odsAttrs) odsOpName.emplace("complex.add", odsAttrs.getContext()); } AddOpGenericAdaptorBase(AddOp op); std::pair getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize) { return {index, 1}; } const Properties &getProperties() { return properties; } ::mlir::DictionaryAttr getAttributes() { return odsAttrs; } ::mlir::arith::FastMathFlagsAttr getFastmathAttr(); ::mlir::arith::FastMathFlags getFastmath(); }; } // namespace detail template class AddOpGenericAdaptor : public detail::AddOpGenericAdaptorBase { using ValueT = ::llvm::detail::ValueOfRange; using Base = detail::AddOpGenericAdaptorBase; static constexpr int odsIndex_lhs = 0; static constexpr int odsIndex_rhs = 1; public: AddOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {} AddOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::PropertyRef properties, ::mlir::RegionRange regions = {}) : AddOpGenericAdaptor(values, attrs, (properties ? *properties.as() : Properties{}), regions) {} AddOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs = nullptr) : AddOpGenericAdaptor(values, attrs, Properties{}, {}) {} AddOpGenericAdaptor(RangeT values, const AddOpGenericAdaptorBase &base) : Base(base), odsOperands(values) {} template >> AddOpGenericAdaptor(RangeT values, LateInst op) : Base(op), odsOperands(values) {} std::pair getODSOperandIndexAndLength(unsigned index) { return Base::getODSOperandIndexAndLength(index, odsOperands.size()); } RangeT getODSOperands(unsigned index) { auto valueRange = getODSOperandIndexAndLength(index); return {std::next(odsOperands.begin(), valueRange.first), std::next(odsOperands.begin(), valueRange.first + valueRange.second)}; } ValueT getLhs() { return (*getODSOperands(0).begin()); } ValueT getRhs() { return (*getODSOperands(1).begin()); } RangeT getOperands() { return odsOperands; } private: RangeT odsOperands; }; class AddOpAdaptor : public AddOpGenericAdaptor<::mlir::ValueRange> { public: using AddOpGenericAdaptor::AddOpGenericAdaptor; AddOpAdaptor(AddOp op); ::llvm::LogicalResult verify(::mlir::Location loc); }; class AddOp : public ::mlir::Op::Impl, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::NOperands<2>::Impl, ::mlir::OpTrait::OpInvariants, ::mlir::BytecodeOpInterface::Trait, ::mlir::ConditionallySpeculatable::Trait, ::mlir::OpTrait::AlwaysSpeculatableImplTrait, ::mlir::MemoryEffectOpInterface::Trait, ::mlir::OpTrait::SameOperandsAndResultType, ::mlir::OpTrait::Elementwise, ::mlir::arith::ArithFastMathInterface::Trait, ::mlir::InferTypeOpInterface::Trait> { public: using Op::Op; using Op::print; using Adaptor = AddOpAdaptor; template using GenericAdaptor = AddOpGenericAdaptor; using FoldAdaptor = GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute>>; static constexpr int odsIndex_lhs = 0; static constexpr int odsIndex_rhs = 1; using Properties = FoldAdaptor::Properties; using ::mlir::arith::ArithFastMathInterface::Trait::getFastMathFlagsAttr; using ::mlir::arith::ArithFastMathInterface::Trait::getFastMathAttrName; static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() { static ::llvm::StringRef attrNames[] = {::llvm::StringRef("fastmath")}; return ::llvm::ArrayRef(attrNames); } ::mlir::StringAttr getFastmathAttrName() { return getAttributeNameForIndex(0); } static ::mlir::StringAttr getFastmathAttrName(::mlir::OperationName name) { return getAttributeNameForIndex(name, 0); } static constexpr ::llvm::StringLiteral getOperationName() { return ::llvm::StringLiteral("complex.add"); } std::pair getODSOperandIndexAndLength(unsigned index) { return {index, 1}; } ::mlir::Operation::operand_range getODSOperands(unsigned index) { auto valueRange = getODSOperandIndexAndLength(index); return {std::next(getOperation()->operand_begin(), valueRange.first), std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)}; } ::mlir::TypedValue<::mlir::ComplexType> getLhs() { return ::llvm::cast<::mlir::TypedValue<::mlir::ComplexType>>(*getODSOperands(0).begin()); } ::mlir::TypedValue<::mlir::ComplexType> getRhs() { return ::llvm::cast<::mlir::TypedValue<::mlir::ComplexType>>(*getODSOperands(1).begin()); } ::mlir::OpOperand &getLhsMutable() { auto range = getODSOperandIndexAndLength(0); return getOperation()->getOpOperand(range.first); } ::mlir::OpOperand &getRhsMutable() { auto range = getODSOperandIndexAndLength(1); return getOperation()->getOpOperand(range.first); } std::pair getODSResultIndexAndLength(unsigned index) { return {index, 1}; } ::mlir::Operation::result_range getODSResults(unsigned index) { auto valueRange = getODSResultIndexAndLength(index); return {std::next(getOperation()->result_begin(), valueRange.first), std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)}; } ::mlir::TypedValue<::mlir::ComplexType> getResult() { return ::llvm::cast<::mlir::TypedValue<::mlir::ComplexType>>(*getODSResults(0).begin()); } static ::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); static ::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop); static llvm::hash_code computePropertiesHash(const Properties &prop); static std::optional getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name); static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value); static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs); static ::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); static ::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state); void writeProperties(::mlir::DialectBytecodeWriter &writer); ::mlir::arith::FastMathFlagsAttr getFastmathAttr() { return ::llvm::dyn_cast_or_null<::mlir::arith::FastMathFlagsAttr>(getProperties().fastmath); } ::mlir::arith::FastMathFlags getFastmath(); void setFastmathAttr(::mlir::arith::FastMathFlagsAttr attr) { getProperties().fastmath = attr; } void setFastmath(::mlir::arith::FastMathFlags attrValue); static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlagsAttr fastmath); static AddOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlagsAttr fastmath); static AddOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlagsAttr fastmath); static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlagsAttr fastmath); static AddOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlagsAttr fastmath); static AddOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlagsAttr fastmath); static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlagsAttr fastmath); static AddOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlagsAttr fastmath); static AddOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlagsAttr fastmath); static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); static AddOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); static AddOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); static AddOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); static AddOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); static AddOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); static AddOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); static AddOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); static AddOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); static AddOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); static AddOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); static AddOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); static AddOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); static AddOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); static AddOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); static void populateDefaultProperties(::mlir::OperationName opName, Properties &properties); ::llvm::LogicalResult verifyInvariantsImpl(); ::llvm::LogicalResult verifyInvariants(); ::mlir::OpFoldResult fold(FoldAdaptor adaptor); static ::llvm::LogicalResult inferReturnTypes(::mlir::MLIRContext *context, ::std::optional<::mlir::Location> location, ::mlir::ValueRange operands, ::mlir::DictionaryAttr attributes, ::mlir::PropertyRef properties, ::mlir::RegionRange regions, ::llvm::SmallVectorImpl<::mlir::Type>&inferredReturnTypes); static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result); void print(::mlir::OpAsmPrinter &_odsPrinter); void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects); private: ::mlir::StringAttr getAttributeNameForIndex(unsigned index) { return getAttributeNameForIndex((*this)->getName(), index); } static ::mlir::StringAttr getAttributeNameForIndex(::mlir::OperationName name, unsigned index) { assert(index < 1 && "invalid attribute index"); assert(name.getStringRef() == getOperationName() && "invalid operation name"); assert(name.isRegistered() && "Operation isn't registered, missing a " "dependent dialect loading?"); return name.getAttributeNames()[index]; } public: }; } // namespace mlir::complex MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::complex::AddOp) MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::complex::detail::AddOpGenericAdaptorBase::Properties) namespace mlir::complex { //===----------------------------------------------------------------------===// // ::mlir::complex::AngleOp declarations //===----------------------------------------------------------------------===// namespace detail { class AngleOpGenericAdaptorBase { public: struct Properties { using fastmathTy = ::mlir::arith::FastMathFlagsAttr; fastmathTy fastmath; auto getFastmath() const { auto &propStorage = this->fastmath; return ::llvm::dyn_cast_or_null<::mlir::arith::FastMathFlagsAttr>(propStorage); } void setFastmath(const ::mlir::arith::FastMathFlagsAttr &propValue) { this->fastmath = propValue; } bool operator==(const Properties &rhs) const { return rhs.fastmath == this->fastmath && true; } bool operator!=(const Properties &rhs) const { return !(*this == rhs); } }; protected: ::mlir::DictionaryAttr odsAttrs; ::std::optional<::mlir::OperationName> odsOpName; Properties properties; ::mlir::RegionRange odsRegions; public: AngleOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : odsAttrs(attrs), properties(properties), odsRegions(regions) { if (odsAttrs) odsOpName.emplace("complex.angle", odsAttrs.getContext()); } AngleOpGenericAdaptorBase(AngleOp op); std::pair getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize) { return {index, 1}; } const Properties &getProperties() { return properties; } ::mlir::DictionaryAttr getAttributes() { return odsAttrs; } ::mlir::arith::FastMathFlagsAttr getFastmathAttr(); ::mlir::arith::FastMathFlags getFastmath(); }; } // namespace detail template class AngleOpGenericAdaptor : public detail::AngleOpGenericAdaptorBase { using ValueT = ::llvm::detail::ValueOfRange; using Base = detail::AngleOpGenericAdaptorBase; static constexpr int odsIndex_complex = 0; public: AngleOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {} AngleOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::PropertyRef properties, ::mlir::RegionRange regions = {}) : AngleOpGenericAdaptor(values, attrs, (properties ? *properties.as() : Properties{}), regions) {} AngleOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs = nullptr) : AngleOpGenericAdaptor(values, attrs, Properties{}, {}) {} AngleOpGenericAdaptor(RangeT values, const AngleOpGenericAdaptorBase &base) : Base(base), odsOperands(values) {} template >> AngleOpGenericAdaptor(RangeT values, LateInst op) : Base(op), odsOperands(values) {} std::pair getODSOperandIndexAndLength(unsigned index) { return Base::getODSOperandIndexAndLength(index, odsOperands.size()); } RangeT getODSOperands(unsigned index) { auto valueRange = getODSOperandIndexAndLength(index); return {std::next(odsOperands.begin(), valueRange.first), std::next(odsOperands.begin(), valueRange.first + valueRange.second)}; } ValueT getComplex() { return (*getODSOperands(0).begin()); } RangeT getOperands() { return odsOperands; } private: RangeT odsOperands; }; class AngleOpAdaptor : public AngleOpGenericAdaptor<::mlir::ValueRange> { public: using AngleOpGenericAdaptor::AngleOpGenericAdaptor; AngleOpAdaptor(AngleOp op); ::llvm::LogicalResult verify(::mlir::Location loc); }; class AngleOp : public ::mlir::Op::Impl, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::OneOperand, ::mlir::OpTrait::OpInvariants, ::mlir::BytecodeOpInterface::Trait, ::mlir::ConditionallySpeculatable::Trait, ::mlir::OpTrait::AlwaysSpeculatableImplTrait, ::mlir::MemoryEffectOpInterface::Trait, ::mlir::OpTrait::Elementwise, ::mlir::arith::ArithFastMathInterface::Trait, ::mlir::InferTypeOpInterface::Trait> { public: using Op::Op; using Op::print; using Adaptor = AngleOpAdaptor; template using GenericAdaptor = AngleOpGenericAdaptor; using FoldAdaptor = GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute>>; static constexpr int odsIndex_complex = 0; using Properties = FoldAdaptor::Properties; using ::mlir::arith::ArithFastMathInterface::Trait::getFastMathFlagsAttr; using ::mlir::arith::ArithFastMathInterface::Trait::getFastMathAttrName; static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() { static ::llvm::StringRef attrNames[] = {::llvm::StringRef("fastmath")}; return ::llvm::ArrayRef(attrNames); } ::mlir::StringAttr getFastmathAttrName() { return getAttributeNameForIndex(0); } static ::mlir::StringAttr getFastmathAttrName(::mlir::OperationName name) { return getAttributeNameForIndex(name, 0); } static constexpr ::llvm::StringLiteral getOperationName() { return ::llvm::StringLiteral("complex.angle"); } std::pair getODSOperandIndexAndLength(unsigned index) { return {index, 1}; } ::mlir::Operation::operand_range getODSOperands(unsigned index) { auto valueRange = getODSOperandIndexAndLength(index); return {std::next(getOperation()->operand_begin(), valueRange.first), std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)}; } ::mlir::TypedValue<::mlir::ComplexType> getComplex() { return ::llvm::cast<::mlir::TypedValue<::mlir::ComplexType>>(*getODSOperands(0).begin()); } ::mlir::OpOperand &getComplexMutable() { auto range = getODSOperandIndexAndLength(0); return getOperation()->getOpOperand(range.first); } std::pair getODSResultIndexAndLength(unsigned index) { return {index, 1}; } ::mlir::Operation::result_range getODSResults(unsigned index) { auto valueRange = getODSResultIndexAndLength(index); return {std::next(getOperation()->result_begin(), valueRange.first), std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)}; } ::mlir::TypedValue<::mlir::FloatType> getResult() { return ::llvm::cast<::mlir::TypedValue<::mlir::FloatType>>(*getODSResults(0).begin()); } static ::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); static ::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop); static llvm::hash_code computePropertiesHash(const Properties &prop); static std::optional getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name); static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value); static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs); static ::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); static ::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state); void writeProperties(::mlir::DialectBytecodeWriter &writer); ::mlir::arith::FastMathFlagsAttr getFastmathAttr() { return ::llvm::dyn_cast_or_null<::mlir::arith::FastMathFlagsAttr>(getProperties().fastmath); } ::mlir::arith::FastMathFlags getFastmath(); void setFastmathAttr(::mlir::arith::FastMathFlagsAttr attr) { getProperties().fastmath = attr; } void setFastmath(::mlir::arith::FastMathFlags attrValue); static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value complex, ::mlir::arith::FastMathFlagsAttr fastmath); static AngleOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::Value complex, ::mlir::arith::FastMathFlagsAttr fastmath); static AngleOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type result, ::mlir::Value complex, ::mlir::arith::FastMathFlagsAttr fastmath); static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value complex, ::mlir::arith::FastMathFlagsAttr fastmath); static AngleOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value complex, ::mlir::arith::FastMathFlagsAttr fastmath); static AngleOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value complex, ::mlir::arith::FastMathFlagsAttr fastmath); static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value complex, ::mlir::arith::FastMathFlagsAttr fastmath); static AngleOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value complex, ::mlir::arith::FastMathFlagsAttr fastmath); static AngleOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value complex, ::mlir::arith::FastMathFlagsAttr fastmath); static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value complex, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); static AngleOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::Value complex, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); static AngleOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type result, ::mlir::Value complex, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value complex, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); static AngleOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value complex, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); static AngleOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value complex, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value complex, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); static AngleOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value complex, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); static AngleOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value complex, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); static AngleOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); static AngleOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); static AngleOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); static AngleOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); static AngleOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); static AngleOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); static AngleOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); static AngleOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); static void populateDefaultProperties(::mlir::OperationName opName, Properties &properties); ::llvm::LogicalResult verifyInvariantsImpl(); ::llvm::LogicalResult verifyInvariants(); static ::llvm::LogicalResult inferReturnTypes(::mlir::MLIRContext *context, ::std::optional<::mlir::Location> location, ::mlir::ValueRange operands, ::mlir::DictionaryAttr attributes, ::mlir::PropertyRef properties, ::mlir::RegionRange regions, ::llvm::SmallVectorImpl<::mlir::Type>&inferredReturnTypes); static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result); void print(::mlir::OpAsmPrinter &_odsPrinter); void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects); private: ::mlir::StringAttr getAttributeNameForIndex(unsigned index) { return getAttributeNameForIndex((*this)->getName(), index); } static ::mlir::StringAttr getAttributeNameForIndex(::mlir::OperationName name, unsigned index) { assert(index < 1 && "invalid attribute index"); assert(name.getStringRef() == getOperationName() && "invalid operation name"); assert(name.isRegistered() && "Operation isn't registered, missing a " "dependent dialect loading?"); return name.getAttributeNames()[index]; } public: }; } // namespace mlir::complex MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::complex::AngleOp) MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::complex::detail::AngleOpGenericAdaptorBase::Properties) namespace mlir::complex { //===----------------------------------------------------------------------===// // ::mlir::complex::Atan2Op declarations //===----------------------------------------------------------------------===// namespace detail { class Atan2OpGenericAdaptorBase { public: struct Properties { using fastmathTy = ::mlir::arith::FastMathFlagsAttr; fastmathTy fastmath; auto getFastmath() const { auto &propStorage = this->fastmath; return ::llvm::dyn_cast_or_null<::mlir::arith::FastMathFlagsAttr>(propStorage); } void setFastmath(const ::mlir::arith::FastMathFlagsAttr &propValue) { this->fastmath = propValue; } bool operator==(const Properties &rhs) const { return rhs.fastmath == this->fastmath && true; } bool operator!=(const Properties &rhs) const { return !(*this == rhs); } }; protected: ::mlir::DictionaryAttr odsAttrs; ::std::optional<::mlir::OperationName> odsOpName; Properties properties; ::mlir::RegionRange odsRegions; public: Atan2OpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : odsAttrs(attrs), properties(properties), odsRegions(regions) { if (odsAttrs) odsOpName.emplace("complex.atan2", odsAttrs.getContext()); } Atan2OpGenericAdaptorBase(Atan2Op op); std::pair getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize) { return {index, 1}; } const Properties &getProperties() { return properties; } ::mlir::DictionaryAttr getAttributes() { return odsAttrs; } ::mlir::arith::FastMathFlagsAttr getFastmathAttr(); ::mlir::arith::FastMathFlags getFastmath(); }; } // namespace detail template class Atan2OpGenericAdaptor : public detail::Atan2OpGenericAdaptorBase { using ValueT = ::llvm::detail::ValueOfRange; using Base = detail::Atan2OpGenericAdaptorBase; static constexpr int odsIndex_lhs = 0; static constexpr int odsIndex_rhs = 1; public: Atan2OpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {} Atan2OpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::PropertyRef properties, ::mlir::RegionRange regions = {}) : Atan2OpGenericAdaptor(values, attrs, (properties ? *properties.as() : Properties{}), regions) {} Atan2OpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs = nullptr) : Atan2OpGenericAdaptor(values, attrs, Properties{}, {}) {} Atan2OpGenericAdaptor(RangeT values, const Atan2OpGenericAdaptorBase &base) : Base(base), odsOperands(values) {} template >> Atan2OpGenericAdaptor(RangeT values, LateInst op) : Base(op), odsOperands(values) {} std::pair getODSOperandIndexAndLength(unsigned index) { return Base::getODSOperandIndexAndLength(index, odsOperands.size()); } RangeT getODSOperands(unsigned index) { auto valueRange = getODSOperandIndexAndLength(index); return {std::next(odsOperands.begin(), valueRange.first), std::next(odsOperands.begin(), valueRange.first + valueRange.second)}; } ValueT getLhs() { return (*getODSOperands(0).begin()); } ValueT getRhs() { return (*getODSOperands(1).begin()); } RangeT getOperands() { return odsOperands; } private: RangeT odsOperands; }; class Atan2OpAdaptor : public Atan2OpGenericAdaptor<::mlir::ValueRange> { public: using Atan2OpGenericAdaptor::Atan2OpGenericAdaptor; Atan2OpAdaptor(Atan2Op op); ::llvm::LogicalResult verify(::mlir::Location loc); }; class Atan2Op : public ::mlir::Op::Impl, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::NOperands<2>::Impl, ::mlir::OpTrait::OpInvariants, ::mlir::BytecodeOpInterface::Trait, ::mlir::ConditionallySpeculatable::Trait, ::mlir::OpTrait::AlwaysSpeculatableImplTrait, ::mlir::MemoryEffectOpInterface::Trait, ::mlir::OpTrait::SameOperandsAndResultType, ::mlir::OpTrait::Elementwise, ::mlir::arith::ArithFastMathInterface::Trait, ::mlir::InferTypeOpInterface::Trait> { public: using Op::Op; using Op::print; using Adaptor = Atan2OpAdaptor; template using GenericAdaptor = Atan2OpGenericAdaptor; using FoldAdaptor = GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute>>; static constexpr int odsIndex_lhs = 0; static constexpr int odsIndex_rhs = 1; using Properties = FoldAdaptor::Properties; using ::mlir::arith::ArithFastMathInterface::Trait::getFastMathFlagsAttr; using ::mlir::arith::ArithFastMathInterface::Trait::getFastMathAttrName; static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() { static ::llvm::StringRef attrNames[] = {::llvm::StringRef("fastmath")}; return ::llvm::ArrayRef(attrNames); } ::mlir::StringAttr getFastmathAttrName() { return getAttributeNameForIndex(0); } static ::mlir::StringAttr getFastmathAttrName(::mlir::OperationName name) { return getAttributeNameForIndex(name, 0); } static constexpr ::llvm::StringLiteral getOperationName() { return ::llvm::StringLiteral("complex.atan2"); } std::pair getODSOperandIndexAndLength(unsigned index) { return {index, 1}; } ::mlir::Operation::operand_range getODSOperands(unsigned index) { auto valueRange = getODSOperandIndexAndLength(index); return {std::next(getOperation()->operand_begin(), valueRange.first), std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)}; } ::mlir::TypedValue<::mlir::ComplexType> getLhs() { return ::llvm::cast<::mlir::TypedValue<::mlir::ComplexType>>(*getODSOperands(0).begin()); } ::mlir::TypedValue<::mlir::ComplexType> getRhs() { return ::llvm::cast<::mlir::TypedValue<::mlir::ComplexType>>(*getODSOperands(1).begin()); } ::mlir::OpOperand &getLhsMutable() { auto range = getODSOperandIndexAndLength(0); return getOperation()->getOpOperand(range.first); } ::mlir::OpOperand &getRhsMutable() { auto range = getODSOperandIndexAndLength(1); return getOperation()->getOpOperand(range.first); } std::pair getODSResultIndexAndLength(unsigned index) { return {index, 1}; } ::mlir::Operation::result_range getODSResults(unsigned index) { auto valueRange = getODSResultIndexAndLength(index); return {std::next(getOperation()->result_begin(), valueRange.first), std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)}; } ::mlir::TypedValue<::mlir::ComplexType> getResult() { return ::llvm::cast<::mlir::TypedValue<::mlir::ComplexType>>(*getODSResults(0).begin()); } static ::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); static ::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop); static llvm::hash_code computePropertiesHash(const Properties &prop); static std::optional getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name); static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value); static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs); static ::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); static ::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state); void writeProperties(::mlir::DialectBytecodeWriter &writer); ::mlir::arith::FastMathFlagsAttr getFastmathAttr() { return ::llvm::dyn_cast_or_null<::mlir::arith::FastMathFlagsAttr>(getProperties().fastmath); } ::mlir::arith::FastMathFlags getFastmath(); void setFastmathAttr(::mlir::arith::FastMathFlagsAttr attr) { getProperties().fastmath = attr; } void setFastmath(::mlir::arith::FastMathFlags attrValue); static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlagsAttr fastmath); static Atan2Op create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlagsAttr fastmath); static Atan2Op create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlagsAttr fastmath); static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlagsAttr fastmath); static Atan2Op create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlagsAttr fastmath); static Atan2Op create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlagsAttr fastmath); static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlagsAttr fastmath); static Atan2Op create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlagsAttr fastmath); static Atan2Op create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlagsAttr fastmath); static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); static Atan2Op create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); static Atan2Op create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); static Atan2Op create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); static Atan2Op create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); static Atan2Op create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); static Atan2Op create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); static Atan2Op create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); static Atan2Op create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); static Atan2Op create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); static Atan2Op create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); static Atan2Op create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); static Atan2Op create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); static Atan2Op create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); static Atan2Op create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); static void populateDefaultProperties(::mlir::OperationName opName, Properties &properties); ::llvm::LogicalResult verifyInvariantsImpl(); ::llvm::LogicalResult verifyInvariants(); static ::llvm::LogicalResult inferReturnTypes(::mlir::MLIRContext *context, ::std::optional<::mlir::Location> location, ::mlir::ValueRange operands, ::mlir::DictionaryAttr attributes, ::mlir::PropertyRef properties, ::mlir::RegionRange regions, ::llvm::SmallVectorImpl<::mlir::Type>&inferredReturnTypes); static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result); void print(::mlir::OpAsmPrinter &_odsPrinter); void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects); private: ::mlir::StringAttr getAttributeNameForIndex(unsigned index) { return getAttributeNameForIndex((*this)->getName(), index); } static ::mlir::StringAttr getAttributeNameForIndex(::mlir::OperationName name, unsigned index) { assert(index < 1 && "invalid attribute index"); assert(name.getStringRef() == getOperationName() && "invalid operation name"); assert(name.isRegistered() && "Operation isn't registered, missing a " "dependent dialect loading?"); return name.getAttributeNames()[index]; } public: }; } // namespace mlir::complex MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::complex::Atan2Op) MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::complex::detail::Atan2OpGenericAdaptorBase::Properties) namespace mlir::complex { //===----------------------------------------------------------------------===// // ::mlir::complex::BitcastOp declarations //===----------------------------------------------------------------------===// namespace detail { class BitcastOpGenericAdaptorBase { public: using Properties = ::mlir::EmptyProperties; protected: ::mlir::DictionaryAttr odsAttrs; ::std::optional<::mlir::OperationName> odsOpName; Properties properties; ::mlir::RegionRange odsRegions; public: BitcastOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : odsAttrs(attrs), properties(properties), odsRegions(regions) { if (odsAttrs) odsOpName.emplace("complex.bitcast", odsAttrs.getContext()); } BitcastOpGenericAdaptorBase(BitcastOp op); std::pair getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize) { return {index, 1}; } const Properties &getProperties() { return properties; } ::mlir::DictionaryAttr getAttributes() { return odsAttrs; } }; } // namespace detail template class BitcastOpGenericAdaptor : public detail::BitcastOpGenericAdaptorBase { using ValueT = ::llvm::detail::ValueOfRange; using Base = detail::BitcastOpGenericAdaptorBase; static constexpr int odsIndex_operand = 0; public: BitcastOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {} BitcastOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::PropertyRef properties, ::mlir::RegionRange regions = {}) : BitcastOpGenericAdaptor(values, attrs, (properties ? *properties.as() : Properties{}), regions) {} BitcastOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs = nullptr) : BitcastOpGenericAdaptor(values, attrs, Properties{}, {}) {} BitcastOpGenericAdaptor(RangeT values, const BitcastOpGenericAdaptorBase &base) : Base(base), odsOperands(values) {} template >> BitcastOpGenericAdaptor(RangeT values, LateInst op) : Base(op), odsOperands(values) {} std::pair getODSOperandIndexAndLength(unsigned index) { return Base::getODSOperandIndexAndLength(index, odsOperands.size()); } RangeT getODSOperands(unsigned index) { auto valueRange = getODSOperandIndexAndLength(index); return {std::next(odsOperands.begin(), valueRange.first), std::next(odsOperands.begin(), valueRange.first + valueRange.second)}; } ValueT getOperand() { return (*getODSOperands(0).begin()); } RangeT getOperands() { return odsOperands; } private: RangeT odsOperands; }; class BitcastOpAdaptor : public BitcastOpGenericAdaptor<::mlir::ValueRange> { public: using BitcastOpGenericAdaptor::BitcastOpGenericAdaptor; BitcastOpAdaptor(BitcastOp op); ::llvm::LogicalResult verify(::mlir::Location loc); }; class BitcastOp : public ::mlir::Op::Impl, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::OneOperand, ::mlir::OpTrait::OpInvariants, ::mlir::ConditionallySpeculatable::Trait, ::mlir::OpTrait::AlwaysSpeculatableImplTrait, ::mlir::MemoryEffectOpInterface::Trait> { public: using Op::Op; using Op::print; using Adaptor = BitcastOpAdaptor; template using GenericAdaptor = BitcastOpGenericAdaptor; using FoldAdaptor = GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute>>; static constexpr int odsIndex_operand = 0; using Properties = FoldAdaptor::Properties; static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() { return {}; } static constexpr ::llvm::StringLiteral getOperationName() { return ::llvm::StringLiteral("complex.bitcast"); } std::pair getODSOperandIndexAndLength(unsigned index) { return {index, 1}; } ::mlir::Operation::operand_range getODSOperands(unsigned index) { auto valueRange = getODSOperandIndexAndLength(index); return {std::next(getOperation()->operand_begin(), valueRange.first), std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)}; } ::mlir::TypedValue<::mlir::Type> getOperand() { return ::llvm::cast<::mlir::TypedValue<::mlir::Type>>(*getODSOperands(0).begin()); } ::mlir::OpOperand &getOperandMutable() { auto range = getODSOperandIndexAndLength(0); return getOperation()->getOpOperand(range.first); } std::pair getODSResultIndexAndLength(unsigned index) { return {index, 1}; } ::mlir::Operation::result_range getODSResults(unsigned index) { auto valueRange = getODSResultIndexAndLength(index); return {std::next(getOperation()->result_begin(), valueRange.first), std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)}; } ::mlir::TypedValue<::mlir::Type> getResult() { return ::llvm::cast<::mlir::TypedValue<::mlir::Type>>(*getODSResults(0).begin()); } static ::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); static ::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop); static llvm::hash_code computePropertiesHash(const Properties &prop); static std::optional getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name); static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value); static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs); static ::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value operand); static BitcastOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::Value operand); static BitcastOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type result, ::mlir::Value operand); static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value operand); static BitcastOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value operand); static BitcastOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value operand); static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); static BitcastOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); static BitcastOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); static BitcastOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); static BitcastOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); ::llvm::LogicalResult verifyInvariantsImpl(); ::llvm::LogicalResult verifyInvariants(); ::llvm::LogicalResult verify(); static void getCanonicalizationPatterns(::mlir::RewritePatternSet &results, ::mlir::MLIRContext *context); ::mlir::OpFoldResult fold(FoldAdaptor adaptor); static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result); void print(::mlir::OpAsmPrinter &_odsPrinter); void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects); public: }; } // namespace mlir::complex MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::complex::BitcastOp) namespace mlir::complex { //===----------------------------------------------------------------------===// // ::mlir::complex::ConjOp declarations //===----------------------------------------------------------------------===// namespace detail { class ConjOpGenericAdaptorBase { public: struct Properties { using fastmathTy = ::mlir::arith::FastMathFlagsAttr; fastmathTy fastmath; auto getFastmath() const { auto &propStorage = this->fastmath; return ::llvm::dyn_cast_or_null<::mlir::arith::FastMathFlagsAttr>(propStorage); } void setFastmath(const ::mlir::arith::FastMathFlagsAttr &propValue) { this->fastmath = propValue; } bool operator==(const Properties &rhs) const { return rhs.fastmath == this->fastmath && true; } bool operator!=(const Properties &rhs) const { return !(*this == rhs); } }; protected: ::mlir::DictionaryAttr odsAttrs; ::std::optional<::mlir::OperationName> odsOpName; Properties properties; ::mlir::RegionRange odsRegions; public: ConjOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : odsAttrs(attrs), properties(properties), odsRegions(regions) { if (odsAttrs) odsOpName.emplace("complex.conj", odsAttrs.getContext()); } ConjOpGenericAdaptorBase(ConjOp op); std::pair getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize) { return {index, 1}; } const Properties &getProperties() { return properties; } ::mlir::DictionaryAttr getAttributes() { return odsAttrs; } ::mlir::arith::FastMathFlagsAttr getFastmathAttr(); ::mlir::arith::FastMathFlags getFastmath(); }; } // namespace detail template class ConjOpGenericAdaptor : public detail::ConjOpGenericAdaptorBase { using ValueT = ::llvm::detail::ValueOfRange; using Base = detail::ConjOpGenericAdaptorBase; static constexpr int odsIndex_complex = 0; public: ConjOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {} ConjOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::PropertyRef properties, ::mlir::RegionRange regions = {}) : ConjOpGenericAdaptor(values, attrs, (properties ? *properties.as() : Properties{}), regions) {} ConjOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs = nullptr) : ConjOpGenericAdaptor(values, attrs, Properties{}, {}) {} ConjOpGenericAdaptor(RangeT values, const ConjOpGenericAdaptorBase &base) : Base(base), odsOperands(values) {} template >> ConjOpGenericAdaptor(RangeT values, LateInst op) : Base(op), odsOperands(values) {} std::pair getODSOperandIndexAndLength(unsigned index) { return Base::getODSOperandIndexAndLength(index, odsOperands.size()); } RangeT getODSOperands(unsigned index) { auto valueRange = getODSOperandIndexAndLength(index); return {std::next(odsOperands.begin(), valueRange.first), std::next(odsOperands.begin(), valueRange.first + valueRange.second)}; } ValueT getComplex() { return (*getODSOperands(0).begin()); } RangeT getOperands() { return odsOperands; } private: RangeT odsOperands; }; class ConjOpAdaptor : public ConjOpGenericAdaptor<::mlir::ValueRange> { public: using ConjOpGenericAdaptor::ConjOpGenericAdaptor; ConjOpAdaptor(ConjOp op); ::llvm::LogicalResult verify(::mlir::Location loc); }; class ConjOp : public ::mlir::Op::Impl, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::OneOperand, ::mlir::OpTrait::OpInvariants, ::mlir::BytecodeOpInterface::Trait, ::mlir::OpTrait::SameOperandsAndResultType, ::mlir::ConditionallySpeculatable::Trait, ::mlir::OpTrait::AlwaysSpeculatableImplTrait, ::mlir::MemoryEffectOpInterface::Trait, ::mlir::OpTrait::Elementwise, ::mlir::arith::ArithFastMathInterface::Trait, ::mlir::InferTypeOpInterface::Trait> { public: using Op::Op; using Op::print; using Adaptor = ConjOpAdaptor; template using GenericAdaptor = ConjOpGenericAdaptor; using FoldAdaptor = GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute>>; static constexpr int odsIndex_complex = 0; using Properties = FoldAdaptor::Properties; using ::mlir::arith::ArithFastMathInterface::Trait::getFastMathFlagsAttr; using ::mlir::arith::ArithFastMathInterface::Trait::getFastMathAttrName; static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() { static ::llvm::StringRef attrNames[] = {::llvm::StringRef("fastmath")}; return ::llvm::ArrayRef(attrNames); } ::mlir::StringAttr getFastmathAttrName() { return getAttributeNameForIndex(0); } static ::mlir::StringAttr getFastmathAttrName(::mlir::OperationName name) { return getAttributeNameForIndex(name, 0); } static constexpr ::llvm::StringLiteral getOperationName() { return ::llvm::StringLiteral("complex.conj"); } std::pair getODSOperandIndexAndLength(unsigned index) { return {index, 1}; } ::mlir::Operation::operand_range getODSOperands(unsigned index) { auto valueRange = getODSOperandIndexAndLength(index); return {std::next(getOperation()->operand_begin(), valueRange.first), std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)}; } ::mlir::TypedValue<::mlir::ComplexType> getComplex() { return ::llvm::cast<::mlir::TypedValue<::mlir::ComplexType>>(*getODSOperands(0).begin()); } ::mlir::OpOperand &getComplexMutable() { auto range = getODSOperandIndexAndLength(0); return getOperation()->getOpOperand(range.first); } std::pair getODSResultIndexAndLength(unsigned index) { return {index, 1}; } ::mlir::Operation::result_range getODSResults(unsigned index) { auto valueRange = getODSResultIndexAndLength(index); return {std::next(getOperation()->result_begin(), valueRange.first), std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)}; } ::mlir::TypedValue<::mlir::ComplexType> getResult() { return ::llvm::cast<::mlir::TypedValue<::mlir::ComplexType>>(*getODSResults(0).begin()); } static ::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); static ::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop); static llvm::hash_code computePropertiesHash(const Properties &prop); static std::optional getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name); static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value); static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs); static ::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); static ::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state); void writeProperties(::mlir::DialectBytecodeWriter &writer); ::mlir::arith::FastMathFlagsAttr getFastmathAttr() { return ::llvm::dyn_cast_or_null<::mlir::arith::FastMathFlagsAttr>(getProperties().fastmath); } ::mlir::arith::FastMathFlags getFastmath(); void setFastmathAttr(::mlir::arith::FastMathFlagsAttr attr) { getProperties().fastmath = attr; } void setFastmath(::mlir::arith::FastMathFlags attrValue); static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value complex, ::mlir::arith::FastMathFlagsAttr fastmath); static ConjOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::Value complex, ::mlir::arith::FastMathFlagsAttr fastmath); static ConjOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type result, ::mlir::Value complex, ::mlir::arith::FastMathFlagsAttr fastmath); static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value complex, ::mlir::arith::FastMathFlagsAttr fastmath); static ConjOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value complex, ::mlir::arith::FastMathFlagsAttr fastmath); static ConjOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value complex, ::mlir::arith::FastMathFlagsAttr fastmath); static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value complex, ::mlir::arith::FastMathFlagsAttr fastmath); static ConjOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value complex, ::mlir::arith::FastMathFlagsAttr fastmath); static ConjOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value complex, ::mlir::arith::FastMathFlagsAttr fastmath); static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value complex, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); static ConjOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::Value complex, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); static ConjOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type result, ::mlir::Value complex, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value complex, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); static ConjOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value complex, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); static ConjOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value complex, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value complex, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); static ConjOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value complex, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); static ConjOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value complex, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); static ConjOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); static ConjOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); static ConjOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); static ConjOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); static ConjOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); static ConjOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); static ConjOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); static ConjOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); static void populateDefaultProperties(::mlir::OperationName opName, Properties &properties); ::llvm::LogicalResult verifyInvariantsImpl(); ::llvm::LogicalResult verifyInvariants(); ::mlir::OpFoldResult fold(FoldAdaptor adaptor); static ::llvm::LogicalResult inferReturnTypes(::mlir::MLIRContext *context, ::std::optional<::mlir::Location> location, ::mlir::ValueRange operands, ::mlir::DictionaryAttr attributes, ::mlir::PropertyRef properties, ::mlir::RegionRange regions, ::llvm::SmallVectorImpl<::mlir::Type>&inferredReturnTypes); static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result); void print(::mlir::OpAsmPrinter &_odsPrinter); void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects); private: ::mlir::StringAttr getAttributeNameForIndex(unsigned index) { return getAttributeNameForIndex((*this)->getName(), index); } static ::mlir::StringAttr getAttributeNameForIndex(::mlir::OperationName name, unsigned index) { assert(index < 1 && "invalid attribute index"); assert(name.getStringRef() == getOperationName() && "invalid operation name"); assert(name.isRegistered() && "Operation isn't registered, missing a " "dependent dialect loading?"); return name.getAttributeNames()[index]; } public: }; } // namespace mlir::complex MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::complex::ConjOp) MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::complex::detail::ConjOpGenericAdaptorBase::Properties) namespace mlir::complex { //===----------------------------------------------------------------------===// // ::mlir::complex::ConstantOp declarations //===----------------------------------------------------------------------===// namespace detail { class ConstantOpGenericAdaptorBase { public: struct Properties { using valueTy = ::mlir::ArrayAttr; valueTy value; auto getValue() const { auto &propStorage = this->value; return ::llvm::cast<::mlir::ArrayAttr>(propStorage); } void setValue(const ::mlir::ArrayAttr &propValue) { this->value = propValue; } bool operator==(const Properties &rhs) const { return rhs.value == this->value && true; } bool operator!=(const Properties &rhs) const { return !(*this == rhs); } }; protected: ::mlir::DictionaryAttr odsAttrs; ::std::optional<::mlir::OperationName> odsOpName; Properties properties; ::mlir::RegionRange odsRegions; public: ConstantOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : odsAttrs(attrs), properties(properties), odsRegions(regions) { if (odsAttrs) odsOpName.emplace("complex.constant", odsAttrs.getContext()); } ConstantOpGenericAdaptorBase(ConstantOp op); std::pair getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize) { return {index, 1}; } const Properties &getProperties() { return properties; } ::mlir::DictionaryAttr getAttributes() { return odsAttrs; } ::mlir::ArrayAttr getValueAttr() { auto attr = ::llvm::cast<::mlir::ArrayAttr>(getProperties().value); return attr; } ::mlir::ArrayAttr getValue(); }; } // namespace detail template class ConstantOpGenericAdaptor : public detail::ConstantOpGenericAdaptorBase { using ValueT = ::llvm::detail::ValueOfRange; using Base = detail::ConstantOpGenericAdaptorBase; public: ConstantOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {} ConstantOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::PropertyRef properties, ::mlir::RegionRange regions = {}) : ConstantOpGenericAdaptor(values, attrs, (properties ? *properties.as() : Properties{}), regions) {} ConstantOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs = nullptr) : ConstantOpGenericAdaptor(values, attrs, Properties{}, {}) {} ConstantOpGenericAdaptor(RangeT values, const ConstantOpGenericAdaptorBase &base) : Base(base), odsOperands(values) {} template >> ConstantOpGenericAdaptor(RangeT values, LateInst op) : Base(op), odsOperands(values) {} std::pair getODSOperandIndexAndLength(unsigned index) { return Base::getODSOperandIndexAndLength(index, odsOperands.size()); } RangeT getODSOperands(unsigned index) { auto valueRange = getODSOperandIndexAndLength(index); return {std::next(odsOperands.begin(), valueRange.first), std::next(odsOperands.begin(), valueRange.first + valueRange.second)}; } RangeT getOperands() { return odsOperands; } private: RangeT odsOperands; }; class ConstantOpAdaptor : public ConstantOpGenericAdaptor<::mlir::ValueRange> { public: using ConstantOpGenericAdaptor::ConstantOpGenericAdaptor; ConstantOpAdaptor(ConstantOp op); ::llvm::LogicalResult verify(::mlir::Location loc); }; class ConstantOp : public ::mlir::Op::Impl, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::ZeroOperands, ::mlir::OpTrait::OpInvariants, ::mlir::BytecodeOpInterface::Trait, ::mlir::OpTrait::ConstantLike, ::mlir::ConditionallySpeculatable::Trait, ::mlir::OpTrait::AlwaysSpeculatableImplTrait, ::mlir::MemoryEffectOpInterface::Trait, ::mlir::OpAsmOpInterface::Trait> { public: using Op::Op; using Op::print; using Adaptor = ConstantOpAdaptor; template using GenericAdaptor = ConstantOpGenericAdaptor; using FoldAdaptor = GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute>>; using Properties = FoldAdaptor::Properties; using ::mlir::OpAsmOpInterface::Trait::getAsmBlockArgumentNames; using ::mlir::OpAsmOpInterface::Trait::getAsmBlockNames; using ::mlir::OpAsmOpInterface::Trait::getDefaultDialect; static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() { static ::llvm::StringRef attrNames[] = {::llvm::StringRef("value")}; return ::llvm::ArrayRef(attrNames); } ::mlir::StringAttr getValueAttrName() { return getAttributeNameForIndex(0); } static ::mlir::StringAttr getValueAttrName(::mlir::OperationName name) { return getAttributeNameForIndex(name, 0); } static constexpr ::llvm::StringLiteral getOperationName() { return ::llvm::StringLiteral("complex.constant"); } std::pair getODSOperandIndexAndLength(unsigned index) { return {index, 1}; } ::mlir::Operation::operand_range getODSOperands(unsigned index) { auto valueRange = getODSOperandIndexAndLength(index); return {std::next(getOperation()->operand_begin(), valueRange.first), std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)}; } std::pair getODSResultIndexAndLength(unsigned index) { return {index, 1}; } ::mlir::Operation::result_range getODSResults(unsigned index) { auto valueRange = getODSResultIndexAndLength(index); return {std::next(getOperation()->result_begin(), valueRange.first), std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)}; } ::mlir::TypedValue<::mlir::ComplexType> getComplex() { return ::llvm::cast<::mlir::TypedValue<::mlir::ComplexType>>(*getODSResults(0).begin()); } static ::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); static ::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop); static llvm::hash_code computePropertiesHash(const Properties &prop); static std::optional getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name); static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value); static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs); static ::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); static ::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state); void writeProperties(::mlir::DialectBytecodeWriter &writer); ::mlir::ArrayAttr getValueAttr() { return ::llvm::cast<::mlir::ArrayAttr>(getProperties().value); } ::mlir::ArrayAttr getValue(); void setValueAttr(::mlir::ArrayAttr attr) { getProperties().value = attr; } static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type complex, ::mlir::ArrayAttr value); static ConstantOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type complex, ::mlir::ArrayAttr value); static ConstantOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type complex, ::mlir::ArrayAttr value); static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ArrayAttr value); static ConstantOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ArrayAttr value); static ConstantOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ArrayAttr value); static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); static ConstantOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); static ConstantOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); static ConstantOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); static ConstantOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); ::llvm::LogicalResult verifyInvariantsImpl(); ::llvm::LogicalResult verifyInvariants(); ::llvm::LogicalResult verify(); ::mlir::OpFoldResult fold(FoldAdaptor adaptor); void getAsmResultNames(::mlir::OpAsmSetValueNameFn setNameFn); static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result); void print(::mlir::OpAsmPrinter &_odsPrinter); void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects); private: ::mlir::StringAttr getAttributeNameForIndex(unsigned index) { return getAttributeNameForIndex((*this)->getName(), index); } static ::mlir::StringAttr getAttributeNameForIndex(::mlir::OperationName name, unsigned index) { assert(index < 1 && "invalid attribute index"); assert(name.getStringRef() == getOperationName() && "invalid operation name"); assert(name.isRegistered() && "Operation isn't registered, missing a " "dependent dialect loading?"); return name.getAttributeNames()[index]; } public: /// Returns true if a constant operation can be built with the given value /// and result type. static bool isBuildableWith(Attribute value, Type type); }; } // namespace mlir::complex MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::complex::ConstantOp) MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::complex::detail::ConstantOpGenericAdaptorBase::Properties) namespace mlir::complex { //===----------------------------------------------------------------------===// // ::mlir::complex::CosOp declarations //===----------------------------------------------------------------------===// namespace detail { class CosOpGenericAdaptorBase { public: struct Properties { using fastmathTy = ::mlir::arith::FastMathFlagsAttr; fastmathTy fastmath; auto getFastmath() const { auto &propStorage = this->fastmath; return ::llvm::dyn_cast_or_null<::mlir::arith::FastMathFlagsAttr>(propStorage); } void setFastmath(const ::mlir::arith::FastMathFlagsAttr &propValue) { this->fastmath = propValue; } bool operator==(const Properties &rhs) const { return rhs.fastmath == this->fastmath && true; } bool operator!=(const Properties &rhs) const { return !(*this == rhs); } }; protected: ::mlir::DictionaryAttr odsAttrs; ::std::optional<::mlir::OperationName> odsOpName; Properties properties; ::mlir::RegionRange odsRegions; public: CosOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : odsAttrs(attrs), properties(properties), odsRegions(regions) { if (odsAttrs) odsOpName.emplace("complex.cos", odsAttrs.getContext()); } CosOpGenericAdaptorBase(CosOp op); std::pair getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize) { return {index, 1}; } const Properties &getProperties() { return properties; } ::mlir::DictionaryAttr getAttributes() { return odsAttrs; } ::mlir::arith::FastMathFlagsAttr getFastmathAttr(); ::mlir::arith::FastMathFlags getFastmath(); }; } // namespace detail template class CosOpGenericAdaptor : public detail::CosOpGenericAdaptorBase { using ValueT = ::llvm::detail::ValueOfRange; using Base = detail::CosOpGenericAdaptorBase; static constexpr int odsIndex_complex = 0; public: CosOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {} CosOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::PropertyRef properties, ::mlir::RegionRange regions = {}) : CosOpGenericAdaptor(values, attrs, (properties ? *properties.as() : Properties{}), regions) {} CosOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs = nullptr) : CosOpGenericAdaptor(values, attrs, Properties{}, {}) {} CosOpGenericAdaptor(RangeT values, const CosOpGenericAdaptorBase &base) : Base(base), odsOperands(values) {} template >> CosOpGenericAdaptor(RangeT values, LateInst op) : Base(op), odsOperands(values) {} std::pair getODSOperandIndexAndLength(unsigned index) { return Base::getODSOperandIndexAndLength(index, odsOperands.size()); } RangeT getODSOperands(unsigned index) { auto valueRange = getODSOperandIndexAndLength(index); return {std::next(odsOperands.begin(), valueRange.first), std::next(odsOperands.begin(), valueRange.first + valueRange.second)}; } ValueT getComplex() { return (*getODSOperands(0).begin()); } RangeT getOperands() { return odsOperands; } private: RangeT odsOperands; }; class CosOpAdaptor : public CosOpGenericAdaptor<::mlir::ValueRange> { public: using CosOpGenericAdaptor::CosOpGenericAdaptor; CosOpAdaptor(CosOp op); ::llvm::LogicalResult verify(::mlir::Location loc); }; class CosOp : public ::mlir::Op::Impl, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::OneOperand, ::mlir::OpTrait::OpInvariants, ::mlir::BytecodeOpInterface::Trait, ::mlir::OpTrait::SameOperandsAndResultType, ::mlir::ConditionallySpeculatable::Trait, ::mlir::OpTrait::AlwaysSpeculatableImplTrait, ::mlir::MemoryEffectOpInterface::Trait, ::mlir::OpTrait::Elementwise, ::mlir::arith::ArithFastMathInterface::Trait, ::mlir::InferTypeOpInterface::Trait> { public: using Op::Op; using Op::print; using Adaptor = CosOpAdaptor; template using GenericAdaptor = CosOpGenericAdaptor; using FoldAdaptor = GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute>>; static constexpr int odsIndex_complex = 0; using Properties = FoldAdaptor::Properties; using ::mlir::arith::ArithFastMathInterface::Trait::getFastMathFlagsAttr; using ::mlir::arith::ArithFastMathInterface::Trait::getFastMathAttrName; static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() { static ::llvm::StringRef attrNames[] = {::llvm::StringRef("fastmath")}; return ::llvm::ArrayRef(attrNames); } ::mlir::StringAttr getFastmathAttrName() { return getAttributeNameForIndex(0); } static ::mlir::StringAttr getFastmathAttrName(::mlir::OperationName name) { return getAttributeNameForIndex(name, 0); } static constexpr ::llvm::StringLiteral getOperationName() { return ::llvm::StringLiteral("complex.cos"); } std::pair getODSOperandIndexAndLength(unsigned index) { return {index, 1}; } ::mlir::Operation::operand_range getODSOperands(unsigned index) { auto valueRange = getODSOperandIndexAndLength(index); return {std::next(getOperation()->operand_begin(), valueRange.first), std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)}; } ::mlir::TypedValue<::mlir::ComplexType> getComplex() { return ::llvm::cast<::mlir::TypedValue<::mlir::ComplexType>>(*getODSOperands(0).begin()); } ::mlir::OpOperand &getComplexMutable() { auto range = getODSOperandIndexAndLength(0); return getOperation()->getOpOperand(range.first); } std::pair getODSResultIndexAndLength(unsigned index) { return {index, 1}; } ::mlir::Operation::result_range getODSResults(unsigned index) { auto valueRange = getODSResultIndexAndLength(index); return {std::next(getOperation()->result_begin(), valueRange.first), std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)}; } ::mlir::TypedValue<::mlir::ComplexType> getResult() { return ::llvm::cast<::mlir::TypedValue<::mlir::ComplexType>>(*getODSResults(0).begin()); } static ::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); static ::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop); static llvm::hash_code computePropertiesHash(const Properties &prop); static std::optional getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name); static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value); static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs); static ::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); static ::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state); void writeProperties(::mlir::DialectBytecodeWriter &writer); ::mlir::arith::FastMathFlagsAttr getFastmathAttr() { return ::llvm::dyn_cast_or_null<::mlir::arith::FastMathFlagsAttr>(getProperties().fastmath); } ::mlir::arith::FastMathFlags getFastmath(); void setFastmathAttr(::mlir::arith::FastMathFlagsAttr attr) { getProperties().fastmath = attr; } void setFastmath(::mlir::arith::FastMathFlags attrValue); static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value complex, ::mlir::arith::FastMathFlagsAttr fastmath); static CosOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::Value complex, ::mlir::arith::FastMathFlagsAttr fastmath); static CosOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type result, ::mlir::Value complex, ::mlir::arith::FastMathFlagsAttr fastmath); static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value complex, ::mlir::arith::FastMathFlagsAttr fastmath); static CosOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value complex, ::mlir::arith::FastMathFlagsAttr fastmath); static CosOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value complex, ::mlir::arith::FastMathFlagsAttr fastmath); static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value complex, ::mlir::arith::FastMathFlagsAttr fastmath); static CosOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value complex, ::mlir::arith::FastMathFlagsAttr fastmath); static CosOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value complex, ::mlir::arith::FastMathFlagsAttr fastmath); static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value complex, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); static CosOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::Value complex, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); static CosOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type result, ::mlir::Value complex, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value complex, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); static CosOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value complex, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); static CosOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value complex, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value complex, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); static CosOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value complex, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); static CosOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value complex, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); static CosOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); static CosOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); static CosOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); static CosOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); static CosOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); static CosOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); static CosOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); static CosOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); static void populateDefaultProperties(::mlir::OperationName opName, Properties &properties); ::llvm::LogicalResult verifyInvariantsImpl(); ::llvm::LogicalResult verifyInvariants(); static ::llvm::LogicalResult inferReturnTypes(::mlir::MLIRContext *context, ::std::optional<::mlir::Location> location, ::mlir::ValueRange operands, ::mlir::DictionaryAttr attributes, ::mlir::PropertyRef properties, ::mlir::RegionRange regions, ::llvm::SmallVectorImpl<::mlir::Type>&inferredReturnTypes); static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result); void print(::mlir::OpAsmPrinter &_odsPrinter); void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects); private: ::mlir::StringAttr getAttributeNameForIndex(unsigned index) { return getAttributeNameForIndex((*this)->getName(), index); } static ::mlir::StringAttr getAttributeNameForIndex(::mlir::OperationName name, unsigned index) { assert(index < 1 && "invalid attribute index"); assert(name.getStringRef() == getOperationName() && "invalid operation name"); assert(name.isRegistered() && "Operation isn't registered, missing a " "dependent dialect loading?"); return name.getAttributeNames()[index]; } public: }; } // namespace mlir::complex MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::complex::CosOp) MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::complex::detail::CosOpGenericAdaptorBase::Properties) namespace mlir::complex { //===----------------------------------------------------------------------===// // ::mlir::complex::CreateOp declarations //===----------------------------------------------------------------------===// namespace detail { class CreateOpGenericAdaptorBase { public: using Properties = ::mlir::EmptyProperties; protected: ::mlir::DictionaryAttr odsAttrs; ::std::optional<::mlir::OperationName> odsOpName; Properties properties; ::mlir::RegionRange odsRegions; public: CreateOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : odsAttrs(attrs), properties(properties), odsRegions(regions) { if (odsAttrs) odsOpName.emplace("complex.create", odsAttrs.getContext()); } CreateOpGenericAdaptorBase(CreateOp op); std::pair getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize) { return {index, 1}; } const Properties &getProperties() { return properties; } ::mlir::DictionaryAttr getAttributes() { return odsAttrs; } }; } // namespace detail template class CreateOpGenericAdaptor : public detail::CreateOpGenericAdaptorBase { using ValueT = ::llvm::detail::ValueOfRange; using Base = detail::CreateOpGenericAdaptorBase; static constexpr int odsIndex_real = 0; static constexpr int odsIndex_imaginary = 1; public: CreateOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {} CreateOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::PropertyRef properties, ::mlir::RegionRange regions = {}) : CreateOpGenericAdaptor(values, attrs, (properties ? *properties.as() : Properties{}), regions) {} CreateOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs = nullptr) : CreateOpGenericAdaptor(values, attrs, Properties{}, {}) {} CreateOpGenericAdaptor(RangeT values, const CreateOpGenericAdaptorBase &base) : Base(base), odsOperands(values) {} template >> CreateOpGenericAdaptor(RangeT values, LateInst op) : Base(op), odsOperands(values) {} std::pair getODSOperandIndexAndLength(unsigned index) { return Base::getODSOperandIndexAndLength(index, odsOperands.size()); } RangeT getODSOperands(unsigned index) { auto valueRange = getODSOperandIndexAndLength(index); return {std::next(odsOperands.begin(), valueRange.first), std::next(odsOperands.begin(), valueRange.first + valueRange.second)}; } ValueT getReal() { return (*getODSOperands(0).begin()); } ValueT getImaginary() { return (*getODSOperands(1).begin()); } RangeT getOperands() { return odsOperands; } private: RangeT odsOperands; }; class CreateOpAdaptor : public CreateOpGenericAdaptor<::mlir::ValueRange> { public: using CreateOpGenericAdaptor::CreateOpGenericAdaptor; CreateOpAdaptor(CreateOp op); ::llvm::LogicalResult verify(::mlir::Location loc); }; class CreateOp : public ::mlir::Op::Impl, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::NOperands<2>::Impl, ::mlir::OpTrait::OpInvariants, ::mlir::ConditionallySpeculatable::Trait, ::mlir::OpTrait::AlwaysSpeculatableImplTrait, ::mlir::MemoryEffectOpInterface::Trait> { public: using Op::Op; using Op::print; using Adaptor = CreateOpAdaptor; template using GenericAdaptor = CreateOpGenericAdaptor; using FoldAdaptor = GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute>>; static constexpr int odsIndex_real = 0; static constexpr int odsIndex_imaginary = 1; using Properties = FoldAdaptor::Properties; static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() { return {}; } static constexpr ::llvm::StringLiteral getOperationName() { return ::llvm::StringLiteral("complex.create"); } std::pair getODSOperandIndexAndLength(unsigned index) { return {index, 1}; } ::mlir::Operation::operand_range getODSOperands(unsigned index) { auto valueRange = getODSOperandIndexAndLength(index); return {std::next(getOperation()->operand_begin(), valueRange.first), std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)}; } ::mlir::TypedValue<::mlir::FloatType> getReal() { return ::llvm::cast<::mlir::TypedValue<::mlir::FloatType>>(*getODSOperands(0).begin()); } ::mlir::TypedValue<::mlir::FloatType> getImaginary() { return ::llvm::cast<::mlir::TypedValue<::mlir::FloatType>>(*getODSOperands(1).begin()); } ::mlir::OpOperand &getRealMutable() { auto range = getODSOperandIndexAndLength(0); return getOperation()->getOpOperand(range.first); } ::mlir::OpOperand &getImaginaryMutable() { auto range = getODSOperandIndexAndLength(1); return getOperation()->getOpOperand(range.first); } std::pair getODSResultIndexAndLength(unsigned index) { return {index, 1}; } ::mlir::Operation::result_range getODSResults(unsigned index) { auto valueRange = getODSResultIndexAndLength(index); return {std::next(getOperation()->result_begin(), valueRange.first), std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)}; } ::mlir::TypedValue<::mlir::ComplexType> getComplex() { return ::llvm::cast<::mlir::TypedValue<::mlir::ComplexType>>(*getODSResults(0).begin()); } static ::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); static ::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop); static llvm::hash_code computePropertiesHash(const Properties &prop); static std::optional getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name); static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value); static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs); static ::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type complex, ::mlir::Value real, ::mlir::Value imaginary); static CreateOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type complex, ::mlir::Value real, ::mlir::Value imaginary); static CreateOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type complex, ::mlir::Value real, ::mlir::Value imaginary); static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value real, ::mlir::Value imaginary); static CreateOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value real, ::mlir::Value imaginary); static CreateOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value real, ::mlir::Value imaginary); static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); static CreateOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); static CreateOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); static CreateOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); static CreateOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); ::llvm::LogicalResult verifyInvariantsImpl(); ::llvm::LogicalResult verifyInvariants(); ::mlir::OpFoldResult fold(FoldAdaptor adaptor); static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result); void print(::mlir::OpAsmPrinter &_odsPrinter); void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects); public: }; } // namespace mlir::complex MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::complex::CreateOp) namespace mlir::complex { //===----------------------------------------------------------------------===// // ::mlir::complex::DivOp declarations //===----------------------------------------------------------------------===// namespace detail { class DivOpGenericAdaptorBase { public: struct Properties { using fastmathTy = ::mlir::arith::FastMathFlagsAttr; fastmathTy fastmath; auto getFastmath() const { auto &propStorage = this->fastmath; return ::llvm::dyn_cast_or_null<::mlir::arith::FastMathFlagsAttr>(propStorage); } void setFastmath(const ::mlir::arith::FastMathFlagsAttr &propValue) { this->fastmath = propValue; } bool operator==(const Properties &rhs) const { return rhs.fastmath == this->fastmath && true; } bool operator!=(const Properties &rhs) const { return !(*this == rhs); } }; protected: ::mlir::DictionaryAttr odsAttrs; ::std::optional<::mlir::OperationName> odsOpName; Properties properties; ::mlir::RegionRange odsRegions; public: DivOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : odsAttrs(attrs), properties(properties), odsRegions(regions) { if (odsAttrs) odsOpName.emplace("complex.div", odsAttrs.getContext()); } DivOpGenericAdaptorBase(DivOp op); std::pair getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize) { return {index, 1}; } const Properties &getProperties() { return properties; } ::mlir::DictionaryAttr getAttributes() { return odsAttrs; } ::mlir::arith::FastMathFlagsAttr getFastmathAttr(); ::mlir::arith::FastMathFlags getFastmath(); }; } // namespace detail template class DivOpGenericAdaptor : public detail::DivOpGenericAdaptorBase { using ValueT = ::llvm::detail::ValueOfRange; using Base = detail::DivOpGenericAdaptorBase; static constexpr int odsIndex_lhs = 0; static constexpr int odsIndex_rhs = 1; public: DivOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {} DivOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::PropertyRef properties, ::mlir::RegionRange regions = {}) : DivOpGenericAdaptor(values, attrs, (properties ? *properties.as() : Properties{}), regions) {} DivOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs = nullptr) : DivOpGenericAdaptor(values, attrs, Properties{}, {}) {} DivOpGenericAdaptor(RangeT values, const DivOpGenericAdaptorBase &base) : Base(base), odsOperands(values) {} template >> DivOpGenericAdaptor(RangeT values, LateInst op) : Base(op), odsOperands(values) {} std::pair getODSOperandIndexAndLength(unsigned index) { return Base::getODSOperandIndexAndLength(index, odsOperands.size()); } RangeT getODSOperands(unsigned index) { auto valueRange = getODSOperandIndexAndLength(index); return {std::next(odsOperands.begin(), valueRange.first), std::next(odsOperands.begin(), valueRange.first + valueRange.second)}; } ValueT getLhs() { return (*getODSOperands(0).begin()); } ValueT getRhs() { return (*getODSOperands(1).begin()); } RangeT getOperands() { return odsOperands; } private: RangeT odsOperands; }; class DivOpAdaptor : public DivOpGenericAdaptor<::mlir::ValueRange> { public: using DivOpGenericAdaptor::DivOpGenericAdaptor; DivOpAdaptor(DivOp op); ::llvm::LogicalResult verify(::mlir::Location loc); }; class DivOp : public ::mlir::Op::Impl, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::NOperands<2>::Impl, ::mlir::OpTrait::OpInvariants, ::mlir::BytecodeOpInterface::Trait, ::mlir::ConditionallySpeculatable::Trait, ::mlir::OpTrait::AlwaysSpeculatableImplTrait, ::mlir::MemoryEffectOpInterface::Trait, ::mlir::OpTrait::SameOperandsAndResultType, ::mlir::OpTrait::Elementwise, ::mlir::arith::ArithFastMathInterface::Trait, ::mlir::InferTypeOpInterface::Trait> { public: using Op::Op; using Op::print; using Adaptor = DivOpAdaptor; template using GenericAdaptor = DivOpGenericAdaptor; using FoldAdaptor = GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute>>; static constexpr int odsIndex_lhs = 0; static constexpr int odsIndex_rhs = 1; using Properties = FoldAdaptor::Properties; using ::mlir::arith::ArithFastMathInterface::Trait::getFastMathFlagsAttr; using ::mlir::arith::ArithFastMathInterface::Trait::getFastMathAttrName; static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() { static ::llvm::StringRef attrNames[] = {::llvm::StringRef("fastmath")}; return ::llvm::ArrayRef(attrNames); } ::mlir::StringAttr getFastmathAttrName() { return getAttributeNameForIndex(0); } static ::mlir::StringAttr getFastmathAttrName(::mlir::OperationName name) { return getAttributeNameForIndex(name, 0); } static constexpr ::llvm::StringLiteral getOperationName() { return ::llvm::StringLiteral("complex.div"); } std::pair getODSOperandIndexAndLength(unsigned index) { return {index, 1}; } ::mlir::Operation::operand_range getODSOperands(unsigned index) { auto valueRange = getODSOperandIndexAndLength(index); return {std::next(getOperation()->operand_begin(), valueRange.first), std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)}; } ::mlir::TypedValue<::mlir::ComplexType> getLhs() { return ::llvm::cast<::mlir::TypedValue<::mlir::ComplexType>>(*getODSOperands(0).begin()); } ::mlir::TypedValue<::mlir::ComplexType> getRhs() { return ::llvm::cast<::mlir::TypedValue<::mlir::ComplexType>>(*getODSOperands(1).begin()); } ::mlir::OpOperand &getLhsMutable() { auto range = getODSOperandIndexAndLength(0); return getOperation()->getOpOperand(range.first); } ::mlir::OpOperand &getRhsMutable() { auto range = getODSOperandIndexAndLength(1); return getOperation()->getOpOperand(range.first); } std::pair getODSResultIndexAndLength(unsigned index) { return {index, 1}; } ::mlir::Operation::result_range getODSResults(unsigned index) { auto valueRange = getODSResultIndexAndLength(index); return {std::next(getOperation()->result_begin(), valueRange.first), std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)}; } ::mlir::TypedValue<::mlir::ComplexType> getResult() { return ::llvm::cast<::mlir::TypedValue<::mlir::ComplexType>>(*getODSResults(0).begin()); } static ::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); static ::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop); static llvm::hash_code computePropertiesHash(const Properties &prop); static std::optional getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name); static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value); static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs); static ::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); static ::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state); void writeProperties(::mlir::DialectBytecodeWriter &writer); ::mlir::arith::FastMathFlagsAttr getFastmathAttr() { return ::llvm::dyn_cast_or_null<::mlir::arith::FastMathFlagsAttr>(getProperties().fastmath); } ::mlir::arith::FastMathFlags getFastmath(); void setFastmathAttr(::mlir::arith::FastMathFlagsAttr attr) { getProperties().fastmath = attr; } void setFastmath(::mlir::arith::FastMathFlags attrValue); static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlagsAttr fastmath); static DivOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlagsAttr fastmath); static DivOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlagsAttr fastmath); static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlagsAttr fastmath); static DivOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlagsAttr fastmath); static DivOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlagsAttr fastmath); static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlagsAttr fastmath); static DivOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlagsAttr fastmath); static DivOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlagsAttr fastmath); static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); static DivOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); static DivOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); static DivOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); static DivOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); static DivOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); static DivOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); static DivOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); static DivOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); static DivOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); static DivOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); static DivOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); static DivOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); static DivOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); static DivOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); static void populateDefaultProperties(::mlir::OperationName opName, Properties &properties); ::llvm::LogicalResult verifyInvariantsImpl(); ::llvm::LogicalResult verifyInvariants(); ::mlir::OpFoldResult fold(FoldAdaptor adaptor); static ::llvm::LogicalResult inferReturnTypes(::mlir::MLIRContext *context, ::std::optional<::mlir::Location> location, ::mlir::ValueRange operands, ::mlir::DictionaryAttr attributes, ::mlir::PropertyRef properties, ::mlir::RegionRange regions, ::llvm::SmallVectorImpl<::mlir::Type>&inferredReturnTypes); static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result); void print(::mlir::OpAsmPrinter &_odsPrinter); void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects); private: ::mlir::StringAttr getAttributeNameForIndex(unsigned index) { return getAttributeNameForIndex((*this)->getName(), index); } static ::mlir::StringAttr getAttributeNameForIndex(::mlir::OperationName name, unsigned index) { assert(index < 1 && "invalid attribute index"); assert(name.getStringRef() == getOperationName() && "invalid operation name"); assert(name.isRegistered() && "Operation isn't registered, missing a " "dependent dialect loading?"); return name.getAttributeNames()[index]; } public: }; } // namespace mlir::complex MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::complex::DivOp) MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::complex::detail::DivOpGenericAdaptorBase::Properties) namespace mlir::complex { //===----------------------------------------------------------------------===// // ::mlir::complex::EqualOp declarations //===----------------------------------------------------------------------===// namespace detail { class EqualOpGenericAdaptorBase { public: using Properties = ::mlir::EmptyProperties; protected: ::mlir::DictionaryAttr odsAttrs; ::std::optional<::mlir::OperationName> odsOpName; Properties properties; ::mlir::RegionRange odsRegions; public: EqualOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : odsAttrs(attrs), properties(properties), odsRegions(regions) { if (odsAttrs) odsOpName.emplace("complex.eq", odsAttrs.getContext()); } EqualOpGenericAdaptorBase(EqualOp op); std::pair getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize) { return {index, 1}; } const Properties &getProperties() { return properties; } ::mlir::DictionaryAttr getAttributes() { return odsAttrs; } }; } // namespace detail template class EqualOpGenericAdaptor : public detail::EqualOpGenericAdaptorBase { using ValueT = ::llvm::detail::ValueOfRange; using Base = detail::EqualOpGenericAdaptorBase; static constexpr int odsIndex_lhs = 0; static constexpr int odsIndex_rhs = 1; public: EqualOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {} EqualOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::PropertyRef properties, ::mlir::RegionRange regions = {}) : EqualOpGenericAdaptor(values, attrs, (properties ? *properties.as() : Properties{}), regions) {} EqualOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs = nullptr) : EqualOpGenericAdaptor(values, attrs, Properties{}, {}) {} EqualOpGenericAdaptor(RangeT values, const EqualOpGenericAdaptorBase &base) : Base(base), odsOperands(values) {} template >> EqualOpGenericAdaptor(RangeT values, LateInst op) : Base(op), odsOperands(values) {} std::pair getODSOperandIndexAndLength(unsigned index) { return Base::getODSOperandIndexAndLength(index, odsOperands.size()); } RangeT getODSOperands(unsigned index) { auto valueRange = getODSOperandIndexAndLength(index); return {std::next(odsOperands.begin(), valueRange.first), std::next(odsOperands.begin(), valueRange.first + valueRange.second)}; } ValueT getLhs() { return (*getODSOperands(0).begin()); } ValueT getRhs() { return (*getODSOperands(1).begin()); } RangeT getOperands() { return odsOperands; } private: RangeT odsOperands; }; class EqualOpAdaptor : public EqualOpGenericAdaptor<::mlir::ValueRange> { public: using EqualOpGenericAdaptor::EqualOpGenericAdaptor; EqualOpAdaptor(EqualOp op); ::llvm::LogicalResult verify(::mlir::Location loc); }; class EqualOp : public ::mlir::Op::Impl, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::NOperands<2>::Impl, ::mlir::OpTrait::OpInvariants, ::mlir::ConditionallySpeculatable::Trait, ::mlir::OpTrait::AlwaysSpeculatableImplTrait, ::mlir::MemoryEffectOpInterface::Trait, ::mlir::OpTrait::Elementwise, ::mlir::InferTypeOpInterface::Trait> { public: using Op::Op; using Op::print; using Adaptor = EqualOpAdaptor; template using GenericAdaptor = EqualOpGenericAdaptor; using FoldAdaptor = GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute>>; static constexpr int odsIndex_lhs = 0; static constexpr int odsIndex_rhs = 1; using Properties = FoldAdaptor::Properties; static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() { return {}; } static constexpr ::llvm::StringLiteral getOperationName() { return ::llvm::StringLiteral("complex.eq"); } std::pair getODSOperandIndexAndLength(unsigned index) { return {index, 1}; } ::mlir::Operation::operand_range getODSOperands(unsigned index) { auto valueRange = getODSOperandIndexAndLength(index); return {std::next(getOperation()->operand_begin(), valueRange.first), std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)}; } ::mlir::TypedValue<::mlir::ComplexType> getLhs() { return ::llvm::cast<::mlir::TypedValue<::mlir::ComplexType>>(*getODSOperands(0).begin()); } ::mlir::TypedValue<::mlir::ComplexType> getRhs() { return ::llvm::cast<::mlir::TypedValue<::mlir::ComplexType>>(*getODSOperands(1).begin()); } ::mlir::OpOperand &getLhsMutable() { auto range = getODSOperandIndexAndLength(0); return getOperation()->getOpOperand(range.first); } ::mlir::OpOperand &getRhsMutable() { auto range = getODSOperandIndexAndLength(1); return getOperation()->getOpOperand(range.first); } std::pair getODSResultIndexAndLength(unsigned index) { return {index, 1}; } ::mlir::Operation::result_range getODSResults(unsigned index) { auto valueRange = getODSResultIndexAndLength(index); return {std::next(getOperation()->result_begin(), valueRange.first), std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)}; } ::mlir::TypedValue<::mlir::IntegerType> getResult() { return ::llvm::cast<::mlir::TypedValue<::mlir::IntegerType>>(*getODSResults(0).begin()); } static ::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); static ::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop); static llvm::hash_code computePropertiesHash(const Properties &prop); static std::optional getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name); static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value); static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs); static ::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs); static EqualOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs); static EqualOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs); static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value lhs, ::mlir::Value rhs); static EqualOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value lhs, ::mlir::Value rhs); static EqualOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value lhs, ::mlir::Value rhs); static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs); static EqualOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs); static EqualOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs); static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); static EqualOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); static EqualOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); static EqualOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); static EqualOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); static EqualOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); static EqualOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); static EqualOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); static EqualOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); ::llvm::LogicalResult verifyInvariantsImpl(); ::llvm::LogicalResult verifyInvariants(); static ::llvm::LogicalResult inferReturnTypes(::mlir::MLIRContext *context, ::std::optional<::mlir::Location> location, ::mlir::ValueRange operands, ::mlir::DictionaryAttr attributes, ::mlir::PropertyRef properties, ::mlir::RegionRange regions, ::llvm::SmallVectorImpl<::mlir::Type>&inferredReturnTypes); static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result); void print(::mlir::OpAsmPrinter &_odsPrinter); void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects); public: }; } // namespace mlir::complex MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::complex::EqualOp) namespace mlir::complex { //===----------------------------------------------------------------------===// // ::mlir::complex::ExpOp declarations //===----------------------------------------------------------------------===// namespace detail { class ExpOpGenericAdaptorBase { public: struct Properties { using fastmathTy = ::mlir::arith::FastMathFlagsAttr; fastmathTy fastmath; auto getFastmath() const { auto &propStorage = this->fastmath; return ::llvm::dyn_cast_or_null<::mlir::arith::FastMathFlagsAttr>(propStorage); } void setFastmath(const ::mlir::arith::FastMathFlagsAttr &propValue) { this->fastmath = propValue; } bool operator==(const Properties &rhs) const { return rhs.fastmath == this->fastmath && true; } bool operator!=(const Properties &rhs) const { return !(*this == rhs); } }; protected: ::mlir::DictionaryAttr odsAttrs; ::std::optional<::mlir::OperationName> odsOpName; Properties properties; ::mlir::RegionRange odsRegions; public: ExpOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : odsAttrs(attrs), properties(properties), odsRegions(regions) { if (odsAttrs) odsOpName.emplace("complex.exp", odsAttrs.getContext()); } ExpOpGenericAdaptorBase(ExpOp op); std::pair getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize) { return {index, 1}; } const Properties &getProperties() { return properties; } ::mlir::DictionaryAttr getAttributes() { return odsAttrs; } ::mlir::arith::FastMathFlagsAttr getFastmathAttr(); ::mlir::arith::FastMathFlags getFastmath(); }; } // namespace detail template class ExpOpGenericAdaptor : public detail::ExpOpGenericAdaptorBase { using ValueT = ::llvm::detail::ValueOfRange; using Base = detail::ExpOpGenericAdaptorBase; static constexpr int odsIndex_complex = 0; public: ExpOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {} ExpOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::PropertyRef properties, ::mlir::RegionRange regions = {}) : ExpOpGenericAdaptor(values, attrs, (properties ? *properties.as() : Properties{}), regions) {} ExpOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs = nullptr) : ExpOpGenericAdaptor(values, attrs, Properties{}, {}) {} ExpOpGenericAdaptor(RangeT values, const ExpOpGenericAdaptorBase &base) : Base(base), odsOperands(values) {} template >> ExpOpGenericAdaptor(RangeT values, LateInst op) : Base(op), odsOperands(values) {} std::pair getODSOperandIndexAndLength(unsigned index) { return Base::getODSOperandIndexAndLength(index, odsOperands.size()); } RangeT getODSOperands(unsigned index) { auto valueRange = getODSOperandIndexAndLength(index); return {std::next(odsOperands.begin(), valueRange.first), std::next(odsOperands.begin(), valueRange.first + valueRange.second)}; } ValueT getComplex() { return (*getODSOperands(0).begin()); } RangeT getOperands() { return odsOperands; } private: RangeT odsOperands; }; class ExpOpAdaptor : public ExpOpGenericAdaptor<::mlir::ValueRange> { public: using ExpOpGenericAdaptor::ExpOpGenericAdaptor; ExpOpAdaptor(ExpOp op); ::llvm::LogicalResult verify(::mlir::Location loc); }; class ExpOp : public ::mlir::Op::Impl, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::OneOperand, ::mlir::OpTrait::OpInvariants, ::mlir::BytecodeOpInterface::Trait, ::mlir::OpTrait::SameOperandsAndResultType, ::mlir::ConditionallySpeculatable::Trait, ::mlir::OpTrait::AlwaysSpeculatableImplTrait, ::mlir::MemoryEffectOpInterface::Trait, ::mlir::OpTrait::Elementwise, ::mlir::arith::ArithFastMathInterface::Trait, ::mlir::InferTypeOpInterface::Trait> { public: using Op::Op; using Op::print; using Adaptor = ExpOpAdaptor; template using GenericAdaptor = ExpOpGenericAdaptor; using FoldAdaptor = GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute>>; static constexpr int odsIndex_complex = 0; using Properties = FoldAdaptor::Properties; using ::mlir::arith::ArithFastMathInterface::Trait::getFastMathFlagsAttr; using ::mlir::arith::ArithFastMathInterface::Trait::getFastMathAttrName; static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() { static ::llvm::StringRef attrNames[] = {::llvm::StringRef("fastmath")}; return ::llvm::ArrayRef(attrNames); } ::mlir::StringAttr getFastmathAttrName() { return getAttributeNameForIndex(0); } static ::mlir::StringAttr getFastmathAttrName(::mlir::OperationName name) { return getAttributeNameForIndex(name, 0); } static constexpr ::llvm::StringLiteral getOperationName() { return ::llvm::StringLiteral("complex.exp"); } std::pair getODSOperandIndexAndLength(unsigned index) { return {index, 1}; } ::mlir::Operation::operand_range getODSOperands(unsigned index) { auto valueRange = getODSOperandIndexAndLength(index); return {std::next(getOperation()->operand_begin(), valueRange.first), std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)}; } ::mlir::TypedValue<::mlir::ComplexType> getComplex() { return ::llvm::cast<::mlir::TypedValue<::mlir::ComplexType>>(*getODSOperands(0).begin()); } ::mlir::OpOperand &getComplexMutable() { auto range = getODSOperandIndexAndLength(0); return getOperation()->getOpOperand(range.first); } std::pair getODSResultIndexAndLength(unsigned index) { return {index, 1}; } ::mlir::Operation::result_range getODSResults(unsigned index) { auto valueRange = getODSResultIndexAndLength(index); return {std::next(getOperation()->result_begin(), valueRange.first), std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)}; } ::mlir::TypedValue<::mlir::ComplexType> getResult() { return ::llvm::cast<::mlir::TypedValue<::mlir::ComplexType>>(*getODSResults(0).begin()); } static ::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); static ::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop); static llvm::hash_code computePropertiesHash(const Properties &prop); static std::optional getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name); static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value); static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs); static ::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); static ::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state); void writeProperties(::mlir::DialectBytecodeWriter &writer); ::mlir::arith::FastMathFlagsAttr getFastmathAttr() { return ::llvm::dyn_cast_or_null<::mlir::arith::FastMathFlagsAttr>(getProperties().fastmath); } ::mlir::arith::FastMathFlags getFastmath(); void setFastmathAttr(::mlir::arith::FastMathFlagsAttr attr) { getProperties().fastmath = attr; } void setFastmath(::mlir::arith::FastMathFlags attrValue); static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value complex, ::mlir::arith::FastMathFlagsAttr fastmath); static ExpOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::Value complex, ::mlir::arith::FastMathFlagsAttr fastmath); static ExpOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type result, ::mlir::Value complex, ::mlir::arith::FastMathFlagsAttr fastmath); static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value complex, ::mlir::arith::FastMathFlagsAttr fastmath); static ExpOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value complex, ::mlir::arith::FastMathFlagsAttr fastmath); static ExpOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value complex, ::mlir::arith::FastMathFlagsAttr fastmath); static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value complex, ::mlir::arith::FastMathFlagsAttr fastmath); static ExpOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value complex, ::mlir::arith::FastMathFlagsAttr fastmath); static ExpOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value complex, ::mlir::arith::FastMathFlagsAttr fastmath); static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value complex, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); static ExpOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::Value complex, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); static ExpOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type result, ::mlir::Value complex, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value complex, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); static ExpOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value complex, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); static ExpOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value complex, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value complex, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); static ExpOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value complex, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); static ExpOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value complex, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); static ExpOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); static ExpOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); static ExpOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); static ExpOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); static ExpOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); static ExpOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); static ExpOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); static ExpOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); static void populateDefaultProperties(::mlir::OperationName opName, Properties &properties); ::llvm::LogicalResult verifyInvariantsImpl(); ::llvm::LogicalResult verifyInvariants(); ::mlir::OpFoldResult fold(FoldAdaptor adaptor); static ::llvm::LogicalResult inferReturnTypes(::mlir::MLIRContext *context, ::std::optional<::mlir::Location> location, ::mlir::ValueRange operands, ::mlir::DictionaryAttr attributes, ::mlir::PropertyRef properties, ::mlir::RegionRange regions, ::llvm::SmallVectorImpl<::mlir::Type>&inferredReturnTypes); static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result); void print(::mlir::OpAsmPrinter &_odsPrinter); void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects); private: ::mlir::StringAttr getAttributeNameForIndex(unsigned index) { return getAttributeNameForIndex((*this)->getName(), index); } static ::mlir::StringAttr getAttributeNameForIndex(::mlir::OperationName name, unsigned index) { assert(index < 1 && "invalid attribute index"); assert(name.getStringRef() == getOperationName() && "invalid operation name"); assert(name.isRegistered() && "Operation isn't registered, missing a " "dependent dialect loading?"); return name.getAttributeNames()[index]; } public: }; } // namespace mlir::complex MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::complex::ExpOp) MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::complex::detail::ExpOpGenericAdaptorBase::Properties) namespace mlir::complex { //===----------------------------------------------------------------------===// // ::mlir::complex::Expm1Op declarations //===----------------------------------------------------------------------===// namespace detail { class Expm1OpGenericAdaptorBase { public: struct Properties { using fastmathTy = ::mlir::arith::FastMathFlagsAttr; fastmathTy fastmath; auto getFastmath() const { auto &propStorage = this->fastmath; return ::llvm::dyn_cast_or_null<::mlir::arith::FastMathFlagsAttr>(propStorage); } void setFastmath(const ::mlir::arith::FastMathFlagsAttr &propValue) { this->fastmath = propValue; } bool operator==(const Properties &rhs) const { return rhs.fastmath == this->fastmath && true; } bool operator!=(const Properties &rhs) const { return !(*this == rhs); } }; protected: ::mlir::DictionaryAttr odsAttrs; ::std::optional<::mlir::OperationName> odsOpName; Properties properties; ::mlir::RegionRange odsRegions; public: Expm1OpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : odsAttrs(attrs), properties(properties), odsRegions(regions) { if (odsAttrs) odsOpName.emplace("complex.expm1", odsAttrs.getContext()); } Expm1OpGenericAdaptorBase(Expm1Op op); std::pair getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize) { return {index, 1}; } const Properties &getProperties() { return properties; } ::mlir::DictionaryAttr getAttributes() { return odsAttrs; } ::mlir::arith::FastMathFlagsAttr getFastmathAttr(); ::mlir::arith::FastMathFlags getFastmath(); }; } // namespace detail template class Expm1OpGenericAdaptor : public detail::Expm1OpGenericAdaptorBase { using ValueT = ::llvm::detail::ValueOfRange; using Base = detail::Expm1OpGenericAdaptorBase; static constexpr int odsIndex_complex = 0; public: Expm1OpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {} Expm1OpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::PropertyRef properties, ::mlir::RegionRange regions = {}) : Expm1OpGenericAdaptor(values, attrs, (properties ? *properties.as() : Properties{}), regions) {} Expm1OpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs = nullptr) : Expm1OpGenericAdaptor(values, attrs, Properties{}, {}) {} Expm1OpGenericAdaptor(RangeT values, const Expm1OpGenericAdaptorBase &base) : Base(base), odsOperands(values) {} template >> Expm1OpGenericAdaptor(RangeT values, LateInst op) : Base(op), odsOperands(values) {} std::pair getODSOperandIndexAndLength(unsigned index) { return Base::getODSOperandIndexAndLength(index, odsOperands.size()); } RangeT getODSOperands(unsigned index) { auto valueRange = getODSOperandIndexAndLength(index); return {std::next(odsOperands.begin(), valueRange.first), std::next(odsOperands.begin(), valueRange.first + valueRange.second)}; } ValueT getComplex() { return (*getODSOperands(0).begin()); } RangeT getOperands() { return odsOperands; } private: RangeT odsOperands; }; class Expm1OpAdaptor : public Expm1OpGenericAdaptor<::mlir::ValueRange> { public: using Expm1OpGenericAdaptor::Expm1OpGenericAdaptor; Expm1OpAdaptor(Expm1Op op); ::llvm::LogicalResult verify(::mlir::Location loc); }; class Expm1Op : public ::mlir::Op::Impl, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::OneOperand, ::mlir::OpTrait::OpInvariants, ::mlir::BytecodeOpInterface::Trait, ::mlir::OpTrait::SameOperandsAndResultType, ::mlir::ConditionallySpeculatable::Trait, ::mlir::OpTrait::AlwaysSpeculatableImplTrait, ::mlir::MemoryEffectOpInterface::Trait, ::mlir::OpTrait::Elementwise, ::mlir::arith::ArithFastMathInterface::Trait, ::mlir::InferTypeOpInterface::Trait> { public: using Op::Op; using Op::print; using Adaptor = Expm1OpAdaptor; template using GenericAdaptor = Expm1OpGenericAdaptor; using FoldAdaptor = GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute>>; static constexpr int odsIndex_complex = 0; using Properties = FoldAdaptor::Properties; using ::mlir::arith::ArithFastMathInterface::Trait::getFastMathFlagsAttr; using ::mlir::arith::ArithFastMathInterface::Trait::getFastMathAttrName; static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() { static ::llvm::StringRef attrNames[] = {::llvm::StringRef("fastmath")}; return ::llvm::ArrayRef(attrNames); } ::mlir::StringAttr getFastmathAttrName() { return getAttributeNameForIndex(0); } static ::mlir::StringAttr getFastmathAttrName(::mlir::OperationName name) { return getAttributeNameForIndex(name, 0); } static constexpr ::llvm::StringLiteral getOperationName() { return ::llvm::StringLiteral("complex.expm1"); } std::pair getODSOperandIndexAndLength(unsigned index) { return {index, 1}; } ::mlir::Operation::operand_range getODSOperands(unsigned index) { auto valueRange = getODSOperandIndexAndLength(index); return {std::next(getOperation()->operand_begin(), valueRange.first), std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)}; } ::mlir::TypedValue<::mlir::ComplexType> getComplex() { return ::llvm::cast<::mlir::TypedValue<::mlir::ComplexType>>(*getODSOperands(0).begin()); } ::mlir::OpOperand &getComplexMutable() { auto range = getODSOperandIndexAndLength(0); return getOperation()->getOpOperand(range.first); } std::pair getODSResultIndexAndLength(unsigned index) { return {index, 1}; } ::mlir::Operation::result_range getODSResults(unsigned index) { auto valueRange = getODSResultIndexAndLength(index); return {std::next(getOperation()->result_begin(), valueRange.first), std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)}; } ::mlir::TypedValue<::mlir::ComplexType> getResult() { return ::llvm::cast<::mlir::TypedValue<::mlir::ComplexType>>(*getODSResults(0).begin()); } static ::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); static ::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop); static llvm::hash_code computePropertiesHash(const Properties &prop); static std::optional getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name); static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value); static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs); static ::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); static ::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state); void writeProperties(::mlir::DialectBytecodeWriter &writer); ::mlir::arith::FastMathFlagsAttr getFastmathAttr() { return ::llvm::dyn_cast_or_null<::mlir::arith::FastMathFlagsAttr>(getProperties().fastmath); } ::mlir::arith::FastMathFlags getFastmath(); void setFastmathAttr(::mlir::arith::FastMathFlagsAttr attr) { getProperties().fastmath = attr; } void setFastmath(::mlir::arith::FastMathFlags attrValue); static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value complex, ::mlir::arith::FastMathFlagsAttr fastmath); static Expm1Op create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::Value complex, ::mlir::arith::FastMathFlagsAttr fastmath); static Expm1Op create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type result, ::mlir::Value complex, ::mlir::arith::FastMathFlagsAttr fastmath); static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value complex, ::mlir::arith::FastMathFlagsAttr fastmath); static Expm1Op create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value complex, ::mlir::arith::FastMathFlagsAttr fastmath); static Expm1Op create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value complex, ::mlir::arith::FastMathFlagsAttr fastmath); static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value complex, ::mlir::arith::FastMathFlagsAttr fastmath); static Expm1Op create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value complex, ::mlir::arith::FastMathFlagsAttr fastmath); static Expm1Op create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value complex, ::mlir::arith::FastMathFlagsAttr fastmath); static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value complex, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); static Expm1Op create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::Value complex, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); static Expm1Op create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type result, ::mlir::Value complex, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value complex, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); static Expm1Op create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value complex, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); static Expm1Op create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value complex, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value complex, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); static Expm1Op create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value complex, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); static Expm1Op create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value complex, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); static Expm1Op create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); static Expm1Op create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); static Expm1Op create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); static Expm1Op create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); static Expm1Op create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); static Expm1Op create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); static Expm1Op create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); static Expm1Op create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); static void populateDefaultProperties(::mlir::OperationName opName, Properties &properties); ::llvm::LogicalResult verifyInvariantsImpl(); ::llvm::LogicalResult verifyInvariants(); static ::llvm::LogicalResult inferReturnTypes(::mlir::MLIRContext *context, ::std::optional<::mlir::Location> location, ::mlir::ValueRange operands, ::mlir::DictionaryAttr attributes, ::mlir::PropertyRef properties, ::mlir::RegionRange regions, ::llvm::SmallVectorImpl<::mlir::Type>&inferredReturnTypes); static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result); void print(::mlir::OpAsmPrinter &_odsPrinter); void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects); private: ::mlir::StringAttr getAttributeNameForIndex(unsigned index) { return getAttributeNameForIndex((*this)->getName(), index); } static ::mlir::StringAttr getAttributeNameForIndex(::mlir::OperationName name, unsigned index) { assert(index < 1 && "invalid attribute index"); assert(name.getStringRef() == getOperationName() && "invalid operation name"); assert(name.isRegistered() && "Operation isn't registered, missing a " "dependent dialect loading?"); return name.getAttributeNames()[index]; } public: }; } // namespace mlir::complex MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::complex::Expm1Op) MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::complex::detail::Expm1OpGenericAdaptorBase::Properties) namespace mlir::complex { //===----------------------------------------------------------------------===// // ::mlir::complex::ImOp declarations //===----------------------------------------------------------------------===// namespace detail { class ImOpGenericAdaptorBase { public: struct Properties { using fastmathTy = ::mlir::arith::FastMathFlagsAttr; fastmathTy fastmath; auto getFastmath() const { auto &propStorage = this->fastmath; return ::llvm::dyn_cast_or_null<::mlir::arith::FastMathFlagsAttr>(propStorage); } void setFastmath(const ::mlir::arith::FastMathFlagsAttr &propValue) { this->fastmath = propValue; } bool operator==(const Properties &rhs) const { return rhs.fastmath == this->fastmath && true; } bool operator!=(const Properties &rhs) const { return !(*this == rhs); } }; protected: ::mlir::DictionaryAttr odsAttrs; ::std::optional<::mlir::OperationName> odsOpName; Properties properties; ::mlir::RegionRange odsRegions; public: ImOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : odsAttrs(attrs), properties(properties), odsRegions(regions) { if (odsAttrs) odsOpName.emplace("complex.im", odsAttrs.getContext()); } ImOpGenericAdaptorBase(ImOp op); std::pair getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize) { return {index, 1}; } const Properties &getProperties() { return properties; } ::mlir::DictionaryAttr getAttributes() { return odsAttrs; } ::mlir::arith::FastMathFlagsAttr getFastmathAttr(); ::mlir::arith::FastMathFlags getFastmath(); }; } // namespace detail template class ImOpGenericAdaptor : public detail::ImOpGenericAdaptorBase { using ValueT = ::llvm::detail::ValueOfRange; using Base = detail::ImOpGenericAdaptorBase; static constexpr int odsIndex_complex = 0; public: ImOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {} ImOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::PropertyRef properties, ::mlir::RegionRange regions = {}) : ImOpGenericAdaptor(values, attrs, (properties ? *properties.as() : Properties{}), regions) {} ImOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs = nullptr) : ImOpGenericAdaptor(values, attrs, Properties{}, {}) {} ImOpGenericAdaptor(RangeT values, const ImOpGenericAdaptorBase &base) : Base(base), odsOperands(values) {} template >> ImOpGenericAdaptor(RangeT values, LateInst op) : Base(op), odsOperands(values) {} std::pair getODSOperandIndexAndLength(unsigned index) { return Base::getODSOperandIndexAndLength(index, odsOperands.size()); } RangeT getODSOperands(unsigned index) { auto valueRange = getODSOperandIndexAndLength(index); return {std::next(odsOperands.begin(), valueRange.first), std::next(odsOperands.begin(), valueRange.first + valueRange.second)}; } ValueT getComplex() { return (*getODSOperands(0).begin()); } RangeT getOperands() { return odsOperands; } private: RangeT odsOperands; }; class ImOpAdaptor : public ImOpGenericAdaptor<::mlir::ValueRange> { public: using ImOpGenericAdaptor::ImOpGenericAdaptor; ImOpAdaptor(ImOp op); ::llvm::LogicalResult verify(::mlir::Location loc); }; class ImOp : public ::mlir::Op::Impl, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::OneOperand, ::mlir::OpTrait::OpInvariants, ::mlir::BytecodeOpInterface::Trait, ::mlir::ConditionallySpeculatable::Trait, ::mlir::OpTrait::AlwaysSpeculatableImplTrait, ::mlir::MemoryEffectOpInterface::Trait, ::mlir::OpTrait::Elementwise, ::mlir::arith::ArithFastMathInterface::Trait, ::mlir::InferTypeOpInterface::Trait> { public: using Op::Op; using Op::print; using Adaptor = ImOpAdaptor; template using GenericAdaptor = ImOpGenericAdaptor; using FoldAdaptor = GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute>>; static constexpr int odsIndex_complex = 0; using Properties = FoldAdaptor::Properties; using ::mlir::arith::ArithFastMathInterface::Trait::getFastMathFlagsAttr; using ::mlir::arith::ArithFastMathInterface::Trait::getFastMathAttrName; static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() { static ::llvm::StringRef attrNames[] = {::llvm::StringRef("fastmath")}; return ::llvm::ArrayRef(attrNames); } ::mlir::StringAttr getFastmathAttrName() { return getAttributeNameForIndex(0); } static ::mlir::StringAttr getFastmathAttrName(::mlir::OperationName name) { return getAttributeNameForIndex(name, 0); } static constexpr ::llvm::StringLiteral getOperationName() { return ::llvm::StringLiteral("complex.im"); } std::pair getODSOperandIndexAndLength(unsigned index) { return {index, 1}; } ::mlir::Operation::operand_range getODSOperands(unsigned index) { auto valueRange = getODSOperandIndexAndLength(index); return {std::next(getOperation()->operand_begin(), valueRange.first), std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)}; } ::mlir::TypedValue<::mlir::ComplexType> getComplex() { return ::llvm::cast<::mlir::TypedValue<::mlir::ComplexType>>(*getODSOperands(0).begin()); } ::mlir::OpOperand &getComplexMutable() { auto range = getODSOperandIndexAndLength(0); return getOperation()->getOpOperand(range.first); } std::pair getODSResultIndexAndLength(unsigned index) { return {index, 1}; } ::mlir::Operation::result_range getODSResults(unsigned index) { auto valueRange = getODSResultIndexAndLength(index); return {std::next(getOperation()->result_begin(), valueRange.first), std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)}; } ::mlir::TypedValue<::mlir::FloatType> getImaginary() { return ::llvm::cast<::mlir::TypedValue<::mlir::FloatType>>(*getODSResults(0).begin()); } static ::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); static ::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop); static llvm::hash_code computePropertiesHash(const Properties &prop); static std::optional getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name); static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value); static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs); static ::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); static ::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state); void writeProperties(::mlir::DialectBytecodeWriter &writer); ::mlir::arith::FastMathFlagsAttr getFastmathAttr() { return ::llvm::dyn_cast_or_null<::mlir::arith::FastMathFlagsAttr>(getProperties().fastmath); } ::mlir::arith::FastMathFlags getFastmath(); void setFastmathAttr(::mlir::arith::FastMathFlagsAttr attr) { getProperties().fastmath = attr; } void setFastmath(::mlir::arith::FastMathFlags attrValue); static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type imaginary, ::mlir::Value complex, ::mlir::arith::FastMathFlagsAttr fastmath); static ImOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type imaginary, ::mlir::Value complex, ::mlir::arith::FastMathFlagsAttr fastmath); static ImOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type imaginary, ::mlir::Value complex, ::mlir::arith::FastMathFlagsAttr fastmath); static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value complex, ::mlir::arith::FastMathFlagsAttr fastmath); static ImOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value complex, ::mlir::arith::FastMathFlagsAttr fastmath); static ImOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value complex, ::mlir::arith::FastMathFlagsAttr fastmath); static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value complex, ::mlir::arith::FastMathFlagsAttr fastmath); static ImOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value complex, ::mlir::arith::FastMathFlagsAttr fastmath); static ImOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value complex, ::mlir::arith::FastMathFlagsAttr fastmath); static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type imaginary, ::mlir::Value complex, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); static ImOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type imaginary, ::mlir::Value complex, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); static ImOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type imaginary, ::mlir::Value complex, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value complex, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); static ImOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value complex, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); static ImOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value complex, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value complex, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); static ImOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value complex, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); static ImOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value complex, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); static ImOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); static ImOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); static ImOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); static ImOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); static ImOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); static ImOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); static ImOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); static ImOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); static void populateDefaultProperties(::mlir::OperationName opName, Properties &properties); ::llvm::LogicalResult verifyInvariantsImpl(); ::llvm::LogicalResult verifyInvariants(); static void getCanonicalizationPatterns(::mlir::RewritePatternSet &results, ::mlir::MLIRContext *context); ::mlir::OpFoldResult fold(FoldAdaptor adaptor); static ::llvm::LogicalResult inferReturnTypes(::mlir::MLIRContext *context, ::std::optional<::mlir::Location> location, ::mlir::ValueRange operands, ::mlir::DictionaryAttr attributes, ::mlir::PropertyRef properties, ::mlir::RegionRange regions, ::llvm::SmallVectorImpl<::mlir::Type>&inferredReturnTypes); static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result); void print(::mlir::OpAsmPrinter &_odsPrinter); void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects); private: ::mlir::StringAttr getAttributeNameForIndex(unsigned index) { return getAttributeNameForIndex((*this)->getName(), index); } static ::mlir::StringAttr getAttributeNameForIndex(::mlir::OperationName name, unsigned index) { assert(index < 1 && "invalid attribute index"); assert(name.getStringRef() == getOperationName() && "invalid operation name"); assert(name.isRegistered() && "Operation isn't registered, missing a " "dependent dialect loading?"); return name.getAttributeNames()[index]; } public: }; } // namespace mlir::complex MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::complex::ImOp) MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::complex::detail::ImOpGenericAdaptorBase::Properties) namespace mlir::complex { //===----------------------------------------------------------------------===// // ::mlir::complex::Log1pOp declarations //===----------------------------------------------------------------------===// namespace detail { class Log1pOpGenericAdaptorBase { public: struct Properties { using fastmathTy = ::mlir::arith::FastMathFlagsAttr; fastmathTy fastmath; auto getFastmath() const { auto &propStorage = this->fastmath; return ::llvm::dyn_cast_or_null<::mlir::arith::FastMathFlagsAttr>(propStorage); } void setFastmath(const ::mlir::arith::FastMathFlagsAttr &propValue) { this->fastmath = propValue; } bool operator==(const Properties &rhs) const { return rhs.fastmath == this->fastmath && true; } bool operator!=(const Properties &rhs) const { return !(*this == rhs); } }; protected: ::mlir::DictionaryAttr odsAttrs; ::std::optional<::mlir::OperationName> odsOpName; Properties properties; ::mlir::RegionRange odsRegions; public: Log1pOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : odsAttrs(attrs), properties(properties), odsRegions(regions) { if (odsAttrs) odsOpName.emplace("complex.log1p", odsAttrs.getContext()); } Log1pOpGenericAdaptorBase(Log1pOp op); std::pair getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize) { return {index, 1}; } const Properties &getProperties() { return properties; } ::mlir::DictionaryAttr getAttributes() { return odsAttrs; } ::mlir::arith::FastMathFlagsAttr getFastmathAttr(); ::mlir::arith::FastMathFlags getFastmath(); }; } // namespace detail template class Log1pOpGenericAdaptor : public detail::Log1pOpGenericAdaptorBase { using ValueT = ::llvm::detail::ValueOfRange; using Base = detail::Log1pOpGenericAdaptorBase; static constexpr int odsIndex_complex = 0; public: Log1pOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {} Log1pOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::PropertyRef properties, ::mlir::RegionRange regions = {}) : Log1pOpGenericAdaptor(values, attrs, (properties ? *properties.as() : Properties{}), regions) {} Log1pOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs = nullptr) : Log1pOpGenericAdaptor(values, attrs, Properties{}, {}) {} Log1pOpGenericAdaptor(RangeT values, const Log1pOpGenericAdaptorBase &base) : Base(base), odsOperands(values) {} template >> Log1pOpGenericAdaptor(RangeT values, LateInst op) : Base(op), odsOperands(values) {} std::pair getODSOperandIndexAndLength(unsigned index) { return Base::getODSOperandIndexAndLength(index, odsOperands.size()); } RangeT getODSOperands(unsigned index) { auto valueRange = getODSOperandIndexAndLength(index); return {std::next(odsOperands.begin(), valueRange.first), std::next(odsOperands.begin(), valueRange.first + valueRange.second)}; } ValueT getComplex() { return (*getODSOperands(0).begin()); } RangeT getOperands() { return odsOperands; } private: RangeT odsOperands; }; class Log1pOpAdaptor : public Log1pOpGenericAdaptor<::mlir::ValueRange> { public: using Log1pOpGenericAdaptor::Log1pOpGenericAdaptor; Log1pOpAdaptor(Log1pOp op); ::llvm::LogicalResult verify(::mlir::Location loc); }; class Log1pOp : public ::mlir::Op::Impl, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::OneOperand, ::mlir::OpTrait::OpInvariants, ::mlir::BytecodeOpInterface::Trait, ::mlir::OpTrait::SameOperandsAndResultType, ::mlir::ConditionallySpeculatable::Trait, ::mlir::OpTrait::AlwaysSpeculatableImplTrait, ::mlir::MemoryEffectOpInterface::Trait, ::mlir::OpTrait::Elementwise, ::mlir::arith::ArithFastMathInterface::Trait, ::mlir::InferTypeOpInterface::Trait> { public: using Op::Op; using Op::print; using Adaptor = Log1pOpAdaptor; template using GenericAdaptor = Log1pOpGenericAdaptor; using FoldAdaptor = GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute>>; static constexpr int odsIndex_complex = 0; using Properties = FoldAdaptor::Properties; using ::mlir::arith::ArithFastMathInterface::Trait::getFastMathFlagsAttr; using ::mlir::arith::ArithFastMathInterface::Trait::getFastMathAttrName; static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() { static ::llvm::StringRef attrNames[] = {::llvm::StringRef("fastmath")}; return ::llvm::ArrayRef(attrNames); } ::mlir::StringAttr getFastmathAttrName() { return getAttributeNameForIndex(0); } static ::mlir::StringAttr getFastmathAttrName(::mlir::OperationName name) { return getAttributeNameForIndex(name, 0); } static constexpr ::llvm::StringLiteral getOperationName() { return ::llvm::StringLiteral("complex.log1p"); } std::pair getODSOperandIndexAndLength(unsigned index) { return {index, 1}; } ::mlir::Operation::operand_range getODSOperands(unsigned index) { auto valueRange = getODSOperandIndexAndLength(index); return {std::next(getOperation()->operand_begin(), valueRange.first), std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)}; } ::mlir::TypedValue<::mlir::ComplexType> getComplex() { return ::llvm::cast<::mlir::TypedValue<::mlir::ComplexType>>(*getODSOperands(0).begin()); } ::mlir::OpOperand &getComplexMutable() { auto range = getODSOperandIndexAndLength(0); return getOperation()->getOpOperand(range.first); } std::pair getODSResultIndexAndLength(unsigned index) { return {index, 1}; } ::mlir::Operation::result_range getODSResults(unsigned index) { auto valueRange = getODSResultIndexAndLength(index); return {std::next(getOperation()->result_begin(), valueRange.first), std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)}; } ::mlir::TypedValue<::mlir::ComplexType> getResult() { return ::llvm::cast<::mlir::TypedValue<::mlir::ComplexType>>(*getODSResults(0).begin()); } static ::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); static ::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop); static llvm::hash_code computePropertiesHash(const Properties &prop); static std::optional getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name); static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value); static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs); static ::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); static ::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state); void writeProperties(::mlir::DialectBytecodeWriter &writer); ::mlir::arith::FastMathFlagsAttr getFastmathAttr() { return ::llvm::dyn_cast_or_null<::mlir::arith::FastMathFlagsAttr>(getProperties().fastmath); } ::mlir::arith::FastMathFlags getFastmath(); void setFastmathAttr(::mlir::arith::FastMathFlagsAttr attr) { getProperties().fastmath = attr; } void setFastmath(::mlir::arith::FastMathFlags attrValue); static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value complex, ::mlir::arith::FastMathFlagsAttr fastmath); static Log1pOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::Value complex, ::mlir::arith::FastMathFlagsAttr fastmath); static Log1pOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type result, ::mlir::Value complex, ::mlir::arith::FastMathFlagsAttr fastmath); static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value complex, ::mlir::arith::FastMathFlagsAttr fastmath); static Log1pOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value complex, ::mlir::arith::FastMathFlagsAttr fastmath); static Log1pOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value complex, ::mlir::arith::FastMathFlagsAttr fastmath); static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value complex, ::mlir::arith::FastMathFlagsAttr fastmath); static Log1pOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value complex, ::mlir::arith::FastMathFlagsAttr fastmath); static Log1pOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value complex, ::mlir::arith::FastMathFlagsAttr fastmath); static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value complex, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); static Log1pOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::Value complex, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); static Log1pOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type result, ::mlir::Value complex, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value complex, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); static Log1pOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value complex, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); static Log1pOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value complex, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value complex, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); static Log1pOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value complex, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); static Log1pOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value complex, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); static Log1pOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); static Log1pOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); static Log1pOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); static Log1pOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); static Log1pOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); static Log1pOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); static Log1pOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); static Log1pOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); static void populateDefaultProperties(::mlir::OperationName opName, Properties &properties); ::llvm::LogicalResult verifyInvariantsImpl(); ::llvm::LogicalResult verifyInvariants(); static ::llvm::LogicalResult inferReturnTypes(::mlir::MLIRContext *context, ::std::optional<::mlir::Location> location, ::mlir::ValueRange operands, ::mlir::DictionaryAttr attributes, ::mlir::PropertyRef properties, ::mlir::RegionRange regions, ::llvm::SmallVectorImpl<::mlir::Type>&inferredReturnTypes); static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result); void print(::mlir::OpAsmPrinter &_odsPrinter); void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects); private: ::mlir::StringAttr getAttributeNameForIndex(unsigned index) { return getAttributeNameForIndex((*this)->getName(), index); } static ::mlir::StringAttr getAttributeNameForIndex(::mlir::OperationName name, unsigned index) { assert(index < 1 && "invalid attribute index"); assert(name.getStringRef() == getOperationName() && "invalid operation name"); assert(name.isRegistered() && "Operation isn't registered, missing a " "dependent dialect loading?"); return name.getAttributeNames()[index]; } public: }; } // namespace mlir::complex MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::complex::Log1pOp) MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::complex::detail::Log1pOpGenericAdaptorBase::Properties) namespace mlir::complex { //===----------------------------------------------------------------------===// // ::mlir::complex::LogOp declarations //===----------------------------------------------------------------------===// namespace detail { class LogOpGenericAdaptorBase { public: struct Properties { using fastmathTy = ::mlir::arith::FastMathFlagsAttr; fastmathTy fastmath; auto getFastmath() const { auto &propStorage = this->fastmath; return ::llvm::dyn_cast_or_null<::mlir::arith::FastMathFlagsAttr>(propStorage); } void setFastmath(const ::mlir::arith::FastMathFlagsAttr &propValue) { this->fastmath = propValue; } bool operator==(const Properties &rhs) const { return rhs.fastmath == this->fastmath && true; } bool operator!=(const Properties &rhs) const { return !(*this == rhs); } }; protected: ::mlir::DictionaryAttr odsAttrs; ::std::optional<::mlir::OperationName> odsOpName; Properties properties; ::mlir::RegionRange odsRegions; public: LogOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : odsAttrs(attrs), properties(properties), odsRegions(regions) { if (odsAttrs) odsOpName.emplace("complex.log", odsAttrs.getContext()); } LogOpGenericAdaptorBase(LogOp op); std::pair getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize) { return {index, 1}; } const Properties &getProperties() { return properties; } ::mlir::DictionaryAttr getAttributes() { return odsAttrs; } ::mlir::arith::FastMathFlagsAttr getFastmathAttr(); ::mlir::arith::FastMathFlags getFastmath(); }; } // namespace detail template class LogOpGenericAdaptor : public detail::LogOpGenericAdaptorBase { using ValueT = ::llvm::detail::ValueOfRange; using Base = detail::LogOpGenericAdaptorBase; static constexpr int odsIndex_complex = 0; public: LogOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {} LogOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::PropertyRef properties, ::mlir::RegionRange regions = {}) : LogOpGenericAdaptor(values, attrs, (properties ? *properties.as() : Properties{}), regions) {} LogOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs = nullptr) : LogOpGenericAdaptor(values, attrs, Properties{}, {}) {} LogOpGenericAdaptor(RangeT values, const LogOpGenericAdaptorBase &base) : Base(base), odsOperands(values) {} template >> LogOpGenericAdaptor(RangeT values, LateInst op) : Base(op), odsOperands(values) {} std::pair getODSOperandIndexAndLength(unsigned index) { return Base::getODSOperandIndexAndLength(index, odsOperands.size()); } RangeT getODSOperands(unsigned index) { auto valueRange = getODSOperandIndexAndLength(index); return {std::next(odsOperands.begin(), valueRange.first), std::next(odsOperands.begin(), valueRange.first + valueRange.second)}; } ValueT getComplex() { return (*getODSOperands(0).begin()); } RangeT getOperands() { return odsOperands; } private: RangeT odsOperands; }; class LogOpAdaptor : public LogOpGenericAdaptor<::mlir::ValueRange> { public: using LogOpGenericAdaptor::LogOpGenericAdaptor; LogOpAdaptor(LogOp op); ::llvm::LogicalResult verify(::mlir::Location loc); }; class LogOp : public ::mlir::Op::Impl, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::OneOperand, ::mlir::OpTrait::OpInvariants, ::mlir::BytecodeOpInterface::Trait, ::mlir::OpTrait::SameOperandsAndResultType, ::mlir::ConditionallySpeculatable::Trait, ::mlir::OpTrait::AlwaysSpeculatableImplTrait, ::mlir::MemoryEffectOpInterface::Trait, ::mlir::OpTrait::Elementwise, ::mlir::arith::ArithFastMathInterface::Trait, ::mlir::InferTypeOpInterface::Trait> { public: using Op::Op; using Op::print; using Adaptor = LogOpAdaptor; template using GenericAdaptor = LogOpGenericAdaptor; using FoldAdaptor = GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute>>; static constexpr int odsIndex_complex = 0; using Properties = FoldAdaptor::Properties; using ::mlir::arith::ArithFastMathInterface::Trait::getFastMathFlagsAttr; using ::mlir::arith::ArithFastMathInterface::Trait::getFastMathAttrName; static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() { static ::llvm::StringRef attrNames[] = {::llvm::StringRef("fastmath")}; return ::llvm::ArrayRef(attrNames); } ::mlir::StringAttr getFastmathAttrName() { return getAttributeNameForIndex(0); } static ::mlir::StringAttr getFastmathAttrName(::mlir::OperationName name) { return getAttributeNameForIndex(name, 0); } static constexpr ::llvm::StringLiteral getOperationName() { return ::llvm::StringLiteral("complex.log"); } std::pair getODSOperandIndexAndLength(unsigned index) { return {index, 1}; } ::mlir::Operation::operand_range getODSOperands(unsigned index) { auto valueRange = getODSOperandIndexAndLength(index); return {std::next(getOperation()->operand_begin(), valueRange.first), std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)}; } ::mlir::TypedValue<::mlir::ComplexType> getComplex() { return ::llvm::cast<::mlir::TypedValue<::mlir::ComplexType>>(*getODSOperands(0).begin()); } ::mlir::OpOperand &getComplexMutable() { auto range = getODSOperandIndexAndLength(0); return getOperation()->getOpOperand(range.first); } std::pair getODSResultIndexAndLength(unsigned index) { return {index, 1}; } ::mlir::Operation::result_range getODSResults(unsigned index) { auto valueRange = getODSResultIndexAndLength(index); return {std::next(getOperation()->result_begin(), valueRange.first), std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)}; } ::mlir::TypedValue<::mlir::ComplexType> getResult() { return ::llvm::cast<::mlir::TypedValue<::mlir::ComplexType>>(*getODSResults(0).begin()); } static ::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); static ::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop); static llvm::hash_code computePropertiesHash(const Properties &prop); static std::optional getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name); static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value); static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs); static ::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); static ::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state); void writeProperties(::mlir::DialectBytecodeWriter &writer); ::mlir::arith::FastMathFlagsAttr getFastmathAttr() { return ::llvm::dyn_cast_or_null<::mlir::arith::FastMathFlagsAttr>(getProperties().fastmath); } ::mlir::arith::FastMathFlags getFastmath(); void setFastmathAttr(::mlir::arith::FastMathFlagsAttr attr) { getProperties().fastmath = attr; } void setFastmath(::mlir::arith::FastMathFlags attrValue); static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value complex, ::mlir::arith::FastMathFlagsAttr fastmath); static LogOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::Value complex, ::mlir::arith::FastMathFlagsAttr fastmath); static LogOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type result, ::mlir::Value complex, ::mlir::arith::FastMathFlagsAttr fastmath); static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value complex, ::mlir::arith::FastMathFlagsAttr fastmath); static LogOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value complex, ::mlir::arith::FastMathFlagsAttr fastmath); static LogOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value complex, ::mlir::arith::FastMathFlagsAttr fastmath); static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value complex, ::mlir::arith::FastMathFlagsAttr fastmath); static LogOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value complex, ::mlir::arith::FastMathFlagsAttr fastmath); static LogOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value complex, ::mlir::arith::FastMathFlagsAttr fastmath); static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value complex, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); static LogOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::Value complex, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); static LogOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type result, ::mlir::Value complex, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value complex, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); static LogOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value complex, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); static LogOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value complex, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value complex, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); static LogOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value complex, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); static LogOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value complex, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); static LogOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); static LogOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); static LogOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); static LogOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); static LogOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); static LogOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); static LogOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); static LogOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); static void populateDefaultProperties(::mlir::OperationName opName, Properties &properties); ::llvm::LogicalResult verifyInvariantsImpl(); ::llvm::LogicalResult verifyInvariants(); ::mlir::OpFoldResult fold(FoldAdaptor adaptor); static ::llvm::LogicalResult inferReturnTypes(::mlir::MLIRContext *context, ::std::optional<::mlir::Location> location, ::mlir::ValueRange operands, ::mlir::DictionaryAttr attributes, ::mlir::PropertyRef properties, ::mlir::RegionRange regions, ::llvm::SmallVectorImpl<::mlir::Type>&inferredReturnTypes); static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result); void print(::mlir::OpAsmPrinter &_odsPrinter); void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects); private: ::mlir::StringAttr getAttributeNameForIndex(unsigned index) { return getAttributeNameForIndex((*this)->getName(), index); } static ::mlir::StringAttr getAttributeNameForIndex(::mlir::OperationName name, unsigned index) { assert(index < 1 && "invalid attribute index"); assert(name.getStringRef() == getOperationName() && "invalid operation name"); assert(name.isRegistered() && "Operation isn't registered, missing a " "dependent dialect loading?"); return name.getAttributeNames()[index]; } public: }; } // namespace mlir::complex MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::complex::LogOp) MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::complex::detail::LogOpGenericAdaptorBase::Properties) namespace mlir::complex { //===----------------------------------------------------------------------===// // ::mlir::complex::MulOp declarations //===----------------------------------------------------------------------===// namespace detail { class MulOpGenericAdaptorBase { public: struct Properties { using fastmathTy = ::mlir::arith::FastMathFlagsAttr; fastmathTy fastmath; auto getFastmath() const { auto &propStorage = this->fastmath; return ::llvm::dyn_cast_or_null<::mlir::arith::FastMathFlagsAttr>(propStorage); } void setFastmath(const ::mlir::arith::FastMathFlagsAttr &propValue) { this->fastmath = propValue; } bool operator==(const Properties &rhs) const { return rhs.fastmath == this->fastmath && true; } bool operator!=(const Properties &rhs) const { return !(*this == rhs); } }; protected: ::mlir::DictionaryAttr odsAttrs; ::std::optional<::mlir::OperationName> odsOpName; Properties properties; ::mlir::RegionRange odsRegions; public: MulOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : odsAttrs(attrs), properties(properties), odsRegions(regions) { if (odsAttrs) odsOpName.emplace("complex.mul", odsAttrs.getContext()); } MulOpGenericAdaptorBase(MulOp op); std::pair getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize) { return {index, 1}; } const Properties &getProperties() { return properties; } ::mlir::DictionaryAttr getAttributes() { return odsAttrs; } ::mlir::arith::FastMathFlagsAttr getFastmathAttr(); ::mlir::arith::FastMathFlags getFastmath(); }; } // namespace detail template class MulOpGenericAdaptor : public detail::MulOpGenericAdaptorBase { using ValueT = ::llvm::detail::ValueOfRange; using Base = detail::MulOpGenericAdaptorBase; static constexpr int odsIndex_lhs = 0; static constexpr int odsIndex_rhs = 1; public: MulOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {} MulOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::PropertyRef properties, ::mlir::RegionRange regions = {}) : MulOpGenericAdaptor(values, attrs, (properties ? *properties.as() : Properties{}), regions) {} MulOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs = nullptr) : MulOpGenericAdaptor(values, attrs, Properties{}, {}) {} MulOpGenericAdaptor(RangeT values, const MulOpGenericAdaptorBase &base) : Base(base), odsOperands(values) {} template >> MulOpGenericAdaptor(RangeT values, LateInst op) : Base(op), odsOperands(values) {} std::pair getODSOperandIndexAndLength(unsigned index) { return Base::getODSOperandIndexAndLength(index, odsOperands.size()); } RangeT getODSOperands(unsigned index) { auto valueRange = getODSOperandIndexAndLength(index); return {std::next(odsOperands.begin(), valueRange.first), std::next(odsOperands.begin(), valueRange.first + valueRange.second)}; } ValueT getLhs() { return (*getODSOperands(0).begin()); } ValueT getRhs() { return (*getODSOperands(1).begin()); } RangeT getOperands() { return odsOperands; } private: RangeT odsOperands; }; class MulOpAdaptor : public MulOpGenericAdaptor<::mlir::ValueRange> { public: using MulOpGenericAdaptor::MulOpGenericAdaptor; MulOpAdaptor(MulOp op); ::llvm::LogicalResult verify(::mlir::Location loc); }; class MulOp : public ::mlir::Op::Impl, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::NOperands<2>::Impl, ::mlir::OpTrait::OpInvariants, ::mlir::BytecodeOpInterface::Trait, ::mlir::ConditionallySpeculatable::Trait, ::mlir::OpTrait::AlwaysSpeculatableImplTrait, ::mlir::MemoryEffectOpInterface::Trait, ::mlir::OpTrait::SameOperandsAndResultType, ::mlir::OpTrait::Elementwise, ::mlir::arith::ArithFastMathInterface::Trait, ::mlir::InferTypeOpInterface::Trait> { public: using Op::Op; using Op::print; using Adaptor = MulOpAdaptor; template using GenericAdaptor = MulOpGenericAdaptor; using FoldAdaptor = GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute>>; static constexpr int odsIndex_lhs = 0; static constexpr int odsIndex_rhs = 1; using Properties = FoldAdaptor::Properties; using ::mlir::arith::ArithFastMathInterface::Trait::getFastMathFlagsAttr; using ::mlir::arith::ArithFastMathInterface::Trait::getFastMathAttrName; static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() { static ::llvm::StringRef attrNames[] = {::llvm::StringRef("fastmath")}; return ::llvm::ArrayRef(attrNames); } ::mlir::StringAttr getFastmathAttrName() { return getAttributeNameForIndex(0); } static ::mlir::StringAttr getFastmathAttrName(::mlir::OperationName name) { return getAttributeNameForIndex(name, 0); } static constexpr ::llvm::StringLiteral getOperationName() { return ::llvm::StringLiteral("complex.mul"); } std::pair getODSOperandIndexAndLength(unsigned index) { return {index, 1}; } ::mlir::Operation::operand_range getODSOperands(unsigned index) { auto valueRange = getODSOperandIndexAndLength(index); return {std::next(getOperation()->operand_begin(), valueRange.first), std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)}; } ::mlir::TypedValue<::mlir::ComplexType> getLhs() { return ::llvm::cast<::mlir::TypedValue<::mlir::ComplexType>>(*getODSOperands(0).begin()); } ::mlir::TypedValue<::mlir::ComplexType> getRhs() { return ::llvm::cast<::mlir::TypedValue<::mlir::ComplexType>>(*getODSOperands(1).begin()); } ::mlir::OpOperand &getLhsMutable() { auto range = getODSOperandIndexAndLength(0); return getOperation()->getOpOperand(range.first); } ::mlir::OpOperand &getRhsMutable() { auto range = getODSOperandIndexAndLength(1); return getOperation()->getOpOperand(range.first); } std::pair getODSResultIndexAndLength(unsigned index) { return {index, 1}; } ::mlir::Operation::result_range getODSResults(unsigned index) { auto valueRange = getODSResultIndexAndLength(index); return {std::next(getOperation()->result_begin(), valueRange.first), std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)}; } ::mlir::TypedValue<::mlir::ComplexType> getResult() { return ::llvm::cast<::mlir::TypedValue<::mlir::ComplexType>>(*getODSResults(0).begin()); } static ::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); static ::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop); static llvm::hash_code computePropertiesHash(const Properties &prop); static std::optional getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name); static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value); static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs); static ::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); static ::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state); void writeProperties(::mlir::DialectBytecodeWriter &writer); ::mlir::arith::FastMathFlagsAttr getFastmathAttr() { return ::llvm::dyn_cast_or_null<::mlir::arith::FastMathFlagsAttr>(getProperties().fastmath); } ::mlir::arith::FastMathFlags getFastmath(); void setFastmathAttr(::mlir::arith::FastMathFlagsAttr attr) { getProperties().fastmath = attr; } void setFastmath(::mlir::arith::FastMathFlags attrValue); static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlagsAttr fastmath); static MulOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlagsAttr fastmath); static MulOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlagsAttr fastmath); static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlagsAttr fastmath); static MulOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlagsAttr fastmath); static MulOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlagsAttr fastmath); static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlagsAttr fastmath); static MulOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlagsAttr fastmath); static MulOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlagsAttr fastmath); static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); static MulOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); static MulOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); static MulOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); static MulOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); static MulOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); static MulOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); static MulOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); static MulOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); static MulOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); static MulOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); static MulOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); static MulOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); static MulOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); static MulOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); static void populateDefaultProperties(::mlir::OperationName opName, Properties &properties); ::llvm::LogicalResult verifyInvariantsImpl(); ::llvm::LogicalResult verifyInvariants(); ::mlir::OpFoldResult fold(FoldAdaptor adaptor); static ::llvm::LogicalResult inferReturnTypes(::mlir::MLIRContext *context, ::std::optional<::mlir::Location> location, ::mlir::ValueRange operands, ::mlir::DictionaryAttr attributes, ::mlir::PropertyRef properties, ::mlir::RegionRange regions, ::llvm::SmallVectorImpl<::mlir::Type>&inferredReturnTypes); static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result); void print(::mlir::OpAsmPrinter &_odsPrinter); void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects); private: ::mlir::StringAttr getAttributeNameForIndex(unsigned index) { return getAttributeNameForIndex((*this)->getName(), index); } static ::mlir::StringAttr getAttributeNameForIndex(::mlir::OperationName name, unsigned index) { assert(index < 1 && "invalid attribute index"); assert(name.getStringRef() == getOperationName() && "invalid operation name"); assert(name.isRegistered() && "Operation isn't registered, missing a " "dependent dialect loading?"); return name.getAttributeNames()[index]; } public: }; } // namespace mlir::complex MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::complex::MulOp) MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::complex::detail::MulOpGenericAdaptorBase::Properties) namespace mlir::complex { //===----------------------------------------------------------------------===// // ::mlir::complex::NegOp declarations //===----------------------------------------------------------------------===// namespace detail { class NegOpGenericAdaptorBase { public: struct Properties { using fastmathTy = ::mlir::arith::FastMathFlagsAttr; fastmathTy fastmath; auto getFastmath() const { auto &propStorage = this->fastmath; return ::llvm::dyn_cast_or_null<::mlir::arith::FastMathFlagsAttr>(propStorage); } void setFastmath(const ::mlir::arith::FastMathFlagsAttr &propValue) { this->fastmath = propValue; } bool operator==(const Properties &rhs) const { return rhs.fastmath == this->fastmath && true; } bool operator!=(const Properties &rhs) const { return !(*this == rhs); } }; protected: ::mlir::DictionaryAttr odsAttrs; ::std::optional<::mlir::OperationName> odsOpName; Properties properties; ::mlir::RegionRange odsRegions; public: NegOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : odsAttrs(attrs), properties(properties), odsRegions(regions) { if (odsAttrs) odsOpName.emplace("complex.neg", odsAttrs.getContext()); } NegOpGenericAdaptorBase(NegOp op); std::pair getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize) { return {index, 1}; } const Properties &getProperties() { return properties; } ::mlir::DictionaryAttr getAttributes() { return odsAttrs; } ::mlir::arith::FastMathFlagsAttr getFastmathAttr(); ::mlir::arith::FastMathFlags getFastmath(); }; } // namespace detail template class NegOpGenericAdaptor : public detail::NegOpGenericAdaptorBase { using ValueT = ::llvm::detail::ValueOfRange; using Base = detail::NegOpGenericAdaptorBase; static constexpr int odsIndex_complex = 0; public: NegOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {} NegOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::PropertyRef properties, ::mlir::RegionRange regions = {}) : NegOpGenericAdaptor(values, attrs, (properties ? *properties.as() : Properties{}), regions) {} NegOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs = nullptr) : NegOpGenericAdaptor(values, attrs, Properties{}, {}) {} NegOpGenericAdaptor(RangeT values, const NegOpGenericAdaptorBase &base) : Base(base), odsOperands(values) {} template >> NegOpGenericAdaptor(RangeT values, LateInst op) : Base(op), odsOperands(values) {} std::pair getODSOperandIndexAndLength(unsigned index) { return Base::getODSOperandIndexAndLength(index, odsOperands.size()); } RangeT getODSOperands(unsigned index) { auto valueRange = getODSOperandIndexAndLength(index); return {std::next(odsOperands.begin(), valueRange.first), std::next(odsOperands.begin(), valueRange.first + valueRange.second)}; } ValueT getComplex() { return (*getODSOperands(0).begin()); } RangeT getOperands() { return odsOperands; } private: RangeT odsOperands; }; class NegOpAdaptor : public NegOpGenericAdaptor<::mlir::ValueRange> { public: using NegOpGenericAdaptor::NegOpGenericAdaptor; NegOpAdaptor(NegOp op); ::llvm::LogicalResult verify(::mlir::Location loc); }; class NegOp : public ::mlir::Op::Impl, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::OneOperand, ::mlir::OpTrait::OpInvariants, ::mlir::BytecodeOpInterface::Trait, ::mlir::OpTrait::SameOperandsAndResultType, ::mlir::ConditionallySpeculatable::Trait, ::mlir::OpTrait::AlwaysSpeculatableImplTrait, ::mlir::MemoryEffectOpInterface::Trait, ::mlir::OpTrait::Elementwise, ::mlir::arith::ArithFastMathInterface::Trait, ::mlir::InferTypeOpInterface::Trait> { public: using Op::Op; using Op::print; using Adaptor = NegOpAdaptor; template using GenericAdaptor = NegOpGenericAdaptor; using FoldAdaptor = GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute>>; static constexpr int odsIndex_complex = 0; using Properties = FoldAdaptor::Properties; using ::mlir::arith::ArithFastMathInterface::Trait::getFastMathFlagsAttr; using ::mlir::arith::ArithFastMathInterface::Trait::getFastMathAttrName; static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() { static ::llvm::StringRef attrNames[] = {::llvm::StringRef("fastmath")}; return ::llvm::ArrayRef(attrNames); } ::mlir::StringAttr getFastmathAttrName() { return getAttributeNameForIndex(0); } static ::mlir::StringAttr getFastmathAttrName(::mlir::OperationName name) { return getAttributeNameForIndex(name, 0); } static constexpr ::llvm::StringLiteral getOperationName() { return ::llvm::StringLiteral("complex.neg"); } std::pair getODSOperandIndexAndLength(unsigned index) { return {index, 1}; } ::mlir::Operation::operand_range getODSOperands(unsigned index) { auto valueRange = getODSOperandIndexAndLength(index); return {std::next(getOperation()->operand_begin(), valueRange.first), std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)}; } ::mlir::TypedValue<::mlir::ComplexType> getComplex() { return ::llvm::cast<::mlir::TypedValue<::mlir::ComplexType>>(*getODSOperands(0).begin()); } ::mlir::OpOperand &getComplexMutable() { auto range = getODSOperandIndexAndLength(0); return getOperation()->getOpOperand(range.first); } std::pair getODSResultIndexAndLength(unsigned index) { return {index, 1}; } ::mlir::Operation::result_range getODSResults(unsigned index) { auto valueRange = getODSResultIndexAndLength(index); return {std::next(getOperation()->result_begin(), valueRange.first), std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)}; } ::mlir::TypedValue<::mlir::ComplexType> getResult() { return ::llvm::cast<::mlir::TypedValue<::mlir::ComplexType>>(*getODSResults(0).begin()); } static ::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); static ::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop); static llvm::hash_code computePropertiesHash(const Properties &prop); static std::optional getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name); static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value); static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs); static ::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); static ::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state); void writeProperties(::mlir::DialectBytecodeWriter &writer); ::mlir::arith::FastMathFlagsAttr getFastmathAttr() { return ::llvm::dyn_cast_or_null<::mlir::arith::FastMathFlagsAttr>(getProperties().fastmath); } ::mlir::arith::FastMathFlags getFastmath(); void setFastmathAttr(::mlir::arith::FastMathFlagsAttr attr) { getProperties().fastmath = attr; } void setFastmath(::mlir::arith::FastMathFlags attrValue); static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value complex, ::mlir::arith::FastMathFlagsAttr fastmath); static NegOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::Value complex, ::mlir::arith::FastMathFlagsAttr fastmath); static NegOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type result, ::mlir::Value complex, ::mlir::arith::FastMathFlagsAttr fastmath); static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value complex, ::mlir::arith::FastMathFlagsAttr fastmath); static NegOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value complex, ::mlir::arith::FastMathFlagsAttr fastmath); static NegOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value complex, ::mlir::arith::FastMathFlagsAttr fastmath); static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value complex, ::mlir::arith::FastMathFlagsAttr fastmath); static NegOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value complex, ::mlir::arith::FastMathFlagsAttr fastmath); static NegOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value complex, ::mlir::arith::FastMathFlagsAttr fastmath); static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value complex, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); static NegOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::Value complex, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); static NegOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type result, ::mlir::Value complex, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value complex, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); static NegOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value complex, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); static NegOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value complex, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value complex, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); static NegOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value complex, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); static NegOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value complex, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); static NegOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); static NegOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); static NegOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); static NegOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); static NegOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); static NegOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); static NegOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); static NegOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); static void populateDefaultProperties(::mlir::OperationName opName, Properties &properties); ::llvm::LogicalResult verifyInvariantsImpl(); ::llvm::LogicalResult verifyInvariants(); ::mlir::OpFoldResult fold(FoldAdaptor adaptor); static ::llvm::LogicalResult inferReturnTypes(::mlir::MLIRContext *context, ::std::optional<::mlir::Location> location, ::mlir::ValueRange operands, ::mlir::DictionaryAttr attributes, ::mlir::PropertyRef properties, ::mlir::RegionRange regions, ::llvm::SmallVectorImpl<::mlir::Type>&inferredReturnTypes); static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result); void print(::mlir::OpAsmPrinter &_odsPrinter); void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects); private: ::mlir::StringAttr getAttributeNameForIndex(unsigned index) { return getAttributeNameForIndex((*this)->getName(), index); } static ::mlir::StringAttr getAttributeNameForIndex(::mlir::OperationName name, unsigned index) { assert(index < 1 && "invalid attribute index"); assert(name.getStringRef() == getOperationName() && "invalid operation name"); assert(name.isRegistered() && "Operation isn't registered, missing a " "dependent dialect loading?"); return name.getAttributeNames()[index]; } public: }; } // namespace mlir::complex MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::complex::NegOp) MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::complex::detail::NegOpGenericAdaptorBase::Properties) namespace mlir::complex { //===----------------------------------------------------------------------===// // ::mlir::complex::NotEqualOp declarations //===----------------------------------------------------------------------===// namespace detail { class NotEqualOpGenericAdaptorBase { public: using Properties = ::mlir::EmptyProperties; protected: ::mlir::DictionaryAttr odsAttrs; ::std::optional<::mlir::OperationName> odsOpName; Properties properties; ::mlir::RegionRange odsRegions; public: NotEqualOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : odsAttrs(attrs), properties(properties), odsRegions(regions) { if (odsAttrs) odsOpName.emplace("complex.neq", odsAttrs.getContext()); } NotEqualOpGenericAdaptorBase(NotEqualOp op); std::pair getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize) { return {index, 1}; } const Properties &getProperties() { return properties; } ::mlir::DictionaryAttr getAttributes() { return odsAttrs; } }; } // namespace detail template class NotEqualOpGenericAdaptor : public detail::NotEqualOpGenericAdaptorBase { using ValueT = ::llvm::detail::ValueOfRange; using Base = detail::NotEqualOpGenericAdaptorBase; static constexpr int odsIndex_lhs = 0; static constexpr int odsIndex_rhs = 1; public: NotEqualOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {} NotEqualOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::PropertyRef properties, ::mlir::RegionRange regions = {}) : NotEqualOpGenericAdaptor(values, attrs, (properties ? *properties.as() : Properties{}), regions) {} NotEqualOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs = nullptr) : NotEqualOpGenericAdaptor(values, attrs, Properties{}, {}) {} NotEqualOpGenericAdaptor(RangeT values, const NotEqualOpGenericAdaptorBase &base) : Base(base), odsOperands(values) {} template >> NotEqualOpGenericAdaptor(RangeT values, LateInst op) : Base(op), odsOperands(values) {} std::pair getODSOperandIndexAndLength(unsigned index) { return Base::getODSOperandIndexAndLength(index, odsOperands.size()); } RangeT getODSOperands(unsigned index) { auto valueRange = getODSOperandIndexAndLength(index); return {std::next(odsOperands.begin(), valueRange.first), std::next(odsOperands.begin(), valueRange.first + valueRange.second)}; } ValueT getLhs() { return (*getODSOperands(0).begin()); } ValueT getRhs() { return (*getODSOperands(1).begin()); } RangeT getOperands() { return odsOperands; } private: RangeT odsOperands; }; class NotEqualOpAdaptor : public NotEqualOpGenericAdaptor<::mlir::ValueRange> { public: using NotEqualOpGenericAdaptor::NotEqualOpGenericAdaptor; NotEqualOpAdaptor(NotEqualOp op); ::llvm::LogicalResult verify(::mlir::Location loc); }; class NotEqualOp : public ::mlir::Op::Impl, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::NOperands<2>::Impl, ::mlir::OpTrait::OpInvariants, ::mlir::ConditionallySpeculatable::Trait, ::mlir::OpTrait::AlwaysSpeculatableImplTrait, ::mlir::MemoryEffectOpInterface::Trait, ::mlir::OpTrait::Elementwise, ::mlir::InferTypeOpInterface::Trait> { public: using Op::Op; using Op::print; using Adaptor = NotEqualOpAdaptor; template using GenericAdaptor = NotEqualOpGenericAdaptor; using FoldAdaptor = GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute>>; static constexpr int odsIndex_lhs = 0; static constexpr int odsIndex_rhs = 1; using Properties = FoldAdaptor::Properties; static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() { return {}; } static constexpr ::llvm::StringLiteral getOperationName() { return ::llvm::StringLiteral("complex.neq"); } std::pair getODSOperandIndexAndLength(unsigned index) { return {index, 1}; } ::mlir::Operation::operand_range getODSOperands(unsigned index) { auto valueRange = getODSOperandIndexAndLength(index); return {std::next(getOperation()->operand_begin(), valueRange.first), std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)}; } ::mlir::TypedValue<::mlir::ComplexType> getLhs() { return ::llvm::cast<::mlir::TypedValue<::mlir::ComplexType>>(*getODSOperands(0).begin()); } ::mlir::TypedValue<::mlir::ComplexType> getRhs() { return ::llvm::cast<::mlir::TypedValue<::mlir::ComplexType>>(*getODSOperands(1).begin()); } ::mlir::OpOperand &getLhsMutable() { auto range = getODSOperandIndexAndLength(0); return getOperation()->getOpOperand(range.first); } ::mlir::OpOperand &getRhsMutable() { auto range = getODSOperandIndexAndLength(1); return getOperation()->getOpOperand(range.first); } std::pair getODSResultIndexAndLength(unsigned index) { return {index, 1}; } ::mlir::Operation::result_range getODSResults(unsigned index) { auto valueRange = getODSResultIndexAndLength(index); return {std::next(getOperation()->result_begin(), valueRange.first), std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)}; } ::mlir::TypedValue<::mlir::IntegerType> getResult() { return ::llvm::cast<::mlir::TypedValue<::mlir::IntegerType>>(*getODSResults(0).begin()); } static ::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); static ::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop); static llvm::hash_code computePropertiesHash(const Properties &prop); static std::optional getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name); static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value); static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs); static ::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs); static NotEqualOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs); static NotEqualOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs); static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value lhs, ::mlir::Value rhs); static NotEqualOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value lhs, ::mlir::Value rhs); static NotEqualOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value lhs, ::mlir::Value rhs); static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs); static NotEqualOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs); static NotEqualOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs); static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); static NotEqualOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); static NotEqualOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); static NotEqualOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); static NotEqualOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); static NotEqualOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); static NotEqualOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); static NotEqualOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); static NotEqualOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); ::llvm::LogicalResult verifyInvariantsImpl(); ::llvm::LogicalResult verifyInvariants(); static ::llvm::LogicalResult inferReturnTypes(::mlir::MLIRContext *context, ::std::optional<::mlir::Location> location, ::mlir::ValueRange operands, ::mlir::DictionaryAttr attributes, ::mlir::PropertyRef properties, ::mlir::RegionRange regions, ::llvm::SmallVectorImpl<::mlir::Type>&inferredReturnTypes); static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result); void print(::mlir::OpAsmPrinter &_odsPrinter); void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects); public: }; } // namespace mlir::complex MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::complex::NotEqualOp) namespace mlir::complex { //===----------------------------------------------------------------------===// // ::mlir::complex::PowOp declarations //===----------------------------------------------------------------------===// namespace detail { class PowOpGenericAdaptorBase { public: struct Properties { using fastmathTy = ::mlir::arith::FastMathFlagsAttr; fastmathTy fastmath; auto getFastmath() const { auto &propStorage = this->fastmath; return ::llvm::dyn_cast_or_null<::mlir::arith::FastMathFlagsAttr>(propStorage); } void setFastmath(const ::mlir::arith::FastMathFlagsAttr &propValue) { this->fastmath = propValue; } bool operator==(const Properties &rhs) const { return rhs.fastmath == this->fastmath && true; } bool operator!=(const Properties &rhs) const { return !(*this == rhs); } }; protected: ::mlir::DictionaryAttr odsAttrs; ::std::optional<::mlir::OperationName> odsOpName; Properties properties; ::mlir::RegionRange odsRegions; public: PowOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : odsAttrs(attrs), properties(properties), odsRegions(regions) { if (odsAttrs) odsOpName.emplace("complex.pow", odsAttrs.getContext()); } PowOpGenericAdaptorBase(PowOp op); std::pair getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize) { return {index, 1}; } const Properties &getProperties() { return properties; } ::mlir::DictionaryAttr getAttributes() { return odsAttrs; } ::mlir::arith::FastMathFlagsAttr getFastmathAttr(); ::mlir::arith::FastMathFlags getFastmath(); }; } // namespace detail template class PowOpGenericAdaptor : public detail::PowOpGenericAdaptorBase { using ValueT = ::llvm::detail::ValueOfRange; using Base = detail::PowOpGenericAdaptorBase; static constexpr int odsIndex_lhs = 0; static constexpr int odsIndex_rhs = 1; public: PowOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {} PowOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::PropertyRef properties, ::mlir::RegionRange regions = {}) : PowOpGenericAdaptor(values, attrs, (properties ? *properties.as() : Properties{}), regions) {} PowOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs = nullptr) : PowOpGenericAdaptor(values, attrs, Properties{}, {}) {} PowOpGenericAdaptor(RangeT values, const PowOpGenericAdaptorBase &base) : Base(base), odsOperands(values) {} template >> PowOpGenericAdaptor(RangeT values, LateInst op) : Base(op), odsOperands(values) {} std::pair getODSOperandIndexAndLength(unsigned index) { return Base::getODSOperandIndexAndLength(index, odsOperands.size()); } RangeT getODSOperands(unsigned index) { auto valueRange = getODSOperandIndexAndLength(index); return {std::next(odsOperands.begin(), valueRange.first), std::next(odsOperands.begin(), valueRange.first + valueRange.second)}; } ValueT getLhs() { return (*getODSOperands(0).begin()); } ValueT getRhs() { return (*getODSOperands(1).begin()); } RangeT getOperands() { return odsOperands; } private: RangeT odsOperands; }; class PowOpAdaptor : public PowOpGenericAdaptor<::mlir::ValueRange> { public: using PowOpGenericAdaptor::PowOpGenericAdaptor; PowOpAdaptor(PowOp op); ::llvm::LogicalResult verify(::mlir::Location loc); }; class PowOp : public ::mlir::Op::Impl, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::NOperands<2>::Impl, ::mlir::OpTrait::OpInvariants, ::mlir::BytecodeOpInterface::Trait, ::mlir::ConditionallySpeculatable::Trait, ::mlir::OpTrait::AlwaysSpeculatableImplTrait, ::mlir::MemoryEffectOpInterface::Trait, ::mlir::OpTrait::SameOperandsAndResultType, ::mlir::OpTrait::Elementwise, ::mlir::arith::ArithFastMathInterface::Trait, ::mlir::InferTypeOpInterface::Trait> { public: using Op::Op; using Op::print; using Adaptor = PowOpAdaptor; template using GenericAdaptor = PowOpGenericAdaptor; using FoldAdaptor = GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute>>; static constexpr int odsIndex_lhs = 0; static constexpr int odsIndex_rhs = 1; using Properties = FoldAdaptor::Properties; using ::mlir::arith::ArithFastMathInterface::Trait::getFastMathFlagsAttr; using ::mlir::arith::ArithFastMathInterface::Trait::getFastMathAttrName; static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() { static ::llvm::StringRef attrNames[] = {::llvm::StringRef("fastmath")}; return ::llvm::ArrayRef(attrNames); } ::mlir::StringAttr getFastmathAttrName() { return getAttributeNameForIndex(0); } static ::mlir::StringAttr getFastmathAttrName(::mlir::OperationName name) { return getAttributeNameForIndex(name, 0); } static constexpr ::llvm::StringLiteral getOperationName() { return ::llvm::StringLiteral("complex.pow"); } std::pair getODSOperandIndexAndLength(unsigned index) { return {index, 1}; } ::mlir::Operation::operand_range getODSOperands(unsigned index) { auto valueRange = getODSOperandIndexAndLength(index); return {std::next(getOperation()->operand_begin(), valueRange.first), std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)}; } ::mlir::TypedValue<::mlir::ComplexType> getLhs() { return ::llvm::cast<::mlir::TypedValue<::mlir::ComplexType>>(*getODSOperands(0).begin()); } ::mlir::TypedValue<::mlir::ComplexType> getRhs() { return ::llvm::cast<::mlir::TypedValue<::mlir::ComplexType>>(*getODSOperands(1).begin()); } ::mlir::OpOperand &getLhsMutable() { auto range = getODSOperandIndexAndLength(0); return getOperation()->getOpOperand(range.first); } ::mlir::OpOperand &getRhsMutable() { auto range = getODSOperandIndexAndLength(1); return getOperation()->getOpOperand(range.first); } std::pair getODSResultIndexAndLength(unsigned index) { return {index, 1}; } ::mlir::Operation::result_range getODSResults(unsigned index) { auto valueRange = getODSResultIndexAndLength(index); return {std::next(getOperation()->result_begin(), valueRange.first), std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)}; } ::mlir::TypedValue<::mlir::ComplexType> getResult() { return ::llvm::cast<::mlir::TypedValue<::mlir::ComplexType>>(*getODSResults(0).begin()); } static ::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); static ::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop); static llvm::hash_code computePropertiesHash(const Properties &prop); static std::optional getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name); static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value); static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs); static ::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); static ::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state); void writeProperties(::mlir::DialectBytecodeWriter &writer); ::mlir::arith::FastMathFlagsAttr getFastmathAttr() { return ::llvm::dyn_cast_or_null<::mlir::arith::FastMathFlagsAttr>(getProperties().fastmath); } ::mlir::arith::FastMathFlags getFastmath(); void setFastmathAttr(::mlir::arith::FastMathFlagsAttr attr) { getProperties().fastmath = attr; } void setFastmath(::mlir::arith::FastMathFlags attrValue); static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlagsAttr fastmath); static PowOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlagsAttr fastmath); static PowOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlagsAttr fastmath); static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlagsAttr fastmath); static PowOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlagsAttr fastmath); static PowOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlagsAttr fastmath); static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlagsAttr fastmath); static PowOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlagsAttr fastmath); static PowOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlagsAttr fastmath); static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); static PowOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); static PowOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); static PowOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); static PowOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); static PowOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); static PowOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); static PowOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); static PowOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); static PowOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); static PowOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); static PowOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); static PowOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); static PowOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); static PowOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); static void populateDefaultProperties(::mlir::OperationName opName, Properties &properties); ::llvm::LogicalResult verifyInvariantsImpl(); ::llvm::LogicalResult verifyInvariants(); static ::llvm::LogicalResult inferReturnTypes(::mlir::MLIRContext *context, ::std::optional<::mlir::Location> location, ::mlir::ValueRange operands, ::mlir::DictionaryAttr attributes, ::mlir::PropertyRef properties, ::mlir::RegionRange regions, ::llvm::SmallVectorImpl<::mlir::Type>&inferredReturnTypes); static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result); void print(::mlir::OpAsmPrinter &_odsPrinter); void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects); private: ::mlir::StringAttr getAttributeNameForIndex(unsigned index) { return getAttributeNameForIndex((*this)->getName(), index); } static ::mlir::StringAttr getAttributeNameForIndex(::mlir::OperationName name, unsigned index) { assert(index < 1 && "invalid attribute index"); assert(name.getStringRef() == getOperationName() && "invalid operation name"); assert(name.isRegistered() && "Operation isn't registered, missing a " "dependent dialect loading?"); return name.getAttributeNames()[index]; } public: }; } // namespace mlir::complex MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::complex::PowOp) MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::complex::detail::PowOpGenericAdaptorBase::Properties) namespace mlir::complex { //===----------------------------------------------------------------------===// // ::mlir::complex::PowiOp declarations //===----------------------------------------------------------------------===// namespace detail { class PowiOpGenericAdaptorBase { public: struct Properties { using fastmathTy = ::mlir::arith::FastMathFlagsAttr; fastmathTy fastmath; auto getFastmath() const { auto &propStorage = this->fastmath; return ::llvm::dyn_cast_or_null<::mlir::arith::FastMathFlagsAttr>(propStorage); } void setFastmath(const ::mlir::arith::FastMathFlagsAttr &propValue) { this->fastmath = propValue; } bool operator==(const Properties &rhs) const { return rhs.fastmath == this->fastmath && true; } bool operator!=(const Properties &rhs) const { return !(*this == rhs); } }; protected: ::mlir::DictionaryAttr odsAttrs; ::std::optional<::mlir::OperationName> odsOpName; Properties properties; ::mlir::RegionRange odsRegions; public: PowiOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : odsAttrs(attrs), properties(properties), odsRegions(regions) { if (odsAttrs) odsOpName.emplace("complex.powi", odsAttrs.getContext()); } PowiOpGenericAdaptorBase(PowiOp op); std::pair getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize) { return {index, 1}; } const Properties &getProperties() { return properties; } ::mlir::DictionaryAttr getAttributes() { return odsAttrs; } ::mlir::arith::FastMathFlagsAttr getFastmathAttr() { auto attr = ::llvm::dyn_cast_or_null<::mlir::arith::FastMathFlagsAttr>(getProperties().fastmath); return attr; } ::std::optional<::mlir::arith::FastMathFlags> getFastmath(); }; } // namespace detail template class PowiOpGenericAdaptor : public detail::PowiOpGenericAdaptorBase { using ValueT = ::llvm::detail::ValueOfRange; using Base = detail::PowiOpGenericAdaptorBase; static constexpr int odsIndex_lhs = 0; static constexpr int odsIndex_rhs = 1; public: PowiOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {} PowiOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::PropertyRef properties, ::mlir::RegionRange regions = {}) : PowiOpGenericAdaptor(values, attrs, (properties ? *properties.as() : Properties{}), regions) {} PowiOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs = nullptr) : PowiOpGenericAdaptor(values, attrs, Properties{}, {}) {} PowiOpGenericAdaptor(RangeT values, const PowiOpGenericAdaptorBase &base) : Base(base), odsOperands(values) {} template >> PowiOpGenericAdaptor(RangeT values, LateInst op) : Base(op), odsOperands(values) {} std::pair getODSOperandIndexAndLength(unsigned index) { return Base::getODSOperandIndexAndLength(index, odsOperands.size()); } RangeT getODSOperands(unsigned index) { auto valueRange = getODSOperandIndexAndLength(index); return {std::next(odsOperands.begin(), valueRange.first), std::next(odsOperands.begin(), valueRange.first + valueRange.second)}; } ValueT getLhs() { return (*getODSOperands(0).begin()); } ValueT getRhs() { return (*getODSOperands(1).begin()); } RangeT getOperands() { return odsOperands; } private: RangeT odsOperands; }; class PowiOpAdaptor : public PowiOpGenericAdaptor<::mlir::ValueRange> { public: using PowiOpGenericAdaptor::PowiOpGenericAdaptor; PowiOpAdaptor(PowiOp op); ::llvm::LogicalResult verify(::mlir::Location loc); }; class PowiOp : public ::mlir::Op::Impl, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::NOperands<2>::Impl, ::mlir::OpTrait::OpInvariants, ::mlir::BytecodeOpInterface::Trait, ::mlir::ConditionallySpeculatable::Trait, ::mlir::OpTrait::AlwaysSpeculatableImplTrait, ::mlir::MemoryEffectOpInterface::Trait, ::mlir::OpTrait::Elementwise, ::mlir::OpTrait::SameOperandsAndResultShape, ::mlir::arith::ArithFastMathInterface::Trait, ::mlir::InferTypeOpInterface::Trait> { public: using Op::Op; using Op::print; using Adaptor = PowiOpAdaptor; template using GenericAdaptor = PowiOpGenericAdaptor; using FoldAdaptor = GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute>>; static constexpr int odsIndex_lhs = 0; static constexpr int odsIndex_rhs = 1; using Properties = FoldAdaptor::Properties; using ::mlir::arith::ArithFastMathInterface::Trait::getFastMathFlagsAttr; using ::mlir::arith::ArithFastMathInterface::Trait::getFastMathAttrName; static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() { static ::llvm::StringRef attrNames[] = {::llvm::StringRef("fastmath")}; return ::llvm::ArrayRef(attrNames); } ::mlir::StringAttr getFastmathAttrName() { return getAttributeNameForIndex(0); } static ::mlir::StringAttr getFastmathAttrName(::mlir::OperationName name) { return getAttributeNameForIndex(name, 0); } static constexpr ::llvm::StringLiteral getOperationName() { return ::llvm::StringLiteral("complex.powi"); } std::pair getODSOperandIndexAndLength(unsigned index) { return {index, 1}; } ::mlir::Operation::operand_range getODSOperands(unsigned index) { auto valueRange = getODSOperandIndexAndLength(index); return {std::next(getOperation()->operand_begin(), valueRange.first), std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)}; } ::mlir::TypedValue<::mlir::ComplexType> getLhs() { return ::llvm::cast<::mlir::TypedValue<::mlir::ComplexType>>(*getODSOperands(0).begin()); } ::mlir::TypedValue<::mlir::IntegerType> getRhs() { return ::llvm::cast<::mlir::TypedValue<::mlir::IntegerType>>(*getODSOperands(1).begin()); } ::mlir::OpOperand &getLhsMutable() { auto range = getODSOperandIndexAndLength(0); return getOperation()->getOpOperand(range.first); } ::mlir::OpOperand &getRhsMutable() { auto range = getODSOperandIndexAndLength(1); return getOperation()->getOpOperand(range.first); } std::pair getODSResultIndexAndLength(unsigned index) { return {index, 1}; } ::mlir::Operation::result_range getODSResults(unsigned index) { auto valueRange = getODSResultIndexAndLength(index); return {std::next(getOperation()->result_begin(), valueRange.first), std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)}; } ::mlir::TypedValue<::mlir::ComplexType> getResult() { return ::llvm::cast<::mlir::TypedValue<::mlir::ComplexType>>(*getODSResults(0).begin()); } static ::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); static ::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop); static llvm::hash_code computePropertiesHash(const Properties &prop); static std::optional getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name); static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value); static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs); static ::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); static ::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state); void writeProperties(::mlir::DialectBytecodeWriter &writer); ::mlir::arith::FastMathFlagsAttr getFastmathAttr() { return ::llvm::dyn_cast_or_null<::mlir::arith::FastMathFlagsAttr>(getProperties().fastmath); } ::std::optional<::mlir::arith::FastMathFlags> getFastmath(); void setFastmathAttr(::mlir::arith::FastMathFlagsAttr attr) { getProperties().fastmath = attr; } void setFastmath(::std::optional<::mlir::arith::FastMathFlags> attrValue); ::mlir::Attribute removeFastmathAttr() { auto attr = getProperties().fastmath; getProperties().fastmath = {}; return attr; } static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs, /*optional*/::mlir::arith::FastMathFlagsAttr fastmath); static PowiOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs, /*optional*/::mlir::arith::FastMathFlagsAttr fastmath); static PowiOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs, /*optional*/::mlir::arith::FastMathFlagsAttr fastmath); static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value lhs, ::mlir::Value rhs, /*optional*/::mlir::arith::FastMathFlagsAttr fastmath); static PowiOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value lhs, ::mlir::Value rhs, /*optional*/::mlir::arith::FastMathFlagsAttr fastmath); static PowiOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value lhs, ::mlir::Value rhs, /*optional*/::mlir::arith::FastMathFlagsAttr fastmath); static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, /*optional*/::mlir::arith::FastMathFlagsAttr fastmath); static PowiOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, /*optional*/::mlir::arith::FastMathFlagsAttr fastmath); static PowiOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, /*optional*/::mlir::arith::FastMathFlagsAttr fastmath); static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); static PowiOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); static PowiOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); static PowiOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); static PowiOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); static PowiOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); static PowiOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); static PowiOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); static PowiOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); ::llvm::LogicalResult verifyInvariantsImpl(); ::llvm::LogicalResult verifyInvariants(); static ::llvm::LogicalResult inferReturnTypes(::mlir::MLIRContext *context, ::std::optional<::mlir::Location> location, ::mlir::ValueRange operands, ::mlir::DictionaryAttr attributes, ::mlir::PropertyRef properties, ::mlir::RegionRange regions, ::llvm::SmallVectorImpl<::mlir::Type>&inferredReturnTypes); static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result); void print(::mlir::OpAsmPrinter &_odsPrinter); void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects); private: ::mlir::StringAttr getAttributeNameForIndex(unsigned index) { return getAttributeNameForIndex((*this)->getName(), index); } static ::mlir::StringAttr getAttributeNameForIndex(::mlir::OperationName name, unsigned index) { assert(index < 1 && "invalid attribute index"); assert(name.getStringRef() == getOperationName() && "invalid operation name"); assert(name.isRegistered() && "Operation isn't registered, missing a " "dependent dialect loading?"); return name.getAttributeNames()[index]; } public: }; } // namespace mlir::complex MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::complex::PowiOp) MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::complex::detail::PowiOpGenericAdaptorBase::Properties) namespace mlir::complex { //===----------------------------------------------------------------------===// // ::mlir::complex::ReOp declarations //===----------------------------------------------------------------------===// namespace detail { class ReOpGenericAdaptorBase { public: struct Properties { using fastmathTy = ::mlir::arith::FastMathFlagsAttr; fastmathTy fastmath; auto getFastmath() const { auto &propStorage = this->fastmath; return ::llvm::dyn_cast_or_null<::mlir::arith::FastMathFlagsAttr>(propStorage); } void setFastmath(const ::mlir::arith::FastMathFlagsAttr &propValue) { this->fastmath = propValue; } bool operator==(const Properties &rhs) const { return rhs.fastmath == this->fastmath && true; } bool operator!=(const Properties &rhs) const { return !(*this == rhs); } }; protected: ::mlir::DictionaryAttr odsAttrs; ::std::optional<::mlir::OperationName> odsOpName; Properties properties; ::mlir::RegionRange odsRegions; public: ReOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : odsAttrs(attrs), properties(properties), odsRegions(regions) { if (odsAttrs) odsOpName.emplace("complex.re", odsAttrs.getContext()); } ReOpGenericAdaptorBase(ReOp op); std::pair getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize) { return {index, 1}; } const Properties &getProperties() { return properties; } ::mlir::DictionaryAttr getAttributes() { return odsAttrs; } ::mlir::arith::FastMathFlagsAttr getFastmathAttr(); ::mlir::arith::FastMathFlags getFastmath(); }; } // namespace detail template class ReOpGenericAdaptor : public detail::ReOpGenericAdaptorBase { using ValueT = ::llvm::detail::ValueOfRange; using Base = detail::ReOpGenericAdaptorBase; static constexpr int odsIndex_complex = 0; public: ReOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {} ReOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::PropertyRef properties, ::mlir::RegionRange regions = {}) : ReOpGenericAdaptor(values, attrs, (properties ? *properties.as() : Properties{}), regions) {} ReOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs = nullptr) : ReOpGenericAdaptor(values, attrs, Properties{}, {}) {} ReOpGenericAdaptor(RangeT values, const ReOpGenericAdaptorBase &base) : Base(base), odsOperands(values) {} template >> ReOpGenericAdaptor(RangeT values, LateInst op) : Base(op), odsOperands(values) {} std::pair getODSOperandIndexAndLength(unsigned index) { return Base::getODSOperandIndexAndLength(index, odsOperands.size()); } RangeT getODSOperands(unsigned index) { auto valueRange = getODSOperandIndexAndLength(index); return {std::next(odsOperands.begin(), valueRange.first), std::next(odsOperands.begin(), valueRange.first + valueRange.second)}; } ValueT getComplex() { return (*getODSOperands(0).begin()); } RangeT getOperands() { return odsOperands; } private: RangeT odsOperands; }; class ReOpAdaptor : public ReOpGenericAdaptor<::mlir::ValueRange> { public: using ReOpGenericAdaptor::ReOpGenericAdaptor; ReOpAdaptor(ReOp op); ::llvm::LogicalResult verify(::mlir::Location loc); }; class ReOp : public ::mlir::Op::Impl, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::OneOperand, ::mlir::OpTrait::OpInvariants, ::mlir::BytecodeOpInterface::Trait, ::mlir::ConditionallySpeculatable::Trait, ::mlir::OpTrait::AlwaysSpeculatableImplTrait, ::mlir::MemoryEffectOpInterface::Trait, ::mlir::OpTrait::Elementwise, ::mlir::arith::ArithFastMathInterface::Trait, ::mlir::InferTypeOpInterface::Trait> { public: using Op::Op; using Op::print; using Adaptor = ReOpAdaptor; template using GenericAdaptor = ReOpGenericAdaptor; using FoldAdaptor = GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute>>; static constexpr int odsIndex_complex = 0; using Properties = FoldAdaptor::Properties; using ::mlir::arith::ArithFastMathInterface::Trait::getFastMathFlagsAttr; using ::mlir::arith::ArithFastMathInterface::Trait::getFastMathAttrName; static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() { static ::llvm::StringRef attrNames[] = {::llvm::StringRef("fastmath")}; return ::llvm::ArrayRef(attrNames); } ::mlir::StringAttr getFastmathAttrName() { return getAttributeNameForIndex(0); } static ::mlir::StringAttr getFastmathAttrName(::mlir::OperationName name) { return getAttributeNameForIndex(name, 0); } static constexpr ::llvm::StringLiteral getOperationName() { return ::llvm::StringLiteral("complex.re"); } std::pair getODSOperandIndexAndLength(unsigned index) { return {index, 1}; } ::mlir::Operation::operand_range getODSOperands(unsigned index) { auto valueRange = getODSOperandIndexAndLength(index); return {std::next(getOperation()->operand_begin(), valueRange.first), std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)}; } ::mlir::TypedValue<::mlir::ComplexType> getComplex() { return ::llvm::cast<::mlir::TypedValue<::mlir::ComplexType>>(*getODSOperands(0).begin()); } ::mlir::OpOperand &getComplexMutable() { auto range = getODSOperandIndexAndLength(0); return getOperation()->getOpOperand(range.first); } std::pair getODSResultIndexAndLength(unsigned index) { return {index, 1}; } ::mlir::Operation::result_range getODSResults(unsigned index) { auto valueRange = getODSResultIndexAndLength(index); return {std::next(getOperation()->result_begin(), valueRange.first), std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)}; } ::mlir::TypedValue<::mlir::FloatType> getReal() { return ::llvm::cast<::mlir::TypedValue<::mlir::FloatType>>(*getODSResults(0).begin()); } static ::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); static ::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop); static llvm::hash_code computePropertiesHash(const Properties &prop); static std::optional getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name); static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value); static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs); static ::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); static ::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state); void writeProperties(::mlir::DialectBytecodeWriter &writer); ::mlir::arith::FastMathFlagsAttr getFastmathAttr() { return ::llvm::dyn_cast_or_null<::mlir::arith::FastMathFlagsAttr>(getProperties().fastmath); } ::mlir::arith::FastMathFlags getFastmath(); void setFastmathAttr(::mlir::arith::FastMathFlagsAttr attr) { getProperties().fastmath = attr; } void setFastmath(::mlir::arith::FastMathFlags attrValue); static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type real, ::mlir::Value complex, ::mlir::arith::FastMathFlagsAttr fastmath); static ReOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type real, ::mlir::Value complex, ::mlir::arith::FastMathFlagsAttr fastmath); static ReOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type real, ::mlir::Value complex, ::mlir::arith::FastMathFlagsAttr fastmath); static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value complex, ::mlir::arith::FastMathFlagsAttr fastmath); static ReOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value complex, ::mlir::arith::FastMathFlagsAttr fastmath); static ReOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value complex, ::mlir::arith::FastMathFlagsAttr fastmath); static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value complex, ::mlir::arith::FastMathFlagsAttr fastmath); static ReOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value complex, ::mlir::arith::FastMathFlagsAttr fastmath); static ReOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value complex, ::mlir::arith::FastMathFlagsAttr fastmath); static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type real, ::mlir::Value complex, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); static ReOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type real, ::mlir::Value complex, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); static ReOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type real, ::mlir::Value complex, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value complex, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); static ReOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value complex, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); static ReOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value complex, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value complex, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); static ReOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value complex, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); static ReOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value complex, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); static ReOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); static ReOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); static ReOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); static ReOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); static ReOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); static ReOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); static ReOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); static ReOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); static void populateDefaultProperties(::mlir::OperationName opName, Properties &properties); ::llvm::LogicalResult verifyInvariantsImpl(); ::llvm::LogicalResult verifyInvariants(); static void getCanonicalizationPatterns(::mlir::RewritePatternSet &results, ::mlir::MLIRContext *context); ::mlir::OpFoldResult fold(FoldAdaptor adaptor); static ::llvm::LogicalResult inferReturnTypes(::mlir::MLIRContext *context, ::std::optional<::mlir::Location> location, ::mlir::ValueRange operands, ::mlir::DictionaryAttr attributes, ::mlir::PropertyRef properties, ::mlir::RegionRange regions, ::llvm::SmallVectorImpl<::mlir::Type>&inferredReturnTypes); static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result); void print(::mlir::OpAsmPrinter &_odsPrinter); void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects); private: ::mlir::StringAttr getAttributeNameForIndex(unsigned index) { return getAttributeNameForIndex((*this)->getName(), index); } static ::mlir::StringAttr getAttributeNameForIndex(::mlir::OperationName name, unsigned index) { assert(index < 1 && "invalid attribute index"); assert(name.getStringRef() == getOperationName() && "invalid operation name"); assert(name.isRegistered() && "Operation isn't registered, missing a " "dependent dialect loading?"); return name.getAttributeNames()[index]; } public: }; } // namespace mlir::complex MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::complex::ReOp) MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::complex::detail::ReOpGenericAdaptorBase::Properties) namespace mlir::complex { //===----------------------------------------------------------------------===// // ::mlir::complex::RsqrtOp declarations //===----------------------------------------------------------------------===// namespace detail { class RsqrtOpGenericAdaptorBase { public: struct Properties { using fastmathTy = ::mlir::arith::FastMathFlagsAttr; fastmathTy fastmath; auto getFastmath() const { auto &propStorage = this->fastmath; return ::llvm::dyn_cast_or_null<::mlir::arith::FastMathFlagsAttr>(propStorage); } void setFastmath(const ::mlir::arith::FastMathFlagsAttr &propValue) { this->fastmath = propValue; } bool operator==(const Properties &rhs) const { return rhs.fastmath == this->fastmath && true; } bool operator!=(const Properties &rhs) const { return !(*this == rhs); } }; protected: ::mlir::DictionaryAttr odsAttrs; ::std::optional<::mlir::OperationName> odsOpName; Properties properties; ::mlir::RegionRange odsRegions; public: RsqrtOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : odsAttrs(attrs), properties(properties), odsRegions(regions) { if (odsAttrs) odsOpName.emplace("complex.rsqrt", odsAttrs.getContext()); } RsqrtOpGenericAdaptorBase(RsqrtOp op); std::pair getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize) { return {index, 1}; } const Properties &getProperties() { return properties; } ::mlir::DictionaryAttr getAttributes() { return odsAttrs; } ::mlir::arith::FastMathFlagsAttr getFastmathAttr(); ::mlir::arith::FastMathFlags getFastmath(); }; } // namespace detail template class RsqrtOpGenericAdaptor : public detail::RsqrtOpGenericAdaptorBase { using ValueT = ::llvm::detail::ValueOfRange; using Base = detail::RsqrtOpGenericAdaptorBase; static constexpr int odsIndex_complex = 0; public: RsqrtOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {} RsqrtOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::PropertyRef properties, ::mlir::RegionRange regions = {}) : RsqrtOpGenericAdaptor(values, attrs, (properties ? *properties.as() : Properties{}), regions) {} RsqrtOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs = nullptr) : RsqrtOpGenericAdaptor(values, attrs, Properties{}, {}) {} RsqrtOpGenericAdaptor(RangeT values, const RsqrtOpGenericAdaptorBase &base) : Base(base), odsOperands(values) {} template >> RsqrtOpGenericAdaptor(RangeT values, LateInst op) : Base(op), odsOperands(values) {} std::pair getODSOperandIndexAndLength(unsigned index) { return Base::getODSOperandIndexAndLength(index, odsOperands.size()); } RangeT getODSOperands(unsigned index) { auto valueRange = getODSOperandIndexAndLength(index); return {std::next(odsOperands.begin(), valueRange.first), std::next(odsOperands.begin(), valueRange.first + valueRange.second)}; } ValueT getComplex() { return (*getODSOperands(0).begin()); } RangeT getOperands() { return odsOperands; } private: RangeT odsOperands; }; class RsqrtOpAdaptor : public RsqrtOpGenericAdaptor<::mlir::ValueRange> { public: using RsqrtOpGenericAdaptor::RsqrtOpGenericAdaptor; RsqrtOpAdaptor(RsqrtOp op); ::llvm::LogicalResult verify(::mlir::Location loc); }; class RsqrtOp : public ::mlir::Op::Impl, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::OneOperand, ::mlir::OpTrait::OpInvariants, ::mlir::BytecodeOpInterface::Trait, ::mlir::OpTrait::SameOperandsAndResultType, ::mlir::ConditionallySpeculatable::Trait, ::mlir::OpTrait::AlwaysSpeculatableImplTrait, ::mlir::MemoryEffectOpInterface::Trait, ::mlir::OpTrait::Elementwise, ::mlir::arith::ArithFastMathInterface::Trait, ::mlir::InferTypeOpInterface::Trait> { public: using Op::Op; using Op::print; using Adaptor = RsqrtOpAdaptor; template using GenericAdaptor = RsqrtOpGenericAdaptor; using FoldAdaptor = GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute>>; static constexpr int odsIndex_complex = 0; using Properties = FoldAdaptor::Properties; using ::mlir::arith::ArithFastMathInterface::Trait::getFastMathFlagsAttr; using ::mlir::arith::ArithFastMathInterface::Trait::getFastMathAttrName; static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() { static ::llvm::StringRef attrNames[] = {::llvm::StringRef("fastmath")}; return ::llvm::ArrayRef(attrNames); } ::mlir::StringAttr getFastmathAttrName() { return getAttributeNameForIndex(0); } static ::mlir::StringAttr getFastmathAttrName(::mlir::OperationName name) { return getAttributeNameForIndex(name, 0); } static constexpr ::llvm::StringLiteral getOperationName() { return ::llvm::StringLiteral("complex.rsqrt"); } std::pair getODSOperandIndexAndLength(unsigned index) { return {index, 1}; } ::mlir::Operation::operand_range getODSOperands(unsigned index) { auto valueRange = getODSOperandIndexAndLength(index); return {std::next(getOperation()->operand_begin(), valueRange.first), std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)}; } ::mlir::TypedValue<::mlir::ComplexType> getComplex() { return ::llvm::cast<::mlir::TypedValue<::mlir::ComplexType>>(*getODSOperands(0).begin()); } ::mlir::OpOperand &getComplexMutable() { auto range = getODSOperandIndexAndLength(0); return getOperation()->getOpOperand(range.first); } std::pair getODSResultIndexAndLength(unsigned index) { return {index, 1}; } ::mlir::Operation::result_range getODSResults(unsigned index) { auto valueRange = getODSResultIndexAndLength(index); return {std::next(getOperation()->result_begin(), valueRange.first), std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)}; } ::mlir::TypedValue<::mlir::ComplexType> getResult() { return ::llvm::cast<::mlir::TypedValue<::mlir::ComplexType>>(*getODSResults(0).begin()); } static ::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); static ::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop); static llvm::hash_code computePropertiesHash(const Properties &prop); static std::optional getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name); static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value); static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs); static ::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); static ::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state); void writeProperties(::mlir::DialectBytecodeWriter &writer); ::mlir::arith::FastMathFlagsAttr getFastmathAttr() { return ::llvm::dyn_cast_or_null<::mlir::arith::FastMathFlagsAttr>(getProperties().fastmath); } ::mlir::arith::FastMathFlags getFastmath(); void setFastmathAttr(::mlir::arith::FastMathFlagsAttr attr) { getProperties().fastmath = attr; } void setFastmath(::mlir::arith::FastMathFlags attrValue); static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value complex, ::mlir::arith::FastMathFlagsAttr fastmath); static RsqrtOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::Value complex, ::mlir::arith::FastMathFlagsAttr fastmath); static RsqrtOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type result, ::mlir::Value complex, ::mlir::arith::FastMathFlagsAttr fastmath); static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value complex, ::mlir::arith::FastMathFlagsAttr fastmath); static RsqrtOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value complex, ::mlir::arith::FastMathFlagsAttr fastmath); static RsqrtOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value complex, ::mlir::arith::FastMathFlagsAttr fastmath); static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value complex, ::mlir::arith::FastMathFlagsAttr fastmath); static RsqrtOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value complex, ::mlir::arith::FastMathFlagsAttr fastmath); static RsqrtOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value complex, ::mlir::arith::FastMathFlagsAttr fastmath); static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value complex, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); static RsqrtOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::Value complex, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); static RsqrtOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type result, ::mlir::Value complex, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value complex, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); static RsqrtOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value complex, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); static RsqrtOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value complex, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value complex, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); static RsqrtOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value complex, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); static RsqrtOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value complex, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); static RsqrtOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); static RsqrtOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); static RsqrtOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); static RsqrtOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); static RsqrtOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); static RsqrtOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); static RsqrtOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); static RsqrtOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); static void populateDefaultProperties(::mlir::OperationName opName, Properties &properties); ::llvm::LogicalResult verifyInvariantsImpl(); ::llvm::LogicalResult verifyInvariants(); static ::llvm::LogicalResult inferReturnTypes(::mlir::MLIRContext *context, ::std::optional<::mlir::Location> location, ::mlir::ValueRange operands, ::mlir::DictionaryAttr attributes, ::mlir::PropertyRef properties, ::mlir::RegionRange regions, ::llvm::SmallVectorImpl<::mlir::Type>&inferredReturnTypes); static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result); void print(::mlir::OpAsmPrinter &_odsPrinter); void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects); private: ::mlir::StringAttr getAttributeNameForIndex(unsigned index) { return getAttributeNameForIndex((*this)->getName(), index); } static ::mlir::StringAttr getAttributeNameForIndex(::mlir::OperationName name, unsigned index) { assert(index < 1 && "invalid attribute index"); assert(name.getStringRef() == getOperationName() && "invalid operation name"); assert(name.isRegistered() && "Operation isn't registered, missing a " "dependent dialect loading?"); return name.getAttributeNames()[index]; } public: }; } // namespace mlir::complex MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::complex::RsqrtOp) MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::complex::detail::RsqrtOpGenericAdaptorBase::Properties) namespace mlir::complex { //===----------------------------------------------------------------------===// // ::mlir::complex::SignOp declarations //===----------------------------------------------------------------------===// namespace detail { class SignOpGenericAdaptorBase { public: struct Properties { using fastmathTy = ::mlir::arith::FastMathFlagsAttr; fastmathTy fastmath; auto getFastmath() const { auto &propStorage = this->fastmath; return ::llvm::dyn_cast_or_null<::mlir::arith::FastMathFlagsAttr>(propStorage); } void setFastmath(const ::mlir::arith::FastMathFlagsAttr &propValue) { this->fastmath = propValue; } bool operator==(const Properties &rhs) const { return rhs.fastmath == this->fastmath && true; } bool operator!=(const Properties &rhs) const { return !(*this == rhs); } }; protected: ::mlir::DictionaryAttr odsAttrs; ::std::optional<::mlir::OperationName> odsOpName; Properties properties; ::mlir::RegionRange odsRegions; public: SignOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : odsAttrs(attrs), properties(properties), odsRegions(regions) { if (odsAttrs) odsOpName.emplace("complex.sign", odsAttrs.getContext()); } SignOpGenericAdaptorBase(SignOp op); std::pair getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize) { return {index, 1}; } const Properties &getProperties() { return properties; } ::mlir::DictionaryAttr getAttributes() { return odsAttrs; } ::mlir::arith::FastMathFlagsAttr getFastmathAttr(); ::mlir::arith::FastMathFlags getFastmath(); }; } // namespace detail template class SignOpGenericAdaptor : public detail::SignOpGenericAdaptorBase { using ValueT = ::llvm::detail::ValueOfRange; using Base = detail::SignOpGenericAdaptorBase; static constexpr int odsIndex_complex = 0; public: SignOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {} SignOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::PropertyRef properties, ::mlir::RegionRange regions = {}) : SignOpGenericAdaptor(values, attrs, (properties ? *properties.as() : Properties{}), regions) {} SignOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs = nullptr) : SignOpGenericAdaptor(values, attrs, Properties{}, {}) {} SignOpGenericAdaptor(RangeT values, const SignOpGenericAdaptorBase &base) : Base(base), odsOperands(values) {} template >> SignOpGenericAdaptor(RangeT values, LateInst op) : Base(op), odsOperands(values) {} std::pair getODSOperandIndexAndLength(unsigned index) { return Base::getODSOperandIndexAndLength(index, odsOperands.size()); } RangeT getODSOperands(unsigned index) { auto valueRange = getODSOperandIndexAndLength(index); return {std::next(odsOperands.begin(), valueRange.first), std::next(odsOperands.begin(), valueRange.first + valueRange.second)}; } ValueT getComplex() { return (*getODSOperands(0).begin()); } RangeT getOperands() { return odsOperands; } private: RangeT odsOperands; }; class SignOpAdaptor : public SignOpGenericAdaptor<::mlir::ValueRange> { public: using SignOpGenericAdaptor::SignOpGenericAdaptor; SignOpAdaptor(SignOp op); ::llvm::LogicalResult verify(::mlir::Location loc); }; class SignOp : public ::mlir::Op::Impl, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::OneOperand, ::mlir::OpTrait::OpInvariants, ::mlir::BytecodeOpInterface::Trait, ::mlir::OpTrait::SameOperandsAndResultType, ::mlir::ConditionallySpeculatable::Trait, ::mlir::OpTrait::AlwaysSpeculatableImplTrait, ::mlir::MemoryEffectOpInterface::Trait, ::mlir::OpTrait::Elementwise, ::mlir::arith::ArithFastMathInterface::Trait, ::mlir::InferTypeOpInterface::Trait> { public: using Op::Op; using Op::print; using Adaptor = SignOpAdaptor; template using GenericAdaptor = SignOpGenericAdaptor; using FoldAdaptor = GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute>>; static constexpr int odsIndex_complex = 0; using Properties = FoldAdaptor::Properties; using ::mlir::arith::ArithFastMathInterface::Trait::getFastMathFlagsAttr; using ::mlir::arith::ArithFastMathInterface::Trait::getFastMathAttrName; static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() { static ::llvm::StringRef attrNames[] = {::llvm::StringRef("fastmath")}; return ::llvm::ArrayRef(attrNames); } ::mlir::StringAttr getFastmathAttrName() { return getAttributeNameForIndex(0); } static ::mlir::StringAttr getFastmathAttrName(::mlir::OperationName name) { return getAttributeNameForIndex(name, 0); } static constexpr ::llvm::StringLiteral getOperationName() { return ::llvm::StringLiteral("complex.sign"); } std::pair getODSOperandIndexAndLength(unsigned index) { return {index, 1}; } ::mlir::Operation::operand_range getODSOperands(unsigned index) { auto valueRange = getODSOperandIndexAndLength(index); return {std::next(getOperation()->operand_begin(), valueRange.first), std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)}; } ::mlir::TypedValue<::mlir::ComplexType> getComplex() { return ::llvm::cast<::mlir::TypedValue<::mlir::ComplexType>>(*getODSOperands(0).begin()); } ::mlir::OpOperand &getComplexMutable() { auto range = getODSOperandIndexAndLength(0); return getOperation()->getOpOperand(range.first); } std::pair getODSResultIndexAndLength(unsigned index) { return {index, 1}; } ::mlir::Operation::result_range getODSResults(unsigned index) { auto valueRange = getODSResultIndexAndLength(index); return {std::next(getOperation()->result_begin(), valueRange.first), std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)}; } ::mlir::TypedValue<::mlir::ComplexType> getResult() { return ::llvm::cast<::mlir::TypedValue<::mlir::ComplexType>>(*getODSResults(0).begin()); } static ::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); static ::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop); static llvm::hash_code computePropertiesHash(const Properties &prop); static std::optional getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name); static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value); static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs); static ::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); static ::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state); void writeProperties(::mlir::DialectBytecodeWriter &writer); ::mlir::arith::FastMathFlagsAttr getFastmathAttr() { return ::llvm::dyn_cast_or_null<::mlir::arith::FastMathFlagsAttr>(getProperties().fastmath); } ::mlir::arith::FastMathFlags getFastmath(); void setFastmathAttr(::mlir::arith::FastMathFlagsAttr attr) { getProperties().fastmath = attr; } void setFastmath(::mlir::arith::FastMathFlags attrValue); static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value complex, ::mlir::arith::FastMathFlagsAttr fastmath); static SignOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::Value complex, ::mlir::arith::FastMathFlagsAttr fastmath); static SignOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type result, ::mlir::Value complex, ::mlir::arith::FastMathFlagsAttr fastmath); static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value complex, ::mlir::arith::FastMathFlagsAttr fastmath); static SignOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value complex, ::mlir::arith::FastMathFlagsAttr fastmath); static SignOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value complex, ::mlir::arith::FastMathFlagsAttr fastmath); static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value complex, ::mlir::arith::FastMathFlagsAttr fastmath); static SignOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value complex, ::mlir::arith::FastMathFlagsAttr fastmath); static SignOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value complex, ::mlir::arith::FastMathFlagsAttr fastmath); static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value complex, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); static SignOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::Value complex, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); static SignOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type result, ::mlir::Value complex, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value complex, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); static SignOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value complex, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); static SignOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value complex, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value complex, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); static SignOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value complex, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); static SignOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value complex, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); static SignOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); static SignOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); static SignOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); static SignOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); static SignOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); static SignOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); static SignOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); static SignOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); static void populateDefaultProperties(::mlir::OperationName opName, Properties &properties); ::llvm::LogicalResult verifyInvariantsImpl(); ::llvm::LogicalResult verifyInvariants(); static ::llvm::LogicalResult inferReturnTypes(::mlir::MLIRContext *context, ::std::optional<::mlir::Location> location, ::mlir::ValueRange operands, ::mlir::DictionaryAttr attributes, ::mlir::PropertyRef properties, ::mlir::RegionRange regions, ::llvm::SmallVectorImpl<::mlir::Type>&inferredReturnTypes); static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result); void print(::mlir::OpAsmPrinter &_odsPrinter); void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects); private: ::mlir::StringAttr getAttributeNameForIndex(unsigned index) { return getAttributeNameForIndex((*this)->getName(), index); } static ::mlir::StringAttr getAttributeNameForIndex(::mlir::OperationName name, unsigned index) { assert(index < 1 && "invalid attribute index"); assert(name.getStringRef() == getOperationName() && "invalid operation name"); assert(name.isRegistered() && "Operation isn't registered, missing a " "dependent dialect loading?"); return name.getAttributeNames()[index]; } public: }; } // namespace mlir::complex MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::complex::SignOp) MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::complex::detail::SignOpGenericAdaptorBase::Properties) namespace mlir::complex { //===----------------------------------------------------------------------===// // ::mlir::complex::SinOp declarations //===----------------------------------------------------------------------===// namespace detail { class SinOpGenericAdaptorBase { public: struct Properties { using fastmathTy = ::mlir::arith::FastMathFlagsAttr; fastmathTy fastmath; auto getFastmath() const { auto &propStorage = this->fastmath; return ::llvm::dyn_cast_or_null<::mlir::arith::FastMathFlagsAttr>(propStorage); } void setFastmath(const ::mlir::arith::FastMathFlagsAttr &propValue) { this->fastmath = propValue; } bool operator==(const Properties &rhs) const { return rhs.fastmath == this->fastmath && true; } bool operator!=(const Properties &rhs) const { return !(*this == rhs); } }; protected: ::mlir::DictionaryAttr odsAttrs; ::std::optional<::mlir::OperationName> odsOpName; Properties properties; ::mlir::RegionRange odsRegions; public: SinOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : odsAttrs(attrs), properties(properties), odsRegions(regions) { if (odsAttrs) odsOpName.emplace("complex.sin", odsAttrs.getContext()); } SinOpGenericAdaptorBase(SinOp op); std::pair getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize) { return {index, 1}; } const Properties &getProperties() { return properties; } ::mlir::DictionaryAttr getAttributes() { return odsAttrs; } ::mlir::arith::FastMathFlagsAttr getFastmathAttr(); ::mlir::arith::FastMathFlags getFastmath(); }; } // namespace detail template class SinOpGenericAdaptor : public detail::SinOpGenericAdaptorBase { using ValueT = ::llvm::detail::ValueOfRange; using Base = detail::SinOpGenericAdaptorBase; static constexpr int odsIndex_complex = 0; public: SinOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {} SinOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::PropertyRef properties, ::mlir::RegionRange regions = {}) : SinOpGenericAdaptor(values, attrs, (properties ? *properties.as() : Properties{}), regions) {} SinOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs = nullptr) : SinOpGenericAdaptor(values, attrs, Properties{}, {}) {} SinOpGenericAdaptor(RangeT values, const SinOpGenericAdaptorBase &base) : Base(base), odsOperands(values) {} template >> SinOpGenericAdaptor(RangeT values, LateInst op) : Base(op), odsOperands(values) {} std::pair getODSOperandIndexAndLength(unsigned index) { return Base::getODSOperandIndexAndLength(index, odsOperands.size()); } RangeT getODSOperands(unsigned index) { auto valueRange = getODSOperandIndexAndLength(index); return {std::next(odsOperands.begin(), valueRange.first), std::next(odsOperands.begin(), valueRange.first + valueRange.second)}; } ValueT getComplex() { return (*getODSOperands(0).begin()); } RangeT getOperands() { return odsOperands; } private: RangeT odsOperands; }; class SinOpAdaptor : public SinOpGenericAdaptor<::mlir::ValueRange> { public: using SinOpGenericAdaptor::SinOpGenericAdaptor; SinOpAdaptor(SinOp op); ::llvm::LogicalResult verify(::mlir::Location loc); }; class SinOp : public ::mlir::Op::Impl, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::OneOperand, ::mlir::OpTrait::OpInvariants, ::mlir::BytecodeOpInterface::Trait, ::mlir::OpTrait::SameOperandsAndResultType, ::mlir::ConditionallySpeculatable::Trait, ::mlir::OpTrait::AlwaysSpeculatableImplTrait, ::mlir::MemoryEffectOpInterface::Trait, ::mlir::OpTrait::Elementwise, ::mlir::arith::ArithFastMathInterface::Trait, ::mlir::InferTypeOpInterface::Trait> { public: using Op::Op; using Op::print; using Adaptor = SinOpAdaptor; template using GenericAdaptor = SinOpGenericAdaptor; using FoldAdaptor = GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute>>; static constexpr int odsIndex_complex = 0; using Properties = FoldAdaptor::Properties; using ::mlir::arith::ArithFastMathInterface::Trait::getFastMathFlagsAttr; using ::mlir::arith::ArithFastMathInterface::Trait::getFastMathAttrName; static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() { static ::llvm::StringRef attrNames[] = {::llvm::StringRef("fastmath")}; return ::llvm::ArrayRef(attrNames); } ::mlir::StringAttr getFastmathAttrName() { return getAttributeNameForIndex(0); } static ::mlir::StringAttr getFastmathAttrName(::mlir::OperationName name) { return getAttributeNameForIndex(name, 0); } static constexpr ::llvm::StringLiteral getOperationName() { return ::llvm::StringLiteral("complex.sin"); } std::pair getODSOperandIndexAndLength(unsigned index) { return {index, 1}; } ::mlir::Operation::operand_range getODSOperands(unsigned index) { auto valueRange = getODSOperandIndexAndLength(index); return {std::next(getOperation()->operand_begin(), valueRange.first), std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)}; } ::mlir::TypedValue<::mlir::ComplexType> getComplex() { return ::llvm::cast<::mlir::TypedValue<::mlir::ComplexType>>(*getODSOperands(0).begin()); } ::mlir::OpOperand &getComplexMutable() { auto range = getODSOperandIndexAndLength(0); return getOperation()->getOpOperand(range.first); } std::pair getODSResultIndexAndLength(unsigned index) { return {index, 1}; } ::mlir::Operation::result_range getODSResults(unsigned index) { auto valueRange = getODSResultIndexAndLength(index); return {std::next(getOperation()->result_begin(), valueRange.first), std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)}; } ::mlir::TypedValue<::mlir::ComplexType> getResult() { return ::llvm::cast<::mlir::TypedValue<::mlir::ComplexType>>(*getODSResults(0).begin()); } static ::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); static ::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop); static llvm::hash_code computePropertiesHash(const Properties &prop); static std::optional getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name); static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value); static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs); static ::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); static ::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state); void writeProperties(::mlir::DialectBytecodeWriter &writer); ::mlir::arith::FastMathFlagsAttr getFastmathAttr() { return ::llvm::dyn_cast_or_null<::mlir::arith::FastMathFlagsAttr>(getProperties().fastmath); } ::mlir::arith::FastMathFlags getFastmath(); void setFastmathAttr(::mlir::arith::FastMathFlagsAttr attr) { getProperties().fastmath = attr; } void setFastmath(::mlir::arith::FastMathFlags attrValue); static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value complex, ::mlir::arith::FastMathFlagsAttr fastmath); static SinOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::Value complex, ::mlir::arith::FastMathFlagsAttr fastmath); static SinOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type result, ::mlir::Value complex, ::mlir::arith::FastMathFlagsAttr fastmath); static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value complex, ::mlir::arith::FastMathFlagsAttr fastmath); static SinOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value complex, ::mlir::arith::FastMathFlagsAttr fastmath); static SinOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value complex, ::mlir::arith::FastMathFlagsAttr fastmath); static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value complex, ::mlir::arith::FastMathFlagsAttr fastmath); static SinOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value complex, ::mlir::arith::FastMathFlagsAttr fastmath); static SinOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value complex, ::mlir::arith::FastMathFlagsAttr fastmath); static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value complex, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); static SinOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::Value complex, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); static SinOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type result, ::mlir::Value complex, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value complex, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); static SinOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value complex, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); static SinOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value complex, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value complex, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); static SinOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value complex, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); static SinOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value complex, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); static SinOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); static SinOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); static SinOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); static SinOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); static SinOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); static SinOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); static SinOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); static SinOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); static void populateDefaultProperties(::mlir::OperationName opName, Properties &properties); ::llvm::LogicalResult verifyInvariantsImpl(); ::llvm::LogicalResult verifyInvariants(); static ::llvm::LogicalResult inferReturnTypes(::mlir::MLIRContext *context, ::std::optional<::mlir::Location> location, ::mlir::ValueRange operands, ::mlir::DictionaryAttr attributes, ::mlir::PropertyRef properties, ::mlir::RegionRange regions, ::llvm::SmallVectorImpl<::mlir::Type>&inferredReturnTypes); static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result); void print(::mlir::OpAsmPrinter &_odsPrinter); void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects); private: ::mlir::StringAttr getAttributeNameForIndex(unsigned index) { return getAttributeNameForIndex((*this)->getName(), index); } static ::mlir::StringAttr getAttributeNameForIndex(::mlir::OperationName name, unsigned index) { assert(index < 1 && "invalid attribute index"); assert(name.getStringRef() == getOperationName() && "invalid operation name"); assert(name.isRegistered() && "Operation isn't registered, missing a " "dependent dialect loading?"); return name.getAttributeNames()[index]; } public: }; } // namespace mlir::complex MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::complex::SinOp) MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::complex::detail::SinOpGenericAdaptorBase::Properties) namespace mlir::complex { //===----------------------------------------------------------------------===// // ::mlir::complex::SqrtOp declarations //===----------------------------------------------------------------------===// namespace detail { class SqrtOpGenericAdaptorBase { public: struct Properties { using fastmathTy = ::mlir::arith::FastMathFlagsAttr; fastmathTy fastmath; auto getFastmath() const { auto &propStorage = this->fastmath; return ::llvm::dyn_cast_or_null<::mlir::arith::FastMathFlagsAttr>(propStorage); } void setFastmath(const ::mlir::arith::FastMathFlagsAttr &propValue) { this->fastmath = propValue; } bool operator==(const Properties &rhs) const { return rhs.fastmath == this->fastmath && true; } bool operator!=(const Properties &rhs) const { return !(*this == rhs); } }; protected: ::mlir::DictionaryAttr odsAttrs; ::std::optional<::mlir::OperationName> odsOpName; Properties properties; ::mlir::RegionRange odsRegions; public: SqrtOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : odsAttrs(attrs), properties(properties), odsRegions(regions) { if (odsAttrs) odsOpName.emplace("complex.sqrt", odsAttrs.getContext()); } SqrtOpGenericAdaptorBase(SqrtOp op); std::pair getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize) { return {index, 1}; } const Properties &getProperties() { return properties; } ::mlir::DictionaryAttr getAttributes() { return odsAttrs; } ::mlir::arith::FastMathFlagsAttr getFastmathAttr(); ::mlir::arith::FastMathFlags getFastmath(); }; } // namespace detail template class SqrtOpGenericAdaptor : public detail::SqrtOpGenericAdaptorBase { using ValueT = ::llvm::detail::ValueOfRange; using Base = detail::SqrtOpGenericAdaptorBase; static constexpr int odsIndex_complex = 0; public: SqrtOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {} SqrtOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::PropertyRef properties, ::mlir::RegionRange regions = {}) : SqrtOpGenericAdaptor(values, attrs, (properties ? *properties.as() : Properties{}), regions) {} SqrtOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs = nullptr) : SqrtOpGenericAdaptor(values, attrs, Properties{}, {}) {} SqrtOpGenericAdaptor(RangeT values, const SqrtOpGenericAdaptorBase &base) : Base(base), odsOperands(values) {} template >> SqrtOpGenericAdaptor(RangeT values, LateInst op) : Base(op), odsOperands(values) {} std::pair getODSOperandIndexAndLength(unsigned index) { return Base::getODSOperandIndexAndLength(index, odsOperands.size()); } RangeT getODSOperands(unsigned index) { auto valueRange = getODSOperandIndexAndLength(index); return {std::next(odsOperands.begin(), valueRange.first), std::next(odsOperands.begin(), valueRange.first + valueRange.second)}; } ValueT getComplex() { return (*getODSOperands(0).begin()); } RangeT getOperands() { return odsOperands; } private: RangeT odsOperands; }; class SqrtOpAdaptor : public SqrtOpGenericAdaptor<::mlir::ValueRange> { public: using SqrtOpGenericAdaptor::SqrtOpGenericAdaptor; SqrtOpAdaptor(SqrtOp op); ::llvm::LogicalResult verify(::mlir::Location loc); }; class SqrtOp : public ::mlir::Op::Impl, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::OneOperand, ::mlir::OpTrait::OpInvariants, ::mlir::BytecodeOpInterface::Trait, ::mlir::OpTrait::SameOperandsAndResultType, ::mlir::ConditionallySpeculatable::Trait, ::mlir::OpTrait::AlwaysSpeculatableImplTrait, ::mlir::MemoryEffectOpInterface::Trait, ::mlir::OpTrait::Elementwise, ::mlir::arith::ArithFastMathInterface::Trait, ::mlir::InferTypeOpInterface::Trait> { public: using Op::Op; using Op::print; using Adaptor = SqrtOpAdaptor; template using GenericAdaptor = SqrtOpGenericAdaptor; using FoldAdaptor = GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute>>; static constexpr int odsIndex_complex = 0; using Properties = FoldAdaptor::Properties; using ::mlir::arith::ArithFastMathInterface::Trait::getFastMathFlagsAttr; using ::mlir::arith::ArithFastMathInterface::Trait::getFastMathAttrName; static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() { static ::llvm::StringRef attrNames[] = {::llvm::StringRef("fastmath")}; return ::llvm::ArrayRef(attrNames); } ::mlir::StringAttr getFastmathAttrName() { return getAttributeNameForIndex(0); } static ::mlir::StringAttr getFastmathAttrName(::mlir::OperationName name) { return getAttributeNameForIndex(name, 0); } static constexpr ::llvm::StringLiteral getOperationName() { return ::llvm::StringLiteral("complex.sqrt"); } std::pair getODSOperandIndexAndLength(unsigned index) { return {index, 1}; } ::mlir::Operation::operand_range getODSOperands(unsigned index) { auto valueRange = getODSOperandIndexAndLength(index); return {std::next(getOperation()->operand_begin(), valueRange.first), std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)}; } ::mlir::TypedValue<::mlir::ComplexType> getComplex() { return ::llvm::cast<::mlir::TypedValue<::mlir::ComplexType>>(*getODSOperands(0).begin()); } ::mlir::OpOperand &getComplexMutable() { auto range = getODSOperandIndexAndLength(0); return getOperation()->getOpOperand(range.first); } std::pair getODSResultIndexAndLength(unsigned index) { return {index, 1}; } ::mlir::Operation::result_range getODSResults(unsigned index) { auto valueRange = getODSResultIndexAndLength(index); return {std::next(getOperation()->result_begin(), valueRange.first), std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)}; } ::mlir::TypedValue<::mlir::ComplexType> getResult() { return ::llvm::cast<::mlir::TypedValue<::mlir::ComplexType>>(*getODSResults(0).begin()); } static ::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); static ::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop); static llvm::hash_code computePropertiesHash(const Properties &prop); static std::optional getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name); static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value); static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs); static ::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); static ::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state); void writeProperties(::mlir::DialectBytecodeWriter &writer); ::mlir::arith::FastMathFlagsAttr getFastmathAttr() { return ::llvm::dyn_cast_or_null<::mlir::arith::FastMathFlagsAttr>(getProperties().fastmath); } ::mlir::arith::FastMathFlags getFastmath(); void setFastmathAttr(::mlir::arith::FastMathFlagsAttr attr) { getProperties().fastmath = attr; } void setFastmath(::mlir::arith::FastMathFlags attrValue); static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value complex, ::mlir::arith::FastMathFlagsAttr fastmath); static SqrtOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::Value complex, ::mlir::arith::FastMathFlagsAttr fastmath); static SqrtOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type result, ::mlir::Value complex, ::mlir::arith::FastMathFlagsAttr fastmath); static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value complex, ::mlir::arith::FastMathFlagsAttr fastmath); static SqrtOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value complex, ::mlir::arith::FastMathFlagsAttr fastmath); static SqrtOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value complex, ::mlir::arith::FastMathFlagsAttr fastmath); static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value complex, ::mlir::arith::FastMathFlagsAttr fastmath); static SqrtOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value complex, ::mlir::arith::FastMathFlagsAttr fastmath); static SqrtOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value complex, ::mlir::arith::FastMathFlagsAttr fastmath); static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value complex, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); static SqrtOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::Value complex, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); static SqrtOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type result, ::mlir::Value complex, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value complex, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); static SqrtOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value complex, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); static SqrtOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value complex, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value complex, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); static SqrtOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value complex, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); static SqrtOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value complex, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); static SqrtOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); static SqrtOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); static SqrtOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); static SqrtOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); static SqrtOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); static SqrtOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); static SqrtOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); static SqrtOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); static void populateDefaultProperties(::mlir::OperationName opName, Properties &properties); ::llvm::LogicalResult verifyInvariantsImpl(); ::llvm::LogicalResult verifyInvariants(); static ::llvm::LogicalResult inferReturnTypes(::mlir::MLIRContext *context, ::std::optional<::mlir::Location> location, ::mlir::ValueRange operands, ::mlir::DictionaryAttr attributes, ::mlir::PropertyRef properties, ::mlir::RegionRange regions, ::llvm::SmallVectorImpl<::mlir::Type>&inferredReturnTypes); static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result); void print(::mlir::OpAsmPrinter &_odsPrinter); void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects); private: ::mlir::StringAttr getAttributeNameForIndex(unsigned index) { return getAttributeNameForIndex((*this)->getName(), index); } static ::mlir::StringAttr getAttributeNameForIndex(::mlir::OperationName name, unsigned index) { assert(index < 1 && "invalid attribute index"); assert(name.getStringRef() == getOperationName() && "invalid operation name"); assert(name.isRegistered() && "Operation isn't registered, missing a " "dependent dialect loading?"); return name.getAttributeNames()[index]; } public: }; } // namespace mlir::complex MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::complex::SqrtOp) MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::complex::detail::SqrtOpGenericAdaptorBase::Properties) namespace mlir::complex { //===----------------------------------------------------------------------===// // ::mlir::complex::SubOp declarations //===----------------------------------------------------------------------===// namespace detail { class SubOpGenericAdaptorBase { public: struct Properties { using fastmathTy = ::mlir::arith::FastMathFlagsAttr; fastmathTy fastmath; auto getFastmath() const { auto &propStorage = this->fastmath; return ::llvm::dyn_cast_or_null<::mlir::arith::FastMathFlagsAttr>(propStorage); } void setFastmath(const ::mlir::arith::FastMathFlagsAttr &propValue) { this->fastmath = propValue; } bool operator==(const Properties &rhs) const { return rhs.fastmath == this->fastmath && true; } bool operator!=(const Properties &rhs) const { return !(*this == rhs); } }; protected: ::mlir::DictionaryAttr odsAttrs; ::std::optional<::mlir::OperationName> odsOpName; Properties properties; ::mlir::RegionRange odsRegions; public: SubOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : odsAttrs(attrs), properties(properties), odsRegions(regions) { if (odsAttrs) odsOpName.emplace("complex.sub", odsAttrs.getContext()); } SubOpGenericAdaptorBase(SubOp op); std::pair getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize) { return {index, 1}; } const Properties &getProperties() { return properties; } ::mlir::DictionaryAttr getAttributes() { return odsAttrs; } ::mlir::arith::FastMathFlagsAttr getFastmathAttr(); ::mlir::arith::FastMathFlags getFastmath(); }; } // namespace detail template class SubOpGenericAdaptor : public detail::SubOpGenericAdaptorBase { using ValueT = ::llvm::detail::ValueOfRange; using Base = detail::SubOpGenericAdaptorBase; static constexpr int odsIndex_lhs = 0; static constexpr int odsIndex_rhs = 1; public: SubOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {} SubOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::PropertyRef properties, ::mlir::RegionRange regions = {}) : SubOpGenericAdaptor(values, attrs, (properties ? *properties.as() : Properties{}), regions) {} SubOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs = nullptr) : SubOpGenericAdaptor(values, attrs, Properties{}, {}) {} SubOpGenericAdaptor(RangeT values, const SubOpGenericAdaptorBase &base) : Base(base), odsOperands(values) {} template >> SubOpGenericAdaptor(RangeT values, LateInst op) : Base(op), odsOperands(values) {} std::pair getODSOperandIndexAndLength(unsigned index) { return Base::getODSOperandIndexAndLength(index, odsOperands.size()); } RangeT getODSOperands(unsigned index) { auto valueRange = getODSOperandIndexAndLength(index); return {std::next(odsOperands.begin(), valueRange.first), std::next(odsOperands.begin(), valueRange.first + valueRange.second)}; } ValueT getLhs() { return (*getODSOperands(0).begin()); } ValueT getRhs() { return (*getODSOperands(1).begin()); } RangeT getOperands() { return odsOperands; } private: RangeT odsOperands; }; class SubOpAdaptor : public SubOpGenericAdaptor<::mlir::ValueRange> { public: using SubOpGenericAdaptor::SubOpGenericAdaptor; SubOpAdaptor(SubOp op); ::llvm::LogicalResult verify(::mlir::Location loc); }; class SubOp : public ::mlir::Op::Impl, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::NOperands<2>::Impl, ::mlir::OpTrait::OpInvariants, ::mlir::BytecodeOpInterface::Trait, ::mlir::ConditionallySpeculatable::Trait, ::mlir::OpTrait::AlwaysSpeculatableImplTrait, ::mlir::MemoryEffectOpInterface::Trait, ::mlir::OpTrait::SameOperandsAndResultType, ::mlir::OpTrait::Elementwise, ::mlir::arith::ArithFastMathInterface::Trait, ::mlir::InferTypeOpInterface::Trait> { public: using Op::Op; using Op::print; using Adaptor = SubOpAdaptor; template using GenericAdaptor = SubOpGenericAdaptor; using FoldAdaptor = GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute>>; static constexpr int odsIndex_lhs = 0; static constexpr int odsIndex_rhs = 1; using Properties = FoldAdaptor::Properties; using ::mlir::arith::ArithFastMathInterface::Trait::getFastMathFlagsAttr; using ::mlir::arith::ArithFastMathInterface::Trait::getFastMathAttrName; static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() { static ::llvm::StringRef attrNames[] = {::llvm::StringRef("fastmath")}; return ::llvm::ArrayRef(attrNames); } ::mlir::StringAttr getFastmathAttrName() { return getAttributeNameForIndex(0); } static ::mlir::StringAttr getFastmathAttrName(::mlir::OperationName name) { return getAttributeNameForIndex(name, 0); } static constexpr ::llvm::StringLiteral getOperationName() { return ::llvm::StringLiteral("complex.sub"); } std::pair getODSOperandIndexAndLength(unsigned index) { return {index, 1}; } ::mlir::Operation::operand_range getODSOperands(unsigned index) { auto valueRange = getODSOperandIndexAndLength(index); return {std::next(getOperation()->operand_begin(), valueRange.first), std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)}; } ::mlir::TypedValue<::mlir::ComplexType> getLhs() { return ::llvm::cast<::mlir::TypedValue<::mlir::ComplexType>>(*getODSOperands(0).begin()); } ::mlir::TypedValue<::mlir::ComplexType> getRhs() { return ::llvm::cast<::mlir::TypedValue<::mlir::ComplexType>>(*getODSOperands(1).begin()); } ::mlir::OpOperand &getLhsMutable() { auto range = getODSOperandIndexAndLength(0); return getOperation()->getOpOperand(range.first); } ::mlir::OpOperand &getRhsMutable() { auto range = getODSOperandIndexAndLength(1); return getOperation()->getOpOperand(range.first); } std::pair getODSResultIndexAndLength(unsigned index) { return {index, 1}; } ::mlir::Operation::result_range getODSResults(unsigned index) { auto valueRange = getODSResultIndexAndLength(index); return {std::next(getOperation()->result_begin(), valueRange.first), std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)}; } ::mlir::TypedValue<::mlir::ComplexType> getResult() { return ::llvm::cast<::mlir::TypedValue<::mlir::ComplexType>>(*getODSResults(0).begin()); } static ::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); static ::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop); static llvm::hash_code computePropertiesHash(const Properties &prop); static std::optional getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name); static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value); static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs); static ::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); static ::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state); void writeProperties(::mlir::DialectBytecodeWriter &writer); ::mlir::arith::FastMathFlagsAttr getFastmathAttr() { return ::llvm::dyn_cast_or_null<::mlir::arith::FastMathFlagsAttr>(getProperties().fastmath); } ::mlir::arith::FastMathFlags getFastmath(); void setFastmathAttr(::mlir::arith::FastMathFlagsAttr attr) { getProperties().fastmath = attr; } void setFastmath(::mlir::arith::FastMathFlags attrValue); static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlagsAttr fastmath); static SubOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlagsAttr fastmath); static SubOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlagsAttr fastmath); static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlagsAttr fastmath); static SubOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlagsAttr fastmath); static SubOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlagsAttr fastmath); static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlagsAttr fastmath); static SubOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlagsAttr fastmath); static SubOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlagsAttr fastmath); static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); static SubOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); static SubOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type result, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); static SubOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); static SubOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); static SubOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); static SubOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value lhs, ::mlir::Value rhs, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); static SubOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); static SubOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); static SubOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); static SubOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); static SubOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); static SubOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); static SubOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); static SubOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); static void populateDefaultProperties(::mlir::OperationName opName, Properties &properties); ::llvm::LogicalResult verifyInvariantsImpl(); ::llvm::LogicalResult verifyInvariants(); ::mlir::OpFoldResult fold(FoldAdaptor adaptor); static ::llvm::LogicalResult inferReturnTypes(::mlir::MLIRContext *context, ::std::optional<::mlir::Location> location, ::mlir::ValueRange operands, ::mlir::DictionaryAttr attributes, ::mlir::PropertyRef properties, ::mlir::RegionRange regions, ::llvm::SmallVectorImpl<::mlir::Type>&inferredReturnTypes); static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result); void print(::mlir::OpAsmPrinter &_odsPrinter); void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects); private: ::mlir::StringAttr getAttributeNameForIndex(unsigned index) { return getAttributeNameForIndex((*this)->getName(), index); } static ::mlir::StringAttr getAttributeNameForIndex(::mlir::OperationName name, unsigned index) { assert(index < 1 && "invalid attribute index"); assert(name.getStringRef() == getOperationName() && "invalid operation name"); assert(name.isRegistered() && "Operation isn't registered, missing a " "dependent dialect loading?"); return name.getAttributeNames()[index]; } public: }; } // namespace mlir::complex MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::complex::SubOp) MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::complex::detail::SubOpGenericAdaptorBase::Properties) namespace mlir::complex { //===----------------------------------------------------------------------===// // ::mlir::complex::TanOp declarations //===----------------------------------------------------------------------===// namespace detail { class TanOpGenericAdaptorBase { public: struct Properties { using fastmathTy = ::mlir::arith::FastMathFlagsAttr; fastmathTy fastmath; auto getFastmath() const { auto &propStorage = this->fastmath; return ::llvm::dyn_cast_or_null<::mlir::arith::FastMathFlagsAttr>(propStorage); } void setFastmath(const ::mlir::arith::FastMathFlagsAttr &propValue) { this->fastmath = propValue; } bool operator==(const Properties &rhs) const { return rhs.fastmath == this->fastmath && true; } bool operator!=(const Properties &rhs) const { return !(*this == rhs); } }; protected: ::mlir::DictionaryAttr odsAttrs; ::std::optional<::mlir::OperationName> odsOpName; Properties properties; ::mlir::RegionRange odsRegions; public: TanOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : odsAttrs(attrs), properties(properties), odsRegions(regions) { if (odsAttrs) odsOpName.emplace("complex.tan", odsAttrs.getContext()); } TanOpGenericAdaptorBase(TanOp op); std::pair getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize) { return {index, 1}; } const Properties &getProperties() { return properties; } ::mlir::DictionaryAttr getAttributes() { return odsAttrs; } ::mlir::arith::FastMathFlagsAttr getFastmathAttr(); ::mlir::arith::FastMathFlags getFastmath(); }; } // namespace detail template class TanOpGenericAdaptor : public detail::TanOpGenericAdaptorBase { using ValueT = ::llvm::detail::ValueOfRange; using Base = detail::TanOpGenericAdaptorBase; static constexpr int odsIndex_complex = 0; public: TanOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {} TanOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::PropertyRef properties, ::mlir::RegionRange regions = {}) : TanOpGenericAdaptor(values, attrs, (properties ? *properties.as() : Properties{}), regions) {} TanOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs = nullptr) : TanOpGenericAdaptor(values, attrs, Properties{}, {}) {} TanOpGenericAdaptor(RangeT values, const TanOpGenericAdaptorBase &base) : Base(base), odsOperands(values) {} template >> TanOpGenericAdaptor(RangeT values, LateInst op) : Base(op), odsOperands(values) {} std::pair getODSOperandIndexAndLength(unsigned index) { return Base::getODSOperandIndexAndLength(index, odsOperands.size()); } RangeT getODSOperands(unsigned index) { auto valueRange = getODSOperandIndexAndLength(index); return {std::next(odsOperands.begin(), valueRange.first), std::next(odsOperands.begin(), valueRange.first + valueRange.second)}; } ValueT getComplex() { return (*getODSOperands(0).begin()); } RangeT getOperands() { return odsOperands; } private: RangeT odsOperands; }; class TanOpAdaptor : public TanOpGenericAdaptor<::mlir::ValueRange> { public: using TanOpGenericAdaptor::TanOpGenericAdaptor; TanOpAdaptor(TanOp op); ::llvm::LogicalResult verify(::mlir::Location loc); }; class TanOp : public ::mlir::Op::Impl, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::OneOperand, ::mlir::OpTrait::OpInvariants, ::mlir::BytecodeOpInterface::Trait, ::mlir::OpTrait::SameOperandsAndResultType, ::mlir::ConditionallySpeculatable::Trait, ::mlir::OpTrait::AlwaysSpeculatableImplTrait, ::mlir::MemoryEffectOpInterface::Trait, ::mlir::OpTrait::Elementwise, ::mlir::arith::ArithFastMathInterface::Trait, ::mlir::InferTypeOpInterface::Trait> { public: using Op::Op; using Op::print; using Adaptor = TanOpAdaptor; template using GenericAdaptor = TanOpGenericAdaptor; using FoldAdaptor = GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute>>; static constexpr int odsIndex_complex = 0; using Properties = FoldAdaptor::Properties; using ::mlir::arith::ArithFastMathInterface::Trait::getFastMathFlagsAttr; using ::mlir::arith::ArithFastMathInterface::Trait::getFastMathAttrName; static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() { static ::llvm::StringRef attrNames[] = {::llvm::StringRef("fastmath")}; return ::llvm::ArrayRef(attrNames); } ::mlir::StringAttr getFastmathAttrName() { return getAttributeNameForIndex(0); } static ::mlir::StringAttr getFastmathAttrName(::mlir::OperationName name) { return getAttributeNameForIndex(name, 0); } static constexpr ::llvm::StringLiteral getOperationName() { return ::llvm::StringLiteral("complex.tan"); } std::pair getODSOperandIndexAndLength(unsigned index) { return {index, 1}; } ::mlir::Operation::operand_range getODSOperands(unsigned index) { auto valueRange = getODSOperandIndexAndLength(index); return {std::next(getOperation()->operand_begin(), valueRange.first), std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)}; } ::mlir::TypedValue<::mlir::ComplexType> getComplex() { return ::llvm::cast<::mlir::TypedValue<::mlir::ComplexType>>(*getODSOperands(0).begin()); } ::mlir::OpOperand &getComplexMutable() { auto range = getODSOperandIndexAndLength(0); return getOperation()->getOpOperand(range.first); } std::pair getODSResultIndexAndLength(unsigned index) { return {index, 1}; } ::mlir::Operation::result_range getODSResults(unsigned index) { auto valueRange = getODSResultIndexAndLength(index); return {std::next(getOperation()->result_begin(), valueRange.first), std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)}; } ::mlir::TypedValue<::mlir::ComplexType> getResult() { return ::llvm::cast<::mlir::TypedValue<::mlir::ComplexType>>(*getODSResults(0).begin()); } static ::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); static ::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop); static llvm::hash_code computePropertiesHash(const Properties &prop); static std::optional getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name); static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value); static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs); static ::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); static ::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state); void writeProperties(::mlir::DialectBytecodeWriter &writer); ::mlir::arith::FastMathFlagsAttr getFastmathAttr() { return ::llvm::dyn_cast_or_null<::mlir::arith::FastMathFlagsAttr>(getProperties().fastmath); } ::mlir::arith::FastMathFlags getFastmath(); void setFastmathAttr(::mlir::arith::FastMathFlagsAttr attr) { getProperties().fastmath = attr; } void setFastmath(::mlir::arith::FastMathFlags attrValue); static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value complex, ::mlir::arith::FastMathFlagsAttr fastmath); static TanOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::Value complex, ::mlir::arith::FastMathFlagsAttr fastmath); static TanOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type result, ::mlir::Value complex, ::mlir::arith::FastMathFlagsAttr fastmath); static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value complex, ::mlir::arith::FastMathFlagsAttr fastmath); static TanOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value complex, ::mlir::arith::FastMathFlagsAttr fastmath); static TanOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value complex, ::mlir::arith::FastMathFlagsAttr fastmath); static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value complex, ::mlir::arith::FastMathFlagsAttr fastmath); static TanOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value complex, ::mlir::arith::FastMathFlagsAttr fastmath); static TanOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value complex, ::mlir::arith::FastMathFlagsAttr fastmath); static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value complex, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); static TanOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::Value complex, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); static TanOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type result, ::mlir::Value complex, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value complex, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); static TanOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value complex, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); static TanOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value complex, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value complex, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); static TanOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value complex, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); static TanOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value complex, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); static TanOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); static TanOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); static TanOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); static TanOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); static TanOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); static TanOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); static TanOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); static TanOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); static void populateDefaultProperties(::mlir::OperationName opName, Properties &properties); ::llvm::LogicalResult verifyInvariantsImpl(); ::llvm::LogicalResult verifyInvariants(); static ::llvm::LogicalResult inferReturnTypes(::mlir::MLIRContext *context, ::std::optional<::mlir::Location> location, ::mlir::ValueRange operands, ::mlir::DictionaryAttr attributes, ::mlir::PropertyRef properties, ::mlir::RegionRange regions, ::llvm::SmallVectorImpl<::mlir::Type>&inferredReturnTypes); static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result); void print(::mlir::OpAsmPrinter &_odsPrinter); void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects); private: ::mlir::StringAttr getAttributeNameForIndex(unsigned index) { return getAttributeNameForIndex((*this)->getName(), index); } static ::mlir::StringAttr getAttributeNameForIndex(::mlir::OperationName name, unsigned index) { assert(index < 1 && "invalid attribute index"); assert(name.getStringRef() == getOperationName() && "invalid operation name"); assert(name.isRegistered() && "Operation isn't registered, missing a " "dependent dialect loading?"); return name.getAttributeNames()[index]; } public: }; } // namespace mlir::complex MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::complex::TanOp) MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::complex::detail::TanOpGenericAdaptorBase::Properties) namespace mlir::complex { //===----------------------------------------------------------------------===// // ::mlir::complex::TanhOp declarations //===----------------------------------------------------------------------===// namespace detail { class TanhOpGenericAdaptorBase { public: struct Properties { using fastmathTy = ::mlir::arith::FastMathFlagsAttr; fastmathTy fastmath; auto getFastmath() const { auto &propStorage = this->fastmath; return ::llvm::dyn_cast_or_null<::mlir::arith::FastMathFlagsAttr>(propStorage); } void setFastmath(const ::mlir::arith::FastMathFlagsAttr &propValue) { this->fastmath = propValue; } bool operator==(const Properties &rhs) const { return rhs.fastmath == this->fastmath && true; } bool operator!=(const Properties &rhs) const { return !(*this == rhs); } }; protected: ::mlir::DictionaryAttr odsAttrs; ::std::optional<::mlir::OperationName> odsOpName; Properties properties; ::mlir::RegionRange odsRegions; public: TanhOpGenericAdaptorBase(::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : odsAttrs(attrs), properties(properties), odsRegions(regions) { if (odsAttrs) odsOpName.emplace("complex.tanh", odsAttrs.getContext()); } TanhOpGenericAdaptorBase(TanhOp op); std::pair getODSOperandIndexAndLength(unsigned index, unsigned odsOperandsSize) { return {index, 1}; } const Properties &getProperties() { return properties; } ::mlir::DictionaryAttr getAttributes() { return odsAttrs; } ::mlir::arith::FastMathFlagsAttr getFastmathAttr(); ::mlir::arith::FastMathFlags getFastmath(); }; } // namespace detail template class TanhOpGenericAdaptor : public detail::TanhOpGenericAdaptorBase { using ValueT = ::llvm::detail::ValueOfRange; using Base = detail::TanhOpGenericAdaptorBase; static constexpr int odsIndex_complex = 0; public: TanhOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, const Properties &properties, ::mlir::RegionRange regions = {}) : Base(attrs, properties, regions), odsOperands(values) {} TanhOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs, ::mlir::PropertyRef properties, ::mlir::RegionRange regions = {}) : TanhOpGenericAdaptor(values, attrs, (properties ? *properties.as() : Properties{}), regions) {} TanhOpGenericAdaptor(RangeT values, ::mlir::DictionaryAttr attrs = nullptr) : TanhOpGenericAdaptor(values, attrs, Properties{}, {}) {} TanhOpGenericAdaptor(RangeT values, const TanhOpGenericAdaptorBase &base) : Base(base), odsOperands(values) {} template >> TanhOpGenericAdaptor(RangeT values, LateInst op) : Base(op), odsOperands(values) {} std::pair getODSOperandIndexAndLength(unsigned index) { return Base::getODSOperandIndexAndLength(index, odsOperands.size()); } RangeT getODSOperands(unsigned index) { auto valueRange = getODSOperandIndexAndLength(index); return {std::next(odsOperands.begin(), valueRange.first), std::next(odsOperands.begin(), valueRange.first + valueRange.second)}; } ValueT getComplex() { return (*getODSOperands(0).begin()); } RangeT getOperands() { return odsOperands; } private: RangeT odsOperands; }; class TanhOpAdaptor : public TanhOpGenericAdaptor<::mlir::ValueRange> { public: using TanhOpGenericAdaptor::TanhOpGenericAdaptor; TanhOpAdaptor(TanhOp op); ::llvm::LogicalResult verify(::mlir::Location loc); }; class TanhOp : public ::mlir::Op::Impl, ::mlir::OpTrait::ZeroSuccessors, ::mlir::OpTrait::OneOperand, ::mlir::OpTrait::OpInvariants, ::mlir::BytecodeOpInterface::Trait, ::mlir::OpTrait::SameOperandsAndResultType, ::mlir::ConditionallySpeculatable::Trait, ::mlir::OpTrait::AlwaysSpeculatableImplTrait, ::mlir::MemoryEffectOpInterface::Trait, ::mlir::OpTrait::Elementwise, ::mlir::arith::ArithFastMathInterface::Trait, ::mlir::InferTypeOpInterface::Trait> { public: using Op::Op; using Op::print; using Adaptor = TanhOpAdaptor; template using GenericAdaptor = TanhOpGenericAdaptor; using FoldAdaptor = GenericAdaptor<::llvm::ArrayRef<::mlir::Attribute>>; static constexpr int odsIndex_complex = 0; using Properties = FoldAdaptor::Properties; using ::mlir::arith::ArithFastMathInterface::Trait::getFastMathFlagsAttr; using ::mlir::arith::ArithFastMathInterface::Trait::getFastMathAttrName; static ::llvm::ArrayRef<::llvm::StringRef> getAttributeNames() { static ::llvm::StringRef attrNames[] = {::llvm::StringRef("fastmath")}; return ::llvm::ArrayRef(attrNames); } ::mlir::StringAttr getFastmathAttrName() { return getAttributeNameForIndex(0); } static ::mlir::StringAttr getFastmathAttrName(::mlir::OperationName name) { return getAttributeNameForIndex(name, 0); } static constexpr ::llvm::StringLiteral getOperationName() { return ::llvm::StringLiteral("complex.tanh"); } std::pair getODSOperandIndexAndLength(unsigned index) { return {index, 1}; } ::mlir::Operation::operand_range getODSOperands(unsigned index) { auto valueRange = getODSOperandIndexAndLength(index); return {std::next(getOperation()->operand_begin(), valueRange.first), std::next(getOperation()->operand_begin(), valueRange.first + valueRange.second)}; } ::mlir::TypedValue<::mlir::ComplexType> getComplex() { return ::llvm::cast<::mlir::TypedValue<::mlir::ComplexType>>(*getODSOperands(0).begin()); } ::mlir::OpOperand &getComplexMutable() { auto range = getODSOperandIndexAndLength(0); return getOperation()->getOpOperand(range.first); } std::pair getODSResultIndexAndLength(unsigned index) { return {index, 1}; } ::mlir::Operation::result_range getODSResults(unsigned index) { auto valueRange = getODSResultIndexAndLength(index); return {std::next(getOperation()->result_begin(), valueRange.first), std::next(getOperation()->result_begin(), valueRange.first + valueRange.second)}; } ::mlir::TypedValue<::mlir::ComplexType> getResult() { return ::llvm::cast<::mlir::TypedValue<::mlir::ComplexType>>(*getODSResults(0).begin()); } static ::llvm::LogicalResult setPropertiesFromAttr(Properties &prop, ::mlir::Attribute attr, ::llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); static ::mlir::Attribute getPropertiesAsAttr(::mlir::MLIRContext *ctx, const Properties &prop); static llvm::hash_code computePropertiesHash(const Properties &prop); static std::optional getInherentAttr(::mlir::MLIRContext *ctx, const Properties &prop, llvm::StringRef name); static void setInherentAttr(Properties &prop, llvm::StringRef name, mlir::Attribute value); static void populateInherentAttrs(::mlir::MLIRContext *ctx, const Properties &prop, ::mlir::NamedAttrList &attrs); static ::llvm::LogicalResult verifyInherentAttrs(::mlir::OperationName opName, ::mlir::NamedAttrList &attrs, llvm::function_ref<::mlir::InFlightDiagnostic()> emitError); static ::llvm::LogicalResult readProperties(::mlir::DialectBytecodeReader &reader, ::mlir::OperationState &state); void writeProperties(::mlir::DialectBytecodeWriter &writer); ::mlir::arith::FastMathFlagsAttr getFastmathAttr() { return ::llvm::dyn_cast_or_null<::mlir::arith::FastMathFlagsAttr>(getProperties().fastmath); } ::mlir::arith::FastMathFlags getFastmath(); void setFastmathAttr(::mlir::arith::FastMathFlagsAttr attr) { getProperties().fastmath = attr; } void setFastmath(::mlir::arith::FastMathFlags attrValue); static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value complex, ::mlir::arith::FastMathFlagsAttr fastmath); static TanhOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::Value complex, ::mlir::arith::FastMathFlagsAttr fastmath); static TanhOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type result, ::mlir::Value complex, ::mlir::arith::FastMathFlagsAttr fastmath); static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value complex, ::mlir::arith::FastMathFlagsAttr fastmath); static TanhOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value complex, ::mlir::arith::FastMathFlagsAttr fastmath); static TanhOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value complex, ::mlir::arith::FastMathFlagsAttr fastmath); static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value complex, ::mlir::arith::FastMathFlagsAttr fastmath); static TanhOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value complex, ::mlir::arith::FastMathFlagsAttr fastmath); static TanhOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value complex, ::mlir::arith::FastMathFlagsAttr fastmath); static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Type result, ::mlir::Value complex, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); static TanhOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Type result, ::mlir::Value complex, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); static TanhOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Type result, ::mlir::Value complex, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::Value complex, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); static TanhOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::Value complex, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); static TanhOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::Value complex, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::Value complex, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); static TanhOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::Value complex, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); static TanhOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::Value complex, ::mlir::arith::FastMathFlags fastmath = ::mlir::arith::FastMathFlags::none); static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); static TanhOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); static TanhOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); static TanhOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); static TanhOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, ::llvm::ArrayRef<::mlir::NamedAttribute> attributes = {}); static void build(::mlir::OpBuilder &, ::mlir::OperationState &odsState, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); static TanhOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); static TanhOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::TypeRange resultTypes, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); static void build(::mlir::OpBuilder &odsBuilder, ::mlir::OperationState &odsState, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); static TanhOp create(::mlir::OpBuilder &builder, ::mlir::Location location, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); static TanhOp create(::mlir::ImplicitLocOpBuilder &builder, ::mlir::ValueRange operands, const Properties &properties, ::llvm::ArrayRef<::mlir::NamedAttribute> discardableAttributes = {}); static void populateDefaultProperties(::mlir::OperationName opName, Properties &properties); ::llvm::LogicalResult verifyInvariantsImpl(); ::llvm::LogicalResult verifyInvariants(); static ::llvm::LogicalResult inferReturnTypes(::mlir::MLIRContext *context, ::std::optional<::mlir::Location> location, ::mlir::ValueRange operands, ::mlir::DictionaryAttr attributes, ::mlir::PropertyRef properties, ::mlir::RegionRange regions, ::llvm::SmallVectorImpl<::mlir::Type>&inferredReturnTypes); static ::mlir::ParseResult parse(::mlir::OpAsmParser &parser, ::mlir::OperationState &result); void print(::mlir::OpAsmPrinter &_odsPrinter); void getEffects(::llvm::SmallVectorImpl<::mlir::SideEffects::EffectInstance<::mlir::MemoryEffects::Effect>> &effects); private: ::mlir::StringAttr getAttributeNameForIndex(unsigned index) { return getAttributeNameForIndex((*this)->getName(), index); } static ::mlir::StringAttr getAttributeNameForIndex(::mlir::OperationName name, unsigned index) { assert(index < 1 && "invalid attribute index"); assert(name.getStringRef() == getOperationName() && "invalid operation name"); assert(name.isRegistered() && "Operation isn't registered, missing a " "dependent dialect loading?"); return name.getAttributeNames()[index]; } public: }; } // namespace mlir::complex MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::complex::TanhOp) MLIR_DECLARE_EXPLICIT_TYPE_ID(::mlir::complex::detail::TanhOpGenericAdaptorBase::Properties) #endif // GET_OP_CLASSES